Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cell-level analysis: Vst method #74

Open
bassanio opened this issue Jun 30, 2021 · 4 comments
Open

Cell-level analysis: Vst method #74

bassanio opened this issue Jun 30, 2021 · 4 comments

Comments

@bassanio
Copy link

I have an error while running cell level method

mm <- mmDS(SE, method = "vst", vst = "sctransform")

Error:

Warning: The 'show_progress' argument is deprecated as of v0.3. Use 'verbosity' instead. (in sctransform::vst)
Calculating cell attributes from input UMI matrix: log_umi
Variance stabilizing transformation of count matrix of size 17247 by 17156
Model formula is y ~ log_umi
Get Negative Binomial regression parameters per gene
Using 2000 genes, 17156 cells
  |============================================================================| 100%
Found 124 outliers - those will be ignored in fitting/regularization step

Second step: Get residuals using fitted parameters for 17247 genes
  |============================================================================| 100%
Calculating gene attributes
Wall clock passed: Time difference of 3.924652 mins
Error in `assays<-`(`*tmp*`, withDimnames = withDimnames, ..., value = `*vtmp*`) : 
  please use 'assay(x, withDimnames=FALSE)) <- value' or 'assays(x,
  withDimnames=FALSE)) <- value' when the dimnames on the supplied assay(s)
  are not identical to the dimnames on SingleCellExperiment object 'x'
In addition: There were 50 or more warnings (use warnings() to see the first 50)

SE

class: SingleCellExperiment 
dim: 19304 17156 
metadata(1): experiment_info
assays(2): counts logcounts
rownames(19304): RP11-34P13.7 FO538757.2 ... AP001610.5 LINC01424
rowData names(0):
colnames(17156): AAACCTGAGCTAACTC_1 AAACCTGAGCTCCTCT_1 ...
  AGGGAGTCAGTCGTGC_10 AGGGAGTCATTCCTGC_10
colData names(3): cluster_id sample_id group_id
reducedDimNames(2): REF.SPCA REF.UMAP
altExpNames(0):
@HelenaLC
Copy link
Owner

Please post the output of your session info.

@bassanio
Copy link
Author

sessionInfo()
R version 4.0.4 (2021-02-15)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Big Sur 10.16

Matrix products: default
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] parallel  stats4    stats     graphics  grDevices utils     datasets  methods  
[9] base     

other attached packages:
 [1] scater_1.18.6               SingleCellExperiment_1.12.0
 [3] SummarizedExperiment_1.20.0 Biobase_2.50.0             
 [5] GenomicRanges_1.42.0        GenomeInfoDb_1.26.2        
 [7] IRanges_2.24.1              S4Vectors_0.28.1           
 [9] BiocGenerics_0.36.0         MatrixGenerics_1.2.1       
[11] matrixStats_0.58.0          muscat_1.4.0               
[13] ggplot2_3.3.3               cowplot_1.1.1              
[15] RColorBrewer_1.1-2          dplyr_1.0.4                
[17] patchwork_1.1.1             SeuratDisk_0.0.0.9018      
[19] SeuratObject_4.0.0          Seurat_4.0.0               

loaded via a namespace (and not attached):
  [1] utf8_1.1.4                reticulate_1.18           tidyselect_1.1.0         
  [4] lme4_1.1-27.1             RSQLite_2.2.3             AnnotationDbi_1.52.0     
  [7] htmlwidgets_1.5.3         grid_4.0.4                BiocParallel_1.24.1      
 [10] Rtsne_0.15                munsell_0.5.0             codetools_0.2-18         
 [13] ica_1.0-2                 future_1.21.0             miniUI_0.1.1.1           
 [16] withr_2.4.1               colorspace_2.0-0          rstudioapi_0.13          
 [19] ROCR_1.0-11               tensor_1.5                listenv_0.8.0            
 [22] labeling_0.4.2            GenomeInfoDbData_1.2.4    polyclip_1.10-0          
 [25] farver_2.0.3              bit64_4.0.5               glmmTMB_1.1.1            
 [28] parallelly_1.23.0         vctrs_0.3.6               generics_0.1.0           
 [31] doParallel_1.0.16         R6_2.5.0                  ggbeeswarm_0.6.0         
 [34] clue_0.3-58               rsvd_1.0.5                locfit_1.5-9.4           
 [37] hdf5r_1.3.3               bitops_1.0-6              spatstat.utils_2.1-0     
 [40] cachem_1.0.4              DelayedArray_0.16.2       assertthat_0.2.1         
 [43] promises_1.2.0.1          scales_1.1.1              beeswarm_0.2.3           
 [46] gtable_0.3.0              beachmat_2.6.4            Cairo_1.5-12.2           
 [49] globals_0.14.0            goftest_1.2-2             rlang_0.4.10             
 [52] genefilter_1.72.1         GlobalOptions_0.1.2       splines_4.0.4            
 [55] TMB_1.7.20                lazyeval_0.2.2            broom_0.7.7              
 [58] BiocManager_1.30.10       reshape2_1.4.4            abind_1.4-5              
 [61] backports_1.2.1           httpuv_1.5.5              tools_4.0.4              
 [64] gplots_3.1.1              ellipsis_0.3.1            ggridges_0.5.3           
 [67] Rcpp_1.0.6                plyr_1.8.6                sparseMatrixStats_1.2.1  
 [70] progress_1.2.2            zlibbioc_1.36.0           purrr_0.3.4              
 [73] RCurl_1.98-1.2            prettyunits_1.1.1         rpart_4.1-15             
 [76] deldir_0.2-10             viridis_0.5.1             pbapply_1.4-3            
 [79] GetoptLong_1.0.5          zoo_1.8-8                 ggrepel_0.9.1.9999       
 [82] cluster_2.1.1             colorRamps_2.3            variancePartition_1.20.0 
 [85] magrittr_2.0.1            data.table_1.14.0         scattermore_0.7          
 [88] lmerTest_3.1-3            circlize_0.4.12           lmtest_0.9-38            
 [91] RANN_2.6.1                fitdistrplus_1.1-3        hms_1.0.0                
 [94] mime_0.10                 xtable_1.8-4              pbkrtest_0.5.1           
 [97] XML_3.99-0.5              gridExtra_2.3             shape_1.4.5              
