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
Can you please
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 thedata.matrix
function is needed?n_sigs
is.sessionInfo
.Please also have a look at http://www.bioconductor.org/help/support/posting-guide/.
Thank you Julian for your response
I updated the post to answer your questions.
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.
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
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
….