Change color of Diffbind's PCA and clustered heatmap plot()
3
0
Entering edit mode
melnuesch ▴ 10
@melnuesch-20883
Last seen 5.1 years ago

I changed the color palette from the dba.plotPCA very easily:

I defined

 mypalette=c()

(whatever colors I want) and then

 dba.plotPCA(results,DBA_CONDITION, label=DBA_ID,vColors=mypalette)

but I cannot seem to be able to do the same for the clustered heatmap (the one produced by plot(results) in DiffBind).

plot(results,vColors=mypalette)

or

plot(results,col=mypalette)

does not work. It says "error in plot.new() figure margins too large". I save it directly to a pdf file and does not complain, but when I open the picture has the default color palette all over again.

I also tried setting

palette(mypalette)

and then just running plot(results) but did not work, continued using the default one.

What can I do ? Because I want it to match the new colors I use in the PCA plot. Thank you for your time.

DiffBind plot color • 1.8k views
ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 8 weeks ago
Cambridge, UK

plot() calls dba.plotHeatmap(), see the help page. You need to set the colScheme parameter to change the heatmap colors (using a colorRampPalette from RColorBrewer)

ADD COMMENT
0
Entering edit mode
melnuesch ▴ 10
@melnuesch-20883
Last seen 5.1 years ago

But colScheme changes the color of the heatmap itself (the rectangles that in the default are green). I meant that I wanted to change the colors of the groups (Conditions) to match the color of the dots of the PCA plot. I want the heatmap to still be green but the condition groups to follow that other palette. I tried to change colScheme="Oranges", for example, but it did not do what I was looking for (just painted my heatmap rectangles orange). Do you have another solution? Thank you very much for your time.

ADD COMMENT
0
Entering edit mode
Rory Stark ★ 5.2k
@rory-stark-5741
Last seen 8 weeks ago
Cambridge, UK

There are two parameters to dba.plotHeatmap() that control the colors of the attributes color bars: colSideCols and rowSideCols, are these the ones you want?

ADD COMMENT

Login before adding your answer.

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