Hi Julian,
I want to change the order of triplets in the Motif x-axis of plotMutationSpectrum so that Gs at the 3' are clumped together next to each other. In other words, say for C>T, I want to change the order from:
A . A A . C A . G A . T C . A C . C C . G C . T G . A G . C G . G G . T T . A T . C T . G T . T
to:
A . A C . A G . A T . A A . C C . C G . C T . C A . G C . G G . G T . G A . T C . T G . T T . T
I have read ?plotMutationSpectrum however there does not seem to be an option to do this.
What's the easiest way to change plotMutationSpectrum in order to achieve this?
Sergio
Code:
plotMutationSpectrum(motifs, group="comparison", normalize = FALSE)
> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-unknown-linux-gnu (64-bit)
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
attached base packages:
[1] stats4 parallel stats graphics grDevices utils datasets
[8] methods base
other attached packages:
[1] SomaticSignatures_2.6.0 gplots_2.17.0
[3] VariantAnnotation_1.16.3 Rsamtools_1.22.0
[5] Biostrings_2.38.0 XVector_0.10.0
[7] SummarizedExperiment_1.0.0 Biobase_2.30.0
[9] GenomicRanges_1.22.0 GenomeInfoDb_1.6.1
[11] IRanges_2.4.1 S4Vectors_0.8.0
[13] BiocGenerics_0.16.0
loaded via a namespace (and not attached):
[1] splines_3.2.1 foreach_1.4.3 gtools_3.5.0
[4] Formula_1.2-1 latticeExtra_0.6-26 RBGL_1.46.0
[7] BSgenome_1.38.0 RSQLite_1.0.0 lattice_0.20-33
[10] biovizBase_1.18.0 digest_0.6.8 RColorBrewer_1.1-2
[13] colorspace_1.2-6 ggbio_1.18.0 plyr_1.8.3
[16] OrganismDbi_1.12.0 XML_3.98-1.3 biomaRt_2.26.0
[19] zlibbioc_1.16.0 xtable_1.8-0 scales_0.3.0
[22] gdata_2.17.0 BiocParallel_1.4.0 proxy_0.4-15
[25] pkgmaker_0.22 ggplot2_1.0.1 GenomicFeatures_1.22.3
[28] nnet_7.3-11 proto_0.3-10 survival_2.38-3
[31] magrittr_1.5 GGally_0.5.0 doParallel_1.0.10
[34] MASS_7.3-44 NMF_0.20.6 foreign_0.8-66
[37] graph_1.48.0 BiocInstaller_1.20.0 tools_3.2.1
[40] registry_0.3 gridBase_0.4-7 stringr_1.0.0
[43] munsell_0.4.2 cluster_2.0.3 rngtools_1.2.4
[46] AnnotationDbi_1.32.0 lambda.r_1.1.7 pcaMethods_1.60.0
[49] caTools_1.17.1 futile.logger_1.4.1 grid_3.2.1
[52] RCurl_1.95-4.7 dichromat_2.0-0 iterators_1.0.8
[55] bitops_1.0-6 gtable_0.1.2 codetools_0.2-14
[58] DBI_0.3.1 reshape_0.8.5 reshape2_1.4.1
[61] GenomicAlignments_1.6.1 gridExtra_2.0.0 rtracklayer_1.30.1
[64] Hmisc_3.17-0 futile.options_1.0.0 KernSmooth_2.23-15
[67] stringi_1.0-1 Rcpp_0.12.1 rpart_4.1-10
[70] acepack_1.3-3.3
Hi Sergio, I just saw your post so sorry about the late reply. The ordering of the x-axis is determined implicitly by the graphics library ggplot2. I haven't thought about an option for changing the order, but it makes sense to have this freedom. Let me check what the easiest way would be, I'll get back to you soon.