monocle3 icon indicating copy to clipboard operation
monocle3 copied to clipboard

The batch still in process with monocle3

Open honghh2018 opened this issue 3 years ago • 2 comments

Hi all, The monocle3 can remove the batch effect in the turorial vignette, however i runing the step to avoid the batch, it was disable to work in my data. the code lying below: DefaultAssay(li)<-'RNA' data <- GetAssayData(object = li, slot = "counts")

celldata <- as.data.frame([email protected]) genedata <- as.data.frame(x = row.names(data), row.names = row.names(data)) colnames(genedata) <- "gene_short_name" cds <- new_cell_data_set(data, cell_metadata = celldata, gene_metadata = genedata)

cds <- preprocess_cds(cds, num_dim = 100) cds <- align_cds(cds, alignment_group = 'orig.ident',num_dim = 25) cds <- reduce_dimension(cds) plot_cells(cds, color_cells_by="orig.ident", label_cell_groups=FALSE) The result showing: image

  The seurat integrated showing below: 

image

R session infor like below R version 4.0.2 (2020-06-22) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS: /share/nas1/Data/software/R/R-4.0.2/lib64/R/lib/libRblas.so LAPACK: /share/nas1/Data/software/R/R-4.0.2/lib64/R/lib/libRlapack.so

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

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

other attached packages: [1] monocle3_1.0.0 DDRTree_0.1.5 irlba_2.3.3 VGAM_1.1-5
[5] copykat_0.1.0 shiny_1.6.0 SeuratWrappers_0.3.0 magrittr_2.0.1
[9] slingshot_2.1.0 TrajectoryUtils_1.0.0 princurve_2.1.6 Cairo_1.5-12.2
[13] clusterProfiler_3.18.1 org.Hs.eg.db_3.12.0 AnnotationDbi_1.52.0 SingleCellExperiment_1.12.0 [17] SummarizedExperiment_1.20.0 Biobase_2.50.0 GenomicRanges_1.42.0 GenomeInfoDb_1.26.2
[21] IRanges_2.24.1 S4Vectors_0.28.1 BiocGenerics_0.36.0 MatrixGenerics_1.2.1
[25] matrixStats_0.58.0 scales_1.1.1 stringr_1.4.0 SingleR_1.0.1
[29] patchwork_1.1.1 ggplot2_3.3.3 conos_1.4.1 igraph_1.2.6
[33] Matrix_1.2-18 plyr_1.8.6 data.table_1.13.6 dplyr_1.0.4
[37] SeuratObject_4.0.0 Seurat_4.0.2

