satijalab / seurat

R toolkit for single cell genomics
http://www.satijalab.org/seurat
Other
2.27k stars 910 forks source link

integrating 10x Surface Markers data #1728

Closed SBata closed 5 years ago

SBata commented 5 years ago

I'm working with 10X scRNASeq data and the Surface Markers data that come with it. I'm having issues integrating the two datasets, I'm following what suggested in the Multimodal Vignette (https://satijalab.org/seurat/v3.0/multimodal_vignette.html). more specifically:

mat <- Read10X(data.dir = matrix_dir)
# mat[[1]] will have RNA and mat[[2]] will have proteins

list_RNA <- CreateSeuratObject(counts = mat[[1]], project = nn, min.cells = 3, min.features = 200)
list_RNA[["percent.mt"]] <- PercentageFeatureSet(list_RNA, pattern = "^MT-")
list_RNA[[nn]] <- nn
list_RNA <- subset(list_RNA, subset = nFeature_RNA > 200 & nFeature_RNA < 2500 & percent.mt < 5)
list_RNA <- NormalizeData(list_RNA, normalization.method = "CLR", scale.factor = 10000, assay = "RNA")
list_RNA <- FindVariableFeatures(list_RNA, selection.method = "vst", nfeatures = 2000)
list_RNA <- ScaleData(list_RNA)

# now to integrate the data:
list_RNA[["Proteins"]] <- CreateAssayObject(mat[[2]])

but I get

Error: Cannot add a different number of cells than already present any suggestions?

satijalab commented 5 years ago

Should be an easy fix - just make sure to add the protein assay before subsetting.