Closed Samantha-Czn closed 3 years ago
Can you report what version of the MAST package and other tools you are using by providing the output of sessionInfo()
?
Thanks
Yep, it's:
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: /apps/intel/Composer/compilers_and_libraries_2020.0.166/linux/mkl/lib/intel64_lin/libmkl_gf_lp64.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] parallel stats4 stats graphics grDevices utils datasets [8] methods base
other attached packages:
[1] ggplot2_3.3.2 MAST_1.12.0
[3] SingleCellExperiment_1.8.0 SummarizedExperiment_1.16.1
[5] DelayedArray_0.12.3 BiocParallel_1.20.1
[7] matrixStats_0.57.0 Biobase_2.46.0
[9] GenomicRanges_1.38.0 GenomeInfoDb_1.22.1
[11] IRanges_2.20.2 S4Vectors_0.24.4
[13] BiocGenerics_0.32.0 Seurat_3.2.2
loaded via a namespace (and not attached):
[1] nlme_3.1-144 bitops_1.0-6 RcppAnnoy_0.0.16
[4] RColorBrewer_1.1-2 httr_1.4.1 sctransform_0.3.1
[7] tools_3.6.3 R6_2.4.1 irlba_2.3.3
[10] rpart_4.1-15 KernSmooth_2.23-16 uwot_0.1.8
[13] lazyeval_0.2.2 mgcv_1.8-31 colorspace_1.4-1
[16] withr_2.3.0 tidyselect_1.1.0 gridExtra_2.3
[19] compiler_3.6.3 plotly_4.9.2.1 scales_1.1.1
[22] lmtest_0.9-37 spatstat.data_1.4-3 ggridges_0.5.2
[25] pbapply_1.4-2 rappdirs_0.3.1 spatstat_1.64-1
[28] goftest_1.2-2 stringr_1.4.0 digest_0.6.27
[31] spatstat.utils_1.17-0 XVector_0.26.0 pkgconfig_2.0.3
[34] htmltools_0.5.0 fastmap_1.0.1 htmlwidgets_1.5.1
[37] rlang_0.4.8 shiny_1.5.0 generics_0.0.2
[40] zoo_1.8-8 jsonlite_1.7.1 ica_1.0-2
[43] dplyr_1.0.0 RCurl_1.98-1.2 magrittr_1.5
[46] GenomeInfoDbData_1.2.2 patchwork_1.0.1 Matrix_1.2-18
[49] Rcpp_1.0.5 munsell_0.5.0 abind_1.4-5
[52] reticulate_1.16 lifecycle_0.2.0 stringi_1.5.3
[55] zlibbioc_1.32.0 MASS_7.3-51.5 Rtsne_0.15
[58] plyr_1.8.6 grid_3.6.3 listenv_0.8.0
[61] promises_1.1.1 ggrepel_0.8.2 crayon_1.3.4
[64] miniUI_0.1.1.1 deldir_0.1-25 lattice_0.20-38
[67] cowplot_1.0.0 splines_3.6.3 tensor_1.5
[70] pillar_1.4.4 igraph_1.2.5 future.apply_1.6.0
[73] reshape2_1.4.4 codetools_0.2-16 leiden_0.3.3
[76] glue_1.4.2 data.table_1.13.2 png_0.1-7
[79] vctrs_0.3.4 httpuv_1.5.4 gtable_0.3.0
[82] RANN_2.6.1 purrr_0.3.4 polyclip_1.10-0
[85] tidyr_1.1.0 future_1.17.0 rsvd_1.0.3
[88] mime_0.9 xtable_1.8-4 later_1.1.0.1
[91] survival_3.1-8 viridisLite_0.3.0 tibble_3.0.1
[94] cluster_2.1.0 globals_0.12.5 fitdistrplus_1.1-1
[97] ellipsis_0.3.1 ROCR_1.0-11
Well,I'm sorry to tell you that your system is out of date with respect to Bioconductor, which is currently at 3.12 You're using what appears to be 3.10. So update your Bioconductor install and the MAST package. If you still get the error after that, come back here and we'll try to find the solution, otherwise if that resolves this problem, please come back here and close the issue.
Hi, I have updated my bioconductor to 3.11 (3.12 requires R 4.0.3 which I don't have and am currently unable to get) and it has the same error. Regardless I'm not sure that updating it would be much help as it did run perfectly the first time I ran the program, and that was with R/3.6.3 and bioconductor version 3.10. I don't know what's changed between the first time and the second time I ran it to give the error, but I don't think it's that I ran it on two different versions of the package.
Hi, Just letting you know I figured it out - it was a problem from when I created the object - my @assays@data@listData was of formal class dgCMatrix, and it needed to be in a matrix form. I fixed it by changing how I created the object, so insead of:
assay.data <- GetAssayData(new_obj, slot = "data")
colData <- DataFrame("orig.ident" = new_obj@meta.data$orig.ident,
"celltype" = new_obj@meta.data$celltype, "hash.id" = new_obj@meta.data$hash.id,
"nFeature_RNA" = new_obj@meta.data$nFeature_RNA)
newsce <- SummarizedExperiment(assay.data, colData = colData)
newsce <- SceToSingleCellAssay(newsce)
I did:
assay.data <- GetAssayData(new_obj, slot = "data")
newassay <- as.matrix(assay.data)
newsce <- FromMatrix(newassay)
colData <- new_obj@meta.data$orig.ident
colData(newsce)$condition <- colData
Thank you for your help :)
It shouldn't be a problem to have a dgCMatrix
as the assay
. We have test coverage for this, too. Seurat has a coercion method to SingleCellExperiments. So you'd do something like
sce = SceToSingleCellExperiment(as.SingleCellExperiment(new_obj))
Let me know if that doesn't work..
SceToSingleCellExperiment
was an unknown function, but it did work with SceToSingleCellAssay
instead (sce = SceToSingleCellAssay(as.SingleCellExperiment(new_obj))
worked well), so thank you :)
Hi, I'm having trouble with the zlm function.
I get this error:
> zlmCond <- zlm(~orig.ident + cngeneson, newsce) Error in (function (classes, fdef, mtable) :
unable to find an inherited method for function ‘fit’ for signature ‘"BayesGLMlike", "dgCMatrix"’
newsce is of class "SingleCellAssay". cngeneson is of class "matrix" My orig.ident is of class "character" so I tried converting it to "factor" to be like the example one (colData(newsce)$orig.ident <- as.factor(colData(newsce)$orig.ident)
) but it didn't help. I have two levels of orig.ident which are both strings. I ran the whole script before with zlm and it worked fine, so I'm really lost because I repeated everything the same as before and this time it's giving me that error.My code is below:
After loading in a Seurat object:
library(MAST)
freq_expressed <- 0.2
FCTHRESHOLD <- log2(1.5)
#taking data from the seurat object
assay.data <- GetAssayData(new_obj, slot = "data")
colData <- DataFrame("orig.ident" = new_obj@meta.data$orig.ident,
"celltype" = new_obj@meta.data$celltype, "hash.id" = new_obj@meta.data$hash.id,
"nFeature_RNA" = new_obj@meta.data$nFeature_RNA)
newsce <- SummarizedExperiment(assay.data, colData = colData)
newsce <- SceToSingleCellAssay(newsce)
#(lots of conversions because FromMatrix didn't work when I tried)
#Cellular detection rate
cdr2 <-colSums(assay(newsce)>0)
colData(newsce)$cngeneson <- scale(cdr2)
zlmCond <- zlm(~orig.ident + cngeneson, newsce)
Any help would be greatly appreciated :) Thank you