[100] compiler_4.0.4            tibble_3.1.0              KernSmooth_2.23-18       
[103] crayon_1.4.1              minqa_1.2.4               htmltools_0.5.1.1        
[106] mgcv_1.8-34               later_1.1.0.1             tidyr_1.1.2              
[109] geneplotter_1.68.0        DBI_1.1.1                 ComplexHeatmap_2.6.2     
[112] MASS_7.3-53.1             boot_1.3-27               Matrix_1.3-2             
[115] cli_2.3.1                 igraph_1.2.6              pkgconfig_2.0.3          
[118] numDeriv_2016.8-1.1       plotly_4.9.3              scuttle_1.0.4            
[121] foreach_1.5.1             annotate_1.68.0           vipor_0.4.5              
[124] blme_1.0-5                XVector_0.30.0            stringr_1.4.0            
[127] digest_0.6.27             sctransform_0.3.2         RcppAnnoy_0.0.18         
[130] spatstat.data_2.1-0       leiden_0.3.7              uwot_0.1.10              
[133] edgeR_3.32.1              DelayedMatrixStats_1.12.3 gtools_3.8.2             
[136] shiny_1.6.0               rjson_0.2.20              nloptr_1.2.2.2           
[139] lifecycle_1.0.0           nlme_3.1-152              jsonlite_1.7.2           
[142] BiocNeighbors_1.8.2       viridisLite_0.3.0         limma_3.46.0             
[145] fansi_0.4.2               pillar_1.5.0              lattice_0.20-41          
[148] fastmap_1.1.0             httr_1.4.2                survival_3.2-7           
[151] glue_1.4.2                remotes_2.2.0             spatstat_1.64-1          
[154] iterators_1.0.13          png_0.1-7                 bit_4.0.4                
[157] stringi_1.5.3             blob_1.2.1                DESeq2_1.30.1            
[160] BiocSingular_1.6.0        caTools_1.18.1            memoise_2.0.0            
[163] irlba_2.3.3               future.apply_1.7.0       

@bassanio
Copy link
Author

bassanio commented Aug 5, 2021

Hi,

Any update on this issue

@HelenaLC
Copy link
Owner

HelenaLC commented Aug 5, 2021

My apologies, this slipped under my radar, thanks for the reminder!

Have you attempted using another method in mmDS(), i.e., is this issue specific to "vst" or general?

In other news: The current Bioc release version of muscat is 1.6.0, using R v4.1. I highly recommend keeping up to date with the release cycles, as all of Bioc is under continuous development and issues might be resolved automatically in the process.

In fact, I believe this should be resolved according to the current code where

# variance-stabilizing transformation
if (args$method == "vst" && !"vstresiduals" %in% assayNames(x)) {
    vst_call <- switch(args$vst,
        sctransform = expression(.vst_sctransform(x, verbose)),
        DESeq2 = expression(.vst_DESeq2(x, covs, blind)))
    if (verbose) {
        assay(x, "vstresiduals", FALSE) <- eval(vst_call)
    } else {
        assay(x, "vstresiduals", FALSE) <- suppressMessages(eval(vst_call))
    }
}

The error you posted would indicate the assay assignment was done as assay(object, "name") <- matrix. But the current version uses assay(object, "name", withDimnames = FALSE) <- matrix, which should not give the above error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants