plot Signatures error
1
0
Entering edit mode
Asma rabe ▴ 290
@asma-rabe-4697
Last seen 6.1 years ago
Japan

Hi,

I'm using plotSignatures to plot signatures as follows:

I have mutational signatures data in table format, i read the table in R to get object of mode list in the following format 

               T1     T2  T3   T4

C>A ACA     1      0    2    1

C>A ACC     1      2      2      1    

C>A ACG     1     0      0      0     

C>A ACT     5      0      0      0   

C>A CCA     10      0      1      1  

C>A CCC     2      1      1      0    

C>A CCG     2      1      4      0      

C>A CCT     1      1      1      1    

C>A GCA     1      0      1      1 

#=================

I used data.matrix to convert list to matrix as in case if not conversion i got tis error

Error in validObject(.Object) : 
  invalid class “MutationalSignatures” object: invalid object for slot "observed" in class "MutationalSignatures": got class "data.frame", should be or extend class "matrix"

#===========

n_sig=4

Sig = identifySignatures(data.matrix(Data), n_sigs, nmfDecomposition)

plotSignatures(Sig) + ggtitle("Somatic Signatures of Sig: NMF - Barchart")

The output  plot is just pain grid with no signature information

In addition, I got this warning message

Warning message:
In RColorBrewer::brewer.pal(n, pal) :
  n too large, allowed maximum for palette Set3 is 12
Returning the palette you asked for with that many colors

Any idea?

#==========

 sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-apple-darwin10.8.0 (64-bit)
Running under: OS X 10.8.5 (Mountain Lion)

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

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

other attached packages:
 [1] stringr_1.0.0            h5vc_2.2.0               ggplot2_1.0.1           
 [4] gridExtra_2.0.0          SomaticSignatures_2.4.5  Biobase_2.28.0          
 [7] VariantAnnotation_1.14.6 Rsamtools_1.20.4         Biostrings_2.36.1       
[10] XVector_0.8.0            GenomicRanges_1.20.5     GenomeInfoDb_1.4.1      
[13] IRanges_2.2.5            S4Vectors_0.6.2          BiocGenerics_0.14.0     

loaded via a namespace (and not attached):
 [1] splines_3.2.1           foreach_1.4.2           Formula_1.2-1          
 [4] latticeExtra_0.6-26     RBGL_1.44.0             BSgenome_1.36.3        
 [7] RSQLite_1.0.0           lattice_0.20-33         biovizBase_1.16.0      
[10] digest_0.6.8            RColorBrewer_1.1-2      checkmate_1.6.2        
[13] colorspace_1.2-6        ggbio_1.16.1            plyr_1.8.3             
[16] OrganismDbi_1.10.0      XML_3.98-1.3            biomaRt_2.24.0         
[19] zlibbioc_1.14.0         xtable_1.7-4            scales_0.2.5           
[22] brew_1.0-6              BiocParallel_1.2.11     proxy_0.4-15           
[25] pkgmaker_0.22           GenomicFeatures_1.20.1  nnet_7.3-10            
[28] proto_0.3-10            survival_2.38-3         magrittr_1.5           
[31] GGally_0.5.0            fail_1.2                doParallel_1.0.8       
[34] MASS_7.3-43             NMF_0.20.6              foreign_0.8-65         
[37] graph_1.46.0            tools_3.2.1             registry_0.3           
[40] BBmisc_1.9              gridBase_0.4-7          sendmailR_1.2-1        
[43] munsell_0.4.2           cluster_2.0.3           rngtools_1.2.4         
[46] AnnotationDbi_1.30.1    lambda.r_1.1.7          pcaMethods_1.58.0      
[49] rhdf5_2.12.0            futile.logger_1.4.1     RCurl_1.95-4.7         
[52] dichromat_2.0-0         iterators_1.0.7         labeling_0.3           
[55] h5vcData_1.102.0        base64enc_0.1-3         bitops_1.0-6           
[58] gtable_0.1.2            codetools_0.2-14        abind_1.4-3            
[61] DBI_0.3.1               reshape_0.8.5           reshape2_1.4.1         
[64] GenomicAlignments_1.4.1 rtracklayer_1.28.6      Hmisc_3.16-0           
[67] futile.options_1.0.0    stringi_0.5-5           BatchJobs_1.6          
[70] Rcpp_0.12.0             rpart_4.1-10            acepack_1.3-3.3 

#===========

Thank you

mutational signature • 1.8k views
ADD COMMENT
0
Entering edit mode

Can you please

  • describe where your Data object comes from and how it is structured (e.g. what are its dimensions), or give us somehow access to the data. Is there a specific reason why the data.matrix function is needed?
  • what the value of n_sigs is.
  • provide the output of sessionInfo.

Please also have a look at http://www.bioconductor.org/help/support/posting-guide/.

ADD REPLY
0
Entering edit mode

Thank you Julian for your response

I updated the post to answer your questions.

 

ADD REPLY
0
Entering edit mode

The data of the motif matrix doesn't look like it was generated with the package itself, and the formatting of the data seems not compatible with the conventions used within SomaticSignatures. How did you generate this data? Is the data that you show the entire data object or just the first 9 rows? What are the dimensions of the entire matrix? Please understand that if you want to inject your own data in the middle of the workflow, it is essential that the data formats are actually compatible.

ADD REPLY
0
Entering edit mode

True i created the data in a table format using a perl script not using package itself then i read the table in  R. I showed only 9 rows but the Data has 96 rows and 4 cancer types  

ADD REPLY
0
Entering edit mode

could you please provide an example on how to use Somatic mutations package when you have a matrix of counts of mutational motifs and an example on how to use Somatic signature s package when you have mutation in a table like this:

chromosome position  reference mutation

…. 

 

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

Regarding your original questions, your input table representing the motif counts per sample seems correctly formatted. You will need to adjust the representation of the motifs itself, to match the way they are expressed in the SomaticSignatures package internally. If you have a look at the example data of the package, e.g. with data(sca_mm, package = "SomaticSignatures"). The rownames of the matrix represent the somatic motifs, and will need to be reformatted from C>A ACA to CA A.A, C>G ACT to CG A.T, and so on. Please note that all this assumes that your perl script generating the input matrix works properly, which is something I can't comment on. You may further want to consider normalizing the counts by the total number of events observed in each sample, i.e. dividing by the column sums.

For your follow-up questions on how to start with a table of mutation events, please read through the vignette of package which covers this use case in detail.

ADD COMMENT
0
Entering edit mode

Hi Julian,

Thank you very much. but I still get the same error. I sent you the data via email.

I appreciate if you can figure out why i get this error.

ADD REPLY
1
Entering edit mode

Your row names of your input matrix are not correctly formatted, as explained in my answer. You should have a look at your perl script for generating the matrix, and make sure that the identifiers match.

ADD REPLY
0
Entering edit mode

Thanks Julian,it works now. I did not realize to change CA A.A before.

ADD REPLY
0
Entering edit mode

I did not receive an e-mail from you. Could you please check if you have the correct e-mail address and resend it?

ADD REPLY
0
Entering edit mode

Hi Julian,

I resend it. Did you receive it?

ADD REPLY

Login before adding your answer.

Traffic: 860 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