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

Error when running runDWLSDeconv #786

Open
martina-morchio opened this issue Oct 30, 2023 · 2 comments
Open

Error when running runDWLSDeconv #786

martina-morchio opened this issue Oct 30, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@martina-morchio
Copy link

Hi! I am using Giotto to analyse the transcriptome detected with Visium on 6 tissue sections, aiming to perform cell-type deconvolution with a single nuclei RNA seq dataset from two similar samples.

DWLS deconvolution works well when I'm analysing one tissue section individually, however to analyse all sections in parallel I joined the Giotto objects and performed Harmony integration.
All looks great until I run runDWLSDeconv, which starts for a while and then prints out the following message:

testcombo = runDWLSDeconv(gobject = testcombo,
                          sign_matrix = DWLS_matrix, cluster_column = "leiden_harmony")
Original error message: 

matrix D in quadratic function is not positive definite!
 Will try to fix error with Matrix::nearPD()
Error in Matrix::nearPD(D) : Matrix seems negative semi-definite
In addition: Warning message:
In asMethod(object) :
  sparse->dense coercion: allocating vector of size 1.3 GiB

I'm using the same DWLS matrix that worked for the individual sample.
Do you know what the issue might be? I have seen this error popping up in other issues (#121, #170, #228) but couldn't find a solution there.

Here's my session info:

> sessionInfo()
R version 4.3.1 (2023-06-16)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

Matrix products: default
BLAS/LAPACK: /mnt/parscratch/users/mdq19mm/miniconda3/envs/giotto/lib/libopenblasp-r0.3.24.so;  LAPACK version 3.11.0

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       

time zone: Europe/London
tzcode source: system (glibc)

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

other attached packages:
 [1] harmony_1.1.0               Rcpp_1.0.11                
 [3] scran_1.30.0                scuttle_1.12.0             
 [5] SingleCellExperiment_1.24.0 SummarizedExperiment_1.32.0
 [7] Biobase_2.62.0              GenomicRanges_1.54.0       
 [9] GenomeInfoDb_1.38.0         IRanges_2.36.0             
[11] S4Vectors_0.40.0            BiocGenerics_0.48.0        
[13] MatrixGenerics_1.14.0       matrixStats_1.0.0          
[15] ggplot2_3.4.4               Giotto_3.3.1               

loaded via a namespace (and not attached):
 [1] bitops_1.0-7              rlang_1.1.1              
 [3] magrittr_2.0.3            RcppAnnoy_0.0.21         
 [5] compiler_4.3.1            DelayedMatrixStats_1.24.0
 [7] png_0.1-8                 systemfonts_1.0.5        
 [9] vctrs_0.6.4               reshape2_1.4.4           
[11] RcppZiggurat_0.1.6        quadprog_1.5-8           
[13] stringr_1.5.0             pkgconfig_2.0.3          
[15] crayon_1.5.2              magick_2.8.1             
[17] XVector_0.42.0            labeling_0.4.3           
[19] utf8_1.2.4                ragg_1.2.6               
[21] purrr_1.0.2               Rfast_2.0.8              
[23] bluster_1.12.0            zlibbioc_1.48.0          
[25] beachmat_2.18.0           jsonlite_1.8.7           
[27] DelayedArray_0.28.0       tweenr_2.0.2             
[29] BiocParallel_1.36.0       terra_1.7-55             
[31] irlba_2.3.5.1             parallel_4.3.1           
[33] cluster_2.1.4             R6_2.5.1                 
[35] stringi_1.7.12            RColorBrewer_1.1-3       
[37] limma_3.58.0              reticulate_1.34.0        
[39] R.utils_2.12.2            FNN_1.1.3.2              
[41] Matrix_1.6-1.1            igraph_1.5.1             
[43] tidyselect_1.2.0          abind_1.4-5              
[45] codetools_0.2-19          lattice_0.22-5           
[47] tibble_3.2.1              plyr_1.8.9               
[49] withr_2.5.1               polyclip_1.10-6          
[51] scatterpie_0.2.1          pillar_1.9.0             
[53] ggfun_0.1.3               generics_0.1.3           
[55] dbscan_1.1-11             RCurl_1.98-1.12          
[57] sparseMatrixStats_1.14.0  munsell_0.5.0            
[59] scales_1.2.1              RhpcBLASctl_0.23-42      
[61] glue_1.6.2                metapod_1.10.0           
[63] tools_4.3.1               BiocNeighbors_1.20.0     
[65] data.table_1.14.8         ScaledMatrix_1.10.0      
[67] locfit_1.5-9.8            cowplot_1.1.1            
[69] grid_4.3.1                tidyr_1.3.0              
[71] edgeR_4.0.0               colorspace_2.1-0         
[73] GenomeInfoDbData_1.2.11   ggforce_0.4.1            
[75] BiocSingular_1.18.0       cli_3.6.1                
[77] rsvd_1.0.5                textshaping_0.3.7        
[79] fansi_1.0.5               S4Arrays_1.2.0           
[81] dplyr_1.1.3               uwot_0.1.16              
[83] gtable_0.3.4              R.methodsS3_1.8.2        
[85] digest_0.6.33             progressr_0.14.0         
[87] SparseArray_1.2.0         ggrepel_0.9.4            
[89] dqrng_0.3.1               farver_2.1.1             
[91] R.oo_1.25.0               lifecycle_1.0.3          
[93] statmod_1.5.0             MASS_7.3-60 
``` 
@martina-morchio
Copy link
Author

As an update, I have run runDWLSDeconv() on all the individual samples that make up my larger dataset. It ran fine on most samples, but in 5 of them (out of 20) I encountered the same error message printed above.
I then merged and integrated the sections that ran successfully repeated runDWLSDeconv on this larger dataset, but again I encountered the matrix D error message, even though the deconvolution on those individual datasets worked fine when run individually.

@RubD
Copy link
Collaborator

RubD commented Nov 10, 2023

@gcyuan could we take another look at this? I believe we have tried to catch errors, but not sure if this is a new one?

@RubD RubD added the bug Something isn't working label Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants