SomaticSignatures nmfSignatures error
2
1
Entering edit mode
@francesc-castro-6930
Last seen 3.0 years ago
Switzerland

Hi,

I'm trying to run nmfSignatures function and I've got the following error

> sigs_trio_nmf <- nmfSignatures(vr_mm_trio, n_sigs, nmfSignatures)
Error in 1:r : NA/NaN argument
Timing stopped at: 0.603 0.001 0.603

I suppose that this is caused because my matrix have some 0's. The example from the html tutorial works fine and the same matrix run fine in previous releases of SomaticSignatures. You can obtain the matrix from here

I'm using the package version 2.2.1 and R version 3.1.1.

> sessionInfo()
R version 3.1.1 (2014-07-10)
Platform: x86_64-apple-darwin13.1.0 (64-bit)

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

other attached packages:
 [1] TxDb.Hsapiens.UCSC.hg19.knownGene_3.0.0
 [2] GenomicFeatures_1.18.1                 
 [3] gplots_2.14.2                          
 [4] gtools_3.4.1                           
 [5] BSgenome.Hsapiens.UCSC.hg19_1.3.99     
 [6] BSgenome_1.34.0                        
 [7] rtracklayer_1.26.1                     
 [8] org.Hs.eg.db_3.0.0                     
 [9] RSQLite_1.0.0                          
[10] DBI_0.3.1                              
[11] AnnotationDbi_1.28.0                   
[12] SomaticCancerAlterations_1.1.1         
[13] stringr_0.6.2                          
[14] SomaticSignatures_2.2.1                
[15] Biobase_2.26.0                         
[16] VariantAnnotation_1.12.2               
[17] Rsamtools_1.18.1                       
[18] Biostrings_2.34.0                      
[19] XVector_0.6.0                          
[20] GenomicRanges_1.18.1                   
[21] GenomeInfoDb_1.2.0                     
[22] IRanges_2.0.0                          
[23] S4Vectors_0.4.0                        
[24] BiocGenerics_0.12.0                    
[25] reshape_0.8.5                          
[26] gridExtra_0.9.1                        
[27] scales_0.2.4                           
[28] xtable_1.7-4                           
[29] wesanderson_0.3                        
[30] RColorBrewer_1.0-5                     
[31] ggplot2_1.0.0                          

loaded via a namespace (and not attached):
 [1] acepack_1.3-3.3         base64enc_0.1-2         BatchJobs_1.4          
 [4] BBmisc_1.7              BiocParallel_1.0.0      biomaRt_2.22.0         
 [7] biovizBase_1.14.0       bitops_1.0-6            brew_1.0-6             
[10] caTools_1.17.1          checkmate_1.5.0         cluster_1.15.3         
[13] codetools_0.2-9         colorspace_1.2-4        dichromat_2.0-0        
[16] digest_0.6.4            doParallel_1.0.8        exomeCopy_1.12.0       
[19] fail_1.2                foreach_1.4.2           foreign_0.8-61         
[22] Formula_1.1-2           gdata_2.13.3            GenomicAlignments_1.2.0
[25] GGally_0.4.8            ggbio_1.14.0            graph_1.44.0           
[28] gridBase_0.4-7          gtable_0.1.2            Hmisc_3.14-5           
[31] iterators_1.0.7         KernSmooth_2.23-13      labeling_0.3           
[34] lattice_0.20-29         latticeExtra_0.6-26     MASS_7.3-35            
[37] munsell_0.4.2           NMF_0.20.5              nnet_7.3-8             
[40] OrganismDbi_1.8.0       pcaMethods_1.56.0       pkgmaker_0.22          
[43] plyr_1.8.1              proto_0.3-10            proxy_0.4-13           
[46] RBGL_1.42.0             Rcpp_0.11.3             RCurl_1.95-4.3         
[49] registry_0.2            reshape2_1.4            rngtools_1.2.4         
[52] rpart_4.1-8             sendmailR_1.2-1         splines_3.1.1          
[55] survival_2.37-7         tools_3.1.1             XML_3.98-1.1           
[58] zlibbioc_1.12.0        

somaticsignatures • 1.6k views
ADD COMMENT
0
Entering edit mode

I'll have a look at it.

ADD REPLY
0
Entering edit mode

Thanks for the reproducible example.

Can you send me the output of the motifMatrix function with normalize = FALSE?

ADD REPLY
0
Entering edit mode
Julian Gehring ★ 1.3k
@julian-gehring-5818
Last seen 5.0 years ago

The problem here is that you use the function <font face="monospace">nmfSignatures in two different contexts.  I guess that you have been using the SomaticSignatures versions 1.*.* already in the last release, and there was somehow a leftover from transitioning to the new synthax.  If you have a look at the vignette, your line better looks like this:</font>

sigs_trio_nmf <- identifySignatures(vr_mm_trio, n_sigs, decomposition = nmfSignatures)

To explain a bit: identifySignatures is the high-level function, nmfSignatures is the decomposition method that you want to apply (here, you can plug in the function that you like most). In your example, you used the decomposition function twice - which ended up apply the decomposition on itself.

I can see where the confusion comes from. I'll think of a good way to avoid this in future versions, and release a fix for until next week.

 

ADD COMMENT
0
Entering edit mode
@francesc-castro-6930
Last seen 3.0 years ago
Switzerland

You're right, problem solved. Sorry for the confusion with the previous version. You still want a have the motifMatrix with normalize = FALSE?

Thanks a lot

ADD COMMENT
0
Entering edit mode

I would like to get an idea of the number of mutations you are looking at. It is not related to your original question, but could help in your analysis.

ADD REPLY
0
Entering edit mode

I have really low numbers for some of the samples. Below the link to the rda file containing both matrices, normalized and not normalized (vr_mm_trio_f)

https://www.dropbox.com/s/n7fyyxljv2tbftq/motif_matrix.rda?dl=0

Thanks

ADD REPLY
0
Entering edit mode

The number of mutations per sample vary by more than two orders of magnitude, with down to 20 mutations in one sample. Just keep in mind that estimating signatures for these low-mutation samples are likely unreliable.  You may have to experiment with different settings for the decomposition, or consider excluding problematic samples.

ADD REPLY
0
Entering edit mode

I already expected that the estimated signatures for the low mutation samples would not be reliable, but do you think that the inclusion of these low-mutation samples would affect also to the definition of the different signatures?

 

ADD REPLY
0
Entering edit mode

The short answer is yes, it can affect them. Do you want to ask this as a separate question? I guess that it becomes way to interesting to bury this discussion in the comments. :) And others will profit from this.

ADD REPLY
0
Entering edit mode

Ok, I'll do it

ADD REPLY

Login before adding your answer.

Traffic: 986 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6