loaded via a namespace (and not attached): [1] scattermore_0.7 R.methodsS3_1.8.1 coda_0.19-4 tidyr_1.1.2
[5] bit64_4.0.5 DelayedArray_0.16.1 R.utils_2.10.1 rpart_4.1-15
[9] RCurl_1.98-1.2 doParallel_1.0.16 generics_0.1.0 leidenbase_0.1.3
[13] cowplot_1.1.1 RSQLite_2.2.3 combinat_0.0-8 shadowtext_0.0.7
[17] RANN_2.6.1 proxy_0.4-24 future_1.21.0 bit_4.0.4
[21] enrichplot_1.10.2 spatstat.data_2.1-0 httpuv_1.5.5 assertthat_0.2.1
[25] viridis_0.5.1 jquerylib_0.1.3 promises_1.2.0.1 fansi_0.4.2
[29] DBI_1.1.1 htmlwidgets_1.5.3 sparsesvd_0.2 spatstat.geom_2.1-0
[33] spdep_1.1-5 hash_2.2.6.1 purrr_0.3.4 ellipsis_0.3.1
[37] RSpectra_0.16-0 annotate_1.68.0 RcppParallel_5.0.2 deldir_0.2-9
[41] sparseMatrixStats_1.2.1 vctrs_0.3.6 remotes_2.2.0 ROCR_1.0-11
[45] abind_1.4-5 batchelor_1.6.2 cachem_1.0.3 withr_2.4.1
[49] ggforce_0.3.2 grr_0.9.5 doFuture_0.12.0 sctransform_0.3.2
[53] goftest_1.2-2 cluster_2.1.0 DOSE_3.16.0 lazyeval_0.2.2
[57] crayon_1.4.1 units_0.6-7 slam_0.1-48 labeling_0.4.2
[61] edgeR_3.32.1 pkgconfig_2.0.3 tweenr_1.0.1 nlme_3.1-148
[65] rlang_0.4.10 globals_0.14.0 lifecycle_0.2.0 miniUI_0.1.1.1
[69] downloader_0.4 rsvd_1.0.3 polyclip_1.10-0 GSVA_1.38.2
[73] lmtest_0.9-38 graph_1.68.0 raster_3.4-5 boot_1.3-25
[77] singscore_1.10.0 zoo_1.8-8 Matrix.utils_0.9.8 ggridges_0.5.3
[81] GlobalOptions_0.1.2 pheatmap_1.0.12 png_0.1-7 viridisLite_0.3.0
[85] rjson_0.2.20 bitops_1.0-6 R.oo_1.24.0 KernSmooth_2.23-17
[89] speedglm_0.3-3 blob_1.2.1 DelayedMatrixStats_1.12.3 classInt_0.4-3
[93] shape_1.4.5 qvalue_2.22.0 parallelly_1.23.0 sccore_0.1.3
[97] beachmat_2.6.4 memoise_2.0.0 GSEABase_1.52.1 ica_1.0-2
[101] gdata_2.18.0 zlibbioc_1.36.0 HSMMSingleCell_1.10.0 compiler_4.0.2
[105] scatterpie_0.1.5 RColorBrewer_1.1-2 clue_0.3-58 fitdistrplus_1.1-3
[109] cli_2.3.1 LearnBayes_2.15.1 XVector_0.30.0 listenv_0.8.0
[113] pbapply_1.4-3 MASS_7.3-51.6 mgcv_1.8-31 tidyselect_1.1.0
[117] stringi_1.5.3 densityClust_0.3 yaml_2.2.1 GOSemSim_2.16.1
[121] BiocSingular_1.6.0 locfit_1.5-9.4 ggrepel_0.9.1 pbmcapply_1.5.0
[125] grid_4.0.2 sass_0.3.1 fastmatch_1.1-0 tools_4.0.2
[129] future.apply_1.7.0 parallelDist_0.2.4 rstudioapi_0.13 circlize_0.4.12
[133] foreach_1.5.1 outliers_0.14 gridExtra_2.3 farver_2.0.3
[137] Rtsne_0.15 ggraph_2.0.4 digest_0.6.27 rvcheck_0.1.8
[141] BiocManager_1.30.10 FNN_1.1.3 monocle3_1.0.0 qlcMatrix_0.9.7
[145] Rcpp_1.0.6 scuttle_1.0.4 later_1.1.0.1 RcppAnnoy_0.0.18
[149] httr_1.4.2 sf_0.9-7 ComplexHeatmap_2.6.2 colorspace_2.0-0
[153] XML_3.99-0.5 tensor_1.5 reticulate_1.18 uwot_0.1.10
[157] expm_0.999-6 spatstat.utils_2.1-0 graphlayouts_0.7.1 sp_1.4-5
[161] spData_0.3.8 plotly_4.9.3 xtable_1.8-4 jsonlite_1.7.2
[165] leidenAlg_0.1.1 tidygraph_1.2.0 R6_2.5.0 gmodels_2.18.1
[169] pillar_1.4.7 htmltools_0.5.1.1 mime_0.9 glue_1.4.2
[173] fastmap_1.1.0 BiocParallel_1.24.1 BiocNeighbors_1.8.2 class_7.3-17
[177] codetools_0.2-16 fgsea_1.16.0 utf8_1.1.4 ResidualMatrix_1.0.0
[181] bslib_0.2.4 lattice_0.20-41 spatstat.sparse_2.0-0 tibble_3.0.6
[185] leiden_0.3.7 gtools_3.8.2 GO.db_3.12.1 survival_3.1-12
[189] limma_3.46.0 docopt_0.7.1 fastICA_1.2-2 munsell_0.5.0
[193] e1071_1.7-4 DO.db_2.9 GetoptLong_1.0.5 GenomeInfoDbData_1.2.4
[197] iterators_1.0.13 reshape2_1.4.4 gtable_0.3.0 spatstat.core_2.1-2

Had any advice for this? Best, hanshuihong

honghh2018 avatar Jun 30 '21 06:06 honghh2018

Same thing happened to me. It's not working for my two samples.

zhiweixiao avatar Jul 12 '21 15:07 zhiweixiao

@zhiweixiao you can push the batch-remove embedding coordination from seurat into monocle3 to solve this issue. Hope help.

honghh2018 avatar Sep 16 '21 01:09 honghh2018