Question: Heatmap column side bar error
gravatar for emblake
3.5 years ago by
United States
emblake50 wrote:

I have created a heatmap with a column side bar showing the associated donor ID with respect to the sample number. The column color bar doesn't match with the donor ID legend or the sample number, and I can't figure out what I'm doing wrong. Would someone please inspect my code? Thanks very much.

> y$sample$donor
 [1] "Donor1" "Donor1" "Donor1" "Donor1" "Donor1" "Donor2" "Donor2" "Donor2" "Donor2"
[10] "Donor2" "Donor3" "Donor3" "Donor3" "Donor3" "Donor3" "Donor4" "Donor4" "Donor4"
[19] "Donor4" "Donor4" "Donor5" "Donor5" "Donor5" "Donor5" "Donor5" "Donor6" "Donor6"
[28] "Donor6" "Donor6" "Donor6"
    col.colors <- sample(c(rep("cyan",5),
>    heatmap.2(logCPM, col=col.pan, ColSideColors = col.colors, trace = "none",
              dendrogram = "column", cexRow = 1, cexCol = 1, margin = c(8,6), 
              lhei = c(2,10), lwid = c(2,6))
>    legend("left",legend=c("Donor1","Donor2","Donor3","Donor4","Donor5","Donor6"),
           fill=col.colors, border=FALSE, bty="n", y.intersp = .9, cex=.9)
heatmap rna-seq • 1.4k views
ADD COMMENTlink modified 3.5 years ago • written 3.5 years ago by emblake50

Although this is a question that should be fairly addressed in stackoverflow. But here are my 2 cents below.

Do not restrict yourself to only one package. Have you seen pheatmap(). It is pretty straigthforward to use annotation with them. Just create a dataframe with samples in rows and columns with the donor ID and parse them while using the pheatmap function in R. It should work.

ADD REPLYlink written 3.5 years ago by ivivek_ngs4.9k

Thanks - I will check out the documentation for pheatmap.

Wasn't sure if Biostars was the appropriate forum, but thought feedback would be worthwhile since my issue is related to analysis of RNA-seq data.

ADD REPLYlink written 3.5 years ago by emblake50

Question cross posted on stack overflow:

ADD REPLYlink modified 3.5 years ago • written 3.5 years ago by emblake50
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1768 users visited in the last hour