satijalab / seurat

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

FIndMarker on subset cluster #7573

Closed gpersico91 closed 1 year ago

gpersico91 commented 1 year ago

Dear Seurat team, I'm analyzing some scRNAseq datasets (3 Cntl + 3 Treated).

After filtering, normalization (SCT v2) and integration steps of all 6 samples, I proceed with differential analysis between conditions

Here the code:

Idents(seurat)= paste(seurat@active.ident, seurat@meta.data$tissue, sep="_")

seurat <- PrepSCTFindMarkers(seurat)

Mionuclei <- FindMarkers(seurat, assay = "SCT", ident.1 = "Myonuclei_Normal", ident.2 = "Myonuclei_Cachexia", verbose = FALSE, test.use = 'MAST')

here the top 6

   p_val avg_log2FC pct.1 pct.2 p_val_adj

ACACB 0 0.4971566 0.596 0.405 0 AGBL1 0 0.6778062 0.668 0.442 0 FKBP5 0 1.2221753 0.816 0.581 0 KCNQ5 0 -0.8739999 0.743 0.877 0 MKNK2 0 0.3257864 0.285 0.094 0 MYBPC1 0 0.4419535 0.991 0.976 0

However, if I try to isolate Myonuclei population and then use FindMarker I obtain different results here the code

Idents(seurat)=seurat@active.ident
seurat.subset <- subset(seurat, idents ="Myonuclei")
Idents(seurat.subset) <- seurat@meta.data$tissue

Mionuclei.subset <- FindMarkers(seurat.subset, assay = "SCT", ident.1 = "Normal", ident.2 = "Cachexia", verbose = FALSE, recorrect_umi = FALSE, test.use = 'MAST')

here the top 6 p_val avg_log2FC pct.1 pct.2 p_val_adj

All this things doesn't happen using infb dataset!!!

Can you help me?? I have checked several times my code

Thanks in advance Giuseppe

sessionInfo() R version 4.1.3 (2022-03-10) Platform: x86_64-conda-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] Signac_1.8.0 ggplot2_3.3.6 dplyr_1.0.10 patchwork_1.1.2
[5] sp_1.5-0 SeuratObject_4.1.1 Seurat_4.1.1

loaded via a namespace (and not attached): [1] Rtsne_0.16 colorspace_2.1-0
[3] deldir_1.0-9 ellipsis_0.3.2
[5] ggridges_0.5.4 XVector_0.34.0
[7] GenomicRanges_1.46.1 spatstat.data_2.2-0
[9] leiden_0.4.3 listenv_0.9.0
[11] ggrepel_0.9.1 fansi_1.0.4
[13] sparseMatrixStats_1.6.0 codetools_0.2-19
[15] splines_4.1.3 RcppRoll_0.3.0
[17] polyclip_1.10-4 jsonlite_1.8.7
[19] Rsamtools_2.10.0 ica_1.0-3
[21] cluster_2.1.4 png_0.1-8
[23] rgeos_0.5-9 uwot_0.1.14
[25] shiny_1.7.2 sctransform_0.3.4
[27] spatstat.sparse_2.1-1 compiler_4.1.3
[29] httr_1.4.4 assertthat_0.2.1
[31] Matrix_1.4-1 fastmap_1.1.1
[33] lazyeval_0.2.2 cli_3.6.1
[35] later_1.2.0 prettyunits_1.1.1
[37] htmltools_0.5.3 tools_4.1.3
[39] igraph_1.3.4 GenomeInfoDbData_1.2.7
[41] gtable_0.3.1 glue_1.6.2
[43] RANN_2.6.1 reshape2_1.4.4
[45] fastmatch_1.1-3 Rcpp_1.0.11
[47] Biobase_2.54.0 scattermore_0.8
[49] Biostrings_2.62.0 vctrs_0.4.1
[51] nlme_3.1-159 progressr_0.11.0
[53] DelayedMatrixStats_1.16.0 lmtest_0.9-40
[55] spatstat.random_2.2-0 stringr_1.4.1
[57] globals_0.16.1 mime_0.12
[59] miniUI_0.1.1.1 lifecycle_1.0.2
[61] irlba_2.3.5 goftest_1.2-3
[63] future_1.28.0 zlibbioc_1.40.0
[65] MASS_7.3-60 zoo_1.8-11
[67] scales_1.2.1 MAST_1.20.0
[69] spatstat.core_2.4-4 hms_1.1.2
[71] MatrixGenerics_1.6.0 promises_1.2.0.1
[73] spatstat.utils_3.0-3 SummarizedExperiment_1.24.0 [75] parallel_4.1.3 RColorBrewer_1.1-3
[77] SingleCellExperiment_1.16.0 reticulate_1.26
[79] pbapply_1.7-2 gridExtra_2.3
[81] rpart_4.1.19 stringi_1.7.8
[83] S4Vectors_0.32.4 BiocGenerics_0.40.0
[85] BiocParallel_1.28.3 GenomeInfoDb_1.30.1
[87] rlang_1.1.1 pkgconfig_2.0.3
[89] matrixStats_1.0.0 bitops_1.0-7
[91] glmGamPoi_1.6.0 lattice_0.21-8
[93] ROCR_1.0-11 purrr_0.3.4
[95] tensor_1.5 htmlwidgets_1.5.4
[97] cowplot_1.1.1 tidyselect_1.2.0
[99] parallelly_1.36.0 RcppAnnoy_0.0.19
[101] plyr_1.8.7 magrittr_2.0.3
[103] R6_2.5.1 IRanges_2.28.0
[105] generics_0.1.3 DelayedArray_0.20.0
[107] DBI_1.1.3 pillar_1.8.1
[109] withr_2.5.0 mgcv_1.8-40
[111] fitdistrplus_1.1-8 survival_3.4-0
[113] abind_1.4-5 RCurl_1.98-1.12
[115] tibble_3.1.8 future.apply_1.9.1
[117] crayon_1.5.2 KernSmooth_2.23-22
[119] utf8_1.2.2 spatstat.geom_2.4-0
[121] plotly_4.10.0 progress_1.2.2
[123] grid_4.1.3 data.table_1.14.8
[125] digest_0.6.33 xtable_1.8-4
[127] tidyr_1.2.1 httpuv_1.6.6
[129] stats4_4.1.3 munsell_0.5.0
[131] viridisLite_0.4.1

longmanz commented 1 year ago

Hi, Have you checked that after you isolate Myonuclei population, the cells labeled as "Normal" or "Cachexia" really match the cells originally labelled as "Myonuclei_Normal" or "Myonuclei_Cachexia" ?

gpersico91 commented 1 year ago

Solved, the problem was do to Idents(seurat) used in wrong way. Thanks a lot