specify the color in plotMutationSpectrum() of SomaticSignatures library
1
0
Entering edit mode
sun ▴ 100
@sun-5534
Last seen 8.1 years ago
United States

Hi All,

How can I specify the color that I would like to use in plotMutationSpectrum()?

eg.

plotMutationSpectrum(sca_motifs, "study", normalize = TRUE), I would like to only use "red" color here, 

or plotMutationSpectrum(sca_motifs, "study",colorby = c("alteration"), normalize = TRUE), if I would like to multiple colors. 

how should I do?

 

Thanks,

Rebecca

SomaticSignatures • 1.1k views
ADD COMMENT
0
Entering edit mode
Julian Gehring ★ 1.3k
@julian-gehring-5818
Last seen 4.9 years ago

For the first case with only one color for all studies/samples, use the following:

p = plotMutationSpectrum(sca_motifs, "study", normalize = TRUE)
p = p + scale_fill_manual(values = rep("darkred", nlevels(p$data$sample))) ## uses "darkred" as color
p

For your second case, can you specific what you mean with "multiple colors"? The plot already uses different colors to distinguish the mutational motifs.

ADD COMMENT

Login before adding your answer.

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