HelenaLC / muscat

Multi-sample multi-group scRNA-seq analysis tools
166 stars 33 forks source link

Running sce #36

Closed yuyingxie closed 4 years ago

yuyingxie commented 4 years ago

Hello,

I am trying to run mmDS using method 'dream'. The data is the one from the tutorial and had the following error message.

res <- mmDS(sce, method = "dream", n_threads = 2, verbose = FALSE) Dividing work into 76 chunks... Error in serialize(data, node$con, xdr = FALSE) : error writing to connection In addition: Warning messages: 1: In DGEList(counts(x), norm.factors = 1/sizeFactors(x)) : norm factors don't multiply to 1 2: In dream(v, formula, cd, contrast, ddf = ddf, suppressWarnings = !verbose) : Contrasts with only a single non-zero term are already evaluated by default. 3: In for (what in c("x", "Dim", "Dimnames", "uplo", "factors")) slot(value, : closing unused connection 14 (<-localhost:11079) 4: In for (what in c("x", "Dim", "Dimnames", "uplo", "factors")) slot(value, : closing unused connection 13 (<-localhost:11079)

HelenaLC commented 4 years ago

I am unable to reproduce this with the following code

> library(muscat)
> data(sce)
> 
> # subset "B cells" cluster
> sce <- sce[, sce$cluster_id == "B cells"]
> sce$cluster_id <- droplevels(sce$cluster_id)
> 
> # downsample to 100 genes
> gs <- sample(nrow(sce), 100)
> sce <- sce[gs, ]
> 
> res <- mmDS(sce, method = "dream",
+     n_threads = 2, verbose = FALSE)
Warning message:
In DGEList(counts(x), norm.factors = 1/sizeFactors(x)) :
  norm factors don't multiply to 1
> head(res$`B cells`)
    gene cluster_id       logFC  AveExpr          t        p_val    p_adj.loc   p_adj.glb
1   CAPG    B cells 0.009309277 13.71097  0.1137184 9.095381e-01 0.9820115471 1.000000000
2  RAB7A    B cells 0.025544159 13.63895  0.3550080 7.228364e-01 0.9242825902 1.000000000
3 HIGD2A    B cells 0.089197093 13.66595  1.1760375 2.405249e-01 0.7146227141 1.000000000
4   CAP1    B cells 0.019527059 13.74079  0.2403889 8.101952e-01 0.9429285423 1.000000000
5   IRF7    B cells 1.732185383 14.52926 15.8377046 4.125222e-05 0.0006435346 0.003052664
6  RRAGC    B cells 0.033299677 13.51242  0.6496626 5.164140e-01 0.8931685291 1.000000000

and

> sessionInfo()
R version 4.0.0 RC (2020-04-21 r78267)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Catalina 10.15.6

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

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

other attached packages:
[1] muscat_1.2.1

loaded via a namespace (and not attached):
  [1] circlize_0.4.10             blme_1.0-4                  plyr_1.8.6                 
  [4] TMB_1.7.18                  splines_4.0.0               BiocParallel_1.22.0        
  [7] listenv_0.8.0               GenomeInfoDb_1.24.2         ggplot2_3.3.2              
 [10] scater_1.16.2               TH.data_1.0-10              digest_0.6.25              
 [13] foreach_1.5.0               viridis_0.5.1               gdata_2.18.0               
 [16] lmerTest_3.1-2              magrittr_1.5                memoise_1.1.0              
 [19] cluster_2.1.0               doParallel_1.0.15           limma_3.44.3               
 [22] ComplexHeatmap_2.4.3        globals_0.12.5              annotate_1.66.0            
 [25] matrixStats_0.56.0          sandwich_2.5-1              prettyunits_1.1.1          
 [28] colorspace_1.4-1            blob_1.2.1                  dplyr_1.0.0                
 [31] crayon_1.3.4                RCurl_1.98-1.2              genefilter_1.70.0          
 [34] lme4_1.1-23                 survival_3.2-3              zoo_1.8-8                  
 [37] iterators_1.0.12            glue_1.4.1                  gtable_0.3.0               
 [40] zlibbioc_1.34.0             emmeans_1.4.8               XVector_0.28.0             
 [43] GetoptLong_1.0.2            DelayedArray_0.14.1         BiocSingular_1.4.0         
 [46] future.apply_1.6.0          shape_1.4.4                 SingleCellExperiment_1.10.1
 [49] BiocGenerics_0.34.0         scales_1.1.1                mvtnorm_1.1-1              
 [52] DBI_1.1.0                   edgeR_3.30.3                Rcpp_1.0.5                 
 [55] viridisLite_0.3.0           xtable_1.8-4                progress_1.2.2             
 [58] clue_0.3-57                 bit_1.1-15.2                rsvd_1.0.3                 
 [61] stats4_4.0.0                gplots_3.0.4                RColorBrewer_1.1-2         
 [64] ellipsis_0.3.1              pkgconfig_2.0.3             XML_3.99-0.5               
 [67] locfit_1.5-9.4              tidyselect_1.1.0            rlang_0.4.7                
 [70] reshape2_1.4.4              AnnotationDbi_1.50.3        munsell_0.5.0              
 [73] tools_4.0.0                 generics_0.0.2              RSQLite_2.2.0              
 [76] stringr_1.4.0               bit64_0.9-7.1               caTools_1.18.0             
 [79] purrr_0.3.4                 future_1.18.0               nlme_3.1-148               
 [82] pbkrtest_0.4-8.6            compiler_4.0.0              rstudioapi_0.11            
 [85] beeswarm_0.2.3              png_0.1-7                   variancePartition_1.18.2   
 [88] tibble_3.0.3                statmod_1.4.34              geneplotter_1.66.0         
 [91] stringi_1.4.6               lattice_0.20-41             Matrix_1.2-18              
 [94] nloptr_1.2.2.2              vctrs_0.3.2                 pillar_1.4.6               
 [97] lifecycle_0.2.0             GlobalOptions_0.1.2         BiocNeighbors_1.6.0        
