satijalab / seurat

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

Error when subsetting seurat object #8026

Closed cyw-code closed 4 months ago

cyw-code commented 12 months ago

Hi, I am getting the following error when subsetting my seurat object using seurat V5. I get the same error when trying to use the subset function. Any input would be much appreciated. Thank you.

library(Signac) library(SeuratObject) library(Seurat) data("pbmc_small")

Calculate the proportion of transcripts mapping to mitochondrial genes

NOTE: The pattern provided works for human gene names. You may need to adjust depending on your

system of interest

pbmc_small[["percent.mt"]] <- PercentageFeatureSet(object = pbmc_small, pattern = "^MT-") Error in LayerData(): ! features must be one of "MS4A1", "CD79B", "CD79A", "HLA-DRA", "TCL1A", "HLA-DQB1", "HVCN1", "HLA-DMB", "LTB", "LINC00926", "FCER2", "SP100", "NCF1", "PPP3CC", "EAF2", "PPAPDC1B", "CD19", "KIAA0125", "CYB561A3", "CD180", "RP11-693J15.5", "FAM96A", "CXCR4", "STX10", "SNHG7", "NT5C", "BANK1", "IGLL5", "CD200", "FCRLA", "CD3D", "NOSIP", "SAFB2", "CD2", "IL7R", "PIK3IP1", "MPHOSPH6", "KHDRBS1", "MAL", "CCR7", "THYN1", "TAF7", "LDHB", "TMEM123", "CCDC104", "EPC1", "EIF4A2", "CD3E", "TMUB1", "BLOC1S4", "ACSM3", "TMEM204", "SRSF7", "ACAP1", "TNFAIP8", "CD7", "TAGAP", "DNAJB1", "ASNSD1", "S1PR4", "CTSW", "GZMK", "NKG7", "IL32", "DNAJC2", "LYAR", "CST7", "LCK", "CCL5", "HNRNPH1", "SSR2", "DLGAP1-AS1", "GIMAP1", "MMADHC", "ZNF76", "CD8A", "PTPN22", "GYPC", "HNRNPF", "RPL7L1", "KLRG1", "CRBN", "SATB1", "SIT1", "PMPCB", "NRBP1", "TCF7", "HNRNPA3", "S100A8", "S100A9", "LYZ", "CD14", "FCN1", "TYROBP", "ASGR1", "NFKBIA", "TYMP", "CTSS", "TSPO", "RBP7", "CTSB", "LGALS1", "FPR1", "VSTM1", "BLVRA", "MPEG1", "BID", "SMCO4", "CFD", "LINC00936", "LGALS2", "MS4A6A", "FCGRT", "LGALS3", "NUP214", "SCO2", "IL17RA", "IFI6", "HLA-DPA1", "FCER1A", "CLEC10A", "HLA-DMA", "RGS1", "HLA-DPB1", "HLA-DQA1", "RNF130", "HLA-DRB5", "HLA-DRB1", "CST3", "IL1B", "POP7", "HLA-DQA2", "CD1C", "GSTP1", "EIF3G", "VPS28", "LY86", "ZFP36L1", "ZNF330", "ANXA2", "GRN", "CFP", "HSP90AA1", "FUOM", "LST1", "AIF1", "PSAP", "YWHAB", "MYO1G", "SAT1", "RGS2", "SERPINA1", "IFITM3", "FCGR3A", "LILRA3", "S100A11", "FCER1G", "TNFRSF1B", "IFITM2", "WARS", "IFI30", "MS4A7", "C5AR1", "HCK", "COTL1", "LGALS9", "CD68", "RP11-290F20.3", "RHOC", "CARD16", "LRRC25", "COPS6", "ADAR", "PPBP", "GPX1", "TPM4", "PF4", "SDPR", "NRGN", "SPARC", "GNG11", "CLU", "HIST1H2AC", "NCOA4", "GP9", "FERMT3", "ODC1", "CD9", "RUFY1", "TUBB1", "TALDO1", "TREML1", "NGFRAP1", "PGRMC1", "CA2", "ITGA2B", "MYL9", "TMEM40", "PARVB", "PTCRA", "ACRBP", "TSC22D1", "VDAC3", "GZMB", "GZMA", "GNLY", "FGFBP2", "AKR1C3", "CCL4", "PRF1", "GZMH", "XBP1", "GZMM", "PTGDR", "IGFBP7", "TTC38", "KLRD1", "ARHGDIA", "IL2RB", "CLIC3", "PPP1R18", "CD247", "ALOX5AP", "XCL2", "C12orf75", "RARRES3", "PCMT1", "LAMP1", "SPON2", or "S100B", not "counts". Run rlang::last_trace() to see where the error occurred.

cyw-code commented 12 months ago

And the followings are the version of my packages : Signac 1.12, SeuratObject 5.0 , Seurat 5.0

morallawwithin commented 11 months ago

Try adding the metadata as

pbmc_small$percent.mt

instead of

pbmc_small[["percent.mt"]]

cyw-code commented 11 months ago

Try adding the metadata as

pbmc_small$percent.mt

instead of

pbmc_small[["percent.mt"]]

Thank you! This may be an issue of R package version compatibility.