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

readAlexandrovSignatures takes forever #5

Closed
komalsrathi opened this issue Mar 19, 2025 · 6 comments
Closed

readAlexandrovSignatures takes forever #5

komalsrathi opened this issue Mar 19, 2025 · 6 comments

Comments

@komalsrathi
Copy link

Hi,

I am trying to run signatures <- decompTumor2Sig::readAlexandrovSignatures() but it seems to be taking forever. I never faced this issue before - have been using the function for quite a few years. Here is my R session:

R version 4.4.0 (2024-04-24)
Platform: aarch64-apple-darwin20
Running under: macOS 15.2

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.4-arm64/Resources/lib/libRlapack.dylib;  LAPACK version 3.12.0

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

time zone: America/New_York
tzcode source: internal

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

other attached packages:
[1] decompTumor2Sig_2.22.0 ggplot2_3.5.1         

loaded via a namespace (and not attached):
 [1] KEGGREST_1.44.0                         SummarizedExperiment_1.34.0            
 [3] gtable_0.3.5                            rjson_0.2.21                           
 [5] Biobase_2.64.0                          lattice_0.22-6                         
 [7] vctrs_0.6.5                             tools_4.4.0                            
 [9] bitops_1.0-7                            generics_0.1.3                         
[11] stats4_4.4.0                            curl_5.2.1                             
[13] parallel_4.4.0                          tibble_3.2.1                           
[15] fansi_1.0.6                             AnnotationDbi_1.65.2                   
[17] RSQLite_2.3.6                           blob_1.2.4                             
[19] pkgconfig_2.0.3                         Matrix_1.7-0                           
[21] data.table_1.15.4                       BSgenome_1.72.0                        
[23] S4Vectors_0.42.0                        readxl_1.4.3                           
[25] lifecycle_1.0.4                         GenomeInfoDbData_1.2.12                
[27] compiler_4.4.0                          Rsamtools_2.20.0                       
[29] Biostrings_2.72.0                       munsell_0.5.1                          
[31] codetools_0.2-20                        GenomeInfoDb_1.40.0                    
[33] RCurl_1.98-1.14                         yaml_2.3.8                             
[35] TxDb.Hsapiens.UCSC.hg19.knownGene_3.2.2 pillar_1.9.0                           
[37] crayon_1.5.2                            BiocParallel_1.38.0                    
[39] cachem_1.0.8                            DelayedArray_0.30.0                    
[41] abind_1.4-5                             tidyselect_1.2.1                       
[43] VariantAnnotation_1.50.0                dplyr_1.1.4                            
[45] restfulr_0.0.15                         fastmap_1.1.1                          
[47] rprojroot_2.0.4                         grid_4.4.0                             
[49] colorspace_2.1-2                        cli_3.6.2                              
[51] BSgenome.Hsapiens.UCSC.hg19_1.4.3       SparseArray_1.4.0                      
[53] magrittr_2.0.3                          S4Arrays_1.4.0                         
[55] GenomicFeatures_1.56.0                  XML_3.99-0.16.1                        
[57] utf8_1.2.4                              withr_3.0.2                            
[59] scales_1.3.0                            UCSC.utils_1.0.0                       
[61] bit64_4.0.5                             XVector_0.44.0                         
[63] httr_1.4.7                              matrixStats_1.3.0                      
[65] bit_4.0.5                               gridExtra_2.3                          
[67] cellranger_1.1.0                        png_0.1-8                              
[69] memoise_2.0.1                           GenomicRanges_1.55.4                   
[71] IRanges_2.38.0                          BiocIO_1.14.0                          
[73] rtracklayer_1.64.0                      rlang_1.1.4                            
[75] Rcpp_1.0.12                             glue_1.8.0                             
[77] DBI_1.2.2                               BiocGenerics_0.50.0                    
[79] rstudioapi_0.16.0                       jsonlite_1.8.8                         
[81] plyr_1.8.9                              R6_2.5.1                               
[83] ggseqlogo_0.2                           MatrixGenerics_1.16.0                  
[85] GenomicAlignments_1.40.0                zlibbioc_1.50.0                        

@komalsrathi
Copy link
Author

The issue is with this line that was introduced in the recent versions:

while(sum(sigVec) != 1) {  # once wasn't always sufficient!
                sigVec <- sigVec/sum(sigVec)
            }

The loop just keeps going on and on...

@rmpiro
Copy link
Owner

rmpiro commented Mar 22, 2025

Dear Komal,

that's strange. Could you let me have the signature data file that you're trying to load?
You can write to: [email protected]

This way I can try to replicate the problem.

Thanks!

@komalsrathi
Copy link
Author

Sure, thanks for replying. I'll send it shortly.

@komalsrathi
Copy link
Author

Actually, I am trying to load the default COSMIC signatures i.e. just running readAlexandrovSignatures without any input. I think the default is https://cancer.sanger.ac.uk/cancergenome/assets/signatures_probabilities.txt. The command below takes forever to run:

signatures <- decompTumor2Sig::readAlexandrovSignatures()

However, when I replace the while statement with just sigVec <- sigVec/sum(sigVec), it seems to work fine.

@rmpiro
Copy link
Owner

rmpiro commented Mar 24, 2025

Dear Komal,

That is very strange, the default works perfectly fine for me. If I remember well, the default does actually not require the normalization and it was a later version where the signature vectors didn't add up to precisely 1. But I'm not 100% sure here.

In any case: this default is the old version 2 of the COSMIC mutational signatures. It might anyway be better to use the newest version (SBS signatures v3.4) downloaded from the COSMIC website: https://cancer.sanger.ac.uk/signatures/downloads/

Can you please test whether these work for you? Thanks!

@komalsrathi
Copy link
Author

I just tested this but taking forever i.e. never finishes:

library(decompTumor2Sig)
signatures <- readAlexandrovSignatures(file = "~/Downloads/COSMIC_v3.4_SBS_GRCh38.txt")

It is indeed weird. I can't think of anything else but could be some issue with my package version or a dependency? In either case, if you are able to run it fine, then it is something on my end so I will close this. In the meanwhile, I will continue to use it by commenting out the while statement. Thanks for checking!

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