[100] estimability_1.3            data.table_1.13.0           bitops_1.0-6               
[103] irlba_2.3.3                 GenomicRanges_1.40.0        colorRamps_2.3             
[106] R6_2.4.1                    KernSmooth_2.23-17          gridExtra_2.3              
[109] vipor_0.4.5                 IRanges_2.22.2              codetools_0.2-16           
[112] boot_1.3-25                 MASS_7.3-51.6               gtools_3.8.2               
[115] SummarizedExperiment_1.18.2 DESeq2_1.28.1               rjson_0.2.20               
[118] sctransform_0.2.1           multcomp_1.4-13             S4Vectors_0.26.1           
[121] GenomeInfoDbData_1.2.3      parallel_4.0.0              hms_0.5.3                  
[124] grid_4.0.0                  coda_0.19-3                 glmmTMB_1.0.2.1            
[127] minqa_1.2.4                 DelayedMatrixStats_1.10.1   numDeriv_2016.8-1.1        
[130] Biobase_2.48.0              ggbeeswarm_0.6.0

While there is a warning, there is no error and mmDS returns a result. With any issue, could you please post the output of your sessionInfo()?

yuyingxie commented 4 years ago

Thanks Helenal.

R version 3.6.3 (2020-02-29) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)

Matrix products: default BLAS/LAPACK: /opt/software/OpenBLAS/0.3.7-GCC-8.3.0/lib/libopenblas_sandybridgep-r0.3.7.so

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] grid parallel stats4 stats graphics grDevices utils [8] datasets methods base

other attached packages: [1] glmmTMB_0.2.3 muscData_1.0.0 [3] ExperimentHub_1.12.0 AnnotationHub_2.18.0 [5] BiocFileCache_1.10.2 dbplyr_1.4.2 [7] muscat_1.0.1 scater_1.14.6 [9] SingleCellExperiment_1.8.0 SummarizedExperiment_1.16.1 [11] DelayedArray_0.12.3 BiocParallel_1.20.1 [13] matrixStats_0.56.0 Biobase_2.46.0 [15] GenomicRanges_1.38.0 GenomeInfoDb_1.22.1 [17] IRanges_2.20.2 scales_1.1.1 [19] pheatmap_1.0.12 ComplexHeatmap_2.2.0 [21] tibble_3.0.3 S4Vectors_0.24.4 [23] BiocGenerics_0.32.0 reshape2_1.4.4 [25] purrr_0.3.4 magrittr_1.5 [27] phateR_1.0.4 Matrix_1.2-18 [29] cowplot_1.0.0 ggplot2_3.3.2 [31] dplyr_1.0.1 gridExtra_2.3 [33] Seurat_3.2.0 viridis_0.5.1 [35] viridisLite_0.3.0 readr_1.3.1

loaded via a namespace (and not attached): [1] reticulate_1.16 tidyselect_1.1.0 [3] lme4_1.1-23 RSQLite_2.2.0 [5] AnnotationDbi_1.48.0 htmlwidgets_1.5.1 [7] Rtsne_0.15 munsell_0.5.0 [9] codetools_0.2-16 ica_1.0-2 [11] statmod_1.4.34 future_1.18.0 [13] miniUI_0.1.1.1 withr_2.2.0 [15] colorspace_1.4-1 knitr_1.29 [17] rstudioapi_0.11 ROCR_1.0-11 [19] tensor_1.5 listenv_0.8.0 [21] GenomeInfoDbData_1.2.2 polyclip_1.10-0 [23] bit64_0.9-7 vctrs_0.3.2 [25] generics_0.0.2 xfun_0.16 [27] R6_2.4.1 doParallel_1.0.15 [29] ggbeeswarm_0.6.0 clue_0.3-57 [31] rsvd_1.0.3 locfit_1.5-9.4 [33] bitops_1.0-6 spatstat.utils_1.17-0 [35] assertthat_0.2.1 promises_1.1.1 [37] nnet_7.3-12 beeswarm_0.2.3 [39] gtable_0.3.0 globals_0.12.5 [41] goftest_1.2-2 rlang_0.4.7 [43] genefilter_1.68.0 GlobalOptions_0.1.1 [45] splines_3.6.3 TMB_1.7.15 [47] lazyeval_0.2.2 checkmate_2.0.0 [49] yaml_2.2.1 BiocManager_1.30.10 [51] abind_1.4-5 backports_1.1.8 [53] httpuv_1.5.4 Hmisc_4.4-1 [55] tools_3.6.3 gplots_3.0.4 [57] ellipsis_0.3.1 RColorBrewer_1.1-2 [59] ggridges_0.5.2 Rcpp_1.0.5 [61] plyr_1.8.6 progress_1.2.2 [63] base64enc_0.1-3 zlibbioc_1.32.0 [65] RCurl_1.98-1.2 prettyunits_1.1.1 [67] rpart_4.1-15 deldir_0.1-28 [69] pbapply_1.4-2 GetoptLong_0.1.7 [71] zoo_1.8-8 ggrepel_0.8.2 [73] cluster_2.1.0 colorRamps_2.3 [75] variancePartition_1.16.1 data.table_1.13.0 [77] lmerTest_3.1-1 circlize_0.4.8 [79] lmtest_0.9-37 RANN_2.6.1 [81] fitdistrplus_1.1-1 hms_0.5.3 [83] patchwork_1.0.1 mime_0.9 [85] xtable_1.8-4 pbkrtest_0.4-8.6 [87] XML_3.99-0.3 jpeg_0.1-8.1 [89] shape_1.4.4 compiler_3.6.3 [91] KernSmooth_2.23-16 crayon_1.3.4 [93] minqa_1.2.4 htmltools_0.5.0 [95] mgcv_1.8-31 later_1.1.0.1 [97] Formula_1.2-3 tidyr_1.0.0 [99] geneplotter_1.64.0 DBI_1.1.0 [101] MASS_7.3-51.4 rappdirs_0.3.1 [103] boot_1.3-23 gdata_2.18.0 [105] igraph_1.2.5 pkgconfig_2.0.3 [107] numDeriv_2016.8-1.1 foreign_0.8-72 [109] plotly_4.9.1 foreach_1.5.0 [111] annotate_1.64.0 vipor_0.4.5 [113] blme_1.0-4 XVector_0.26.0 [115] stringr_1.4.0 digest_0.6.25 [117] sctransform_0.2.1 RcppAnnoy_0.0.16 [119] spatstat.data_1.4-3 leiden_0.3.3 [121] htmlTable_2.0.1 uwot_0.1.8 [123] edgeR_3.31.4 DelayedMatrixStats_1.8.0 [125] curl_4.3 gtools_3.8.2 [127] shiny_1.5.0 rjson_0.2.20 [129] nloptr_1.2.2.2 lifecycle_0.2.0 [131] nlme_3.1-143 jsonlite_1.7.0 [133] BiocNeighbors_1.4.2 limma_3.42.2 [135] pillar_1.4.6 lattice_0.20-38 [137] fastmap_1.0.1 httr_1.4.2 [139] survival_3.1-8 interactiveDisplayBase_1.24.0 [141] glue_1.4.1 spatstat_1.64-1 [143] png_0.1-7 iterators_1.0.12 [145] BiocVersion_3.10.1 bit_4.0.4 [147] stringi_1.4.6 blob_1.2.1 [149] DESeq2_1.26.0 BiocSingular_1.2.2 [151] caTools_1.18.0 latticeExtra_0.6-29 [153] memoise_1.1.0 irlba_2.3.3 [155] future.apply_1.6.0 ape_5.4-1

HelenaLC commented 4 years ago

You are using muscat version 1.0.x; the newest release (Bioconductor version 3.11) is 1.2.x. Updating via

BiocManager::install(version = "3.11")
BiocManager::valid() # should return TRUE

should resolve the error. Also, you have R 3.6.3. There was a major release of R 4.0 earlier this year, and I highly suggest updating to this as well as there is no guarantee Bioc 3.11 will be stable for 3.6.