[R] (no subject)
Sandeep Reddy Marla
sandeepmarla at gmail.com
Thu Dec 1 16:00:45 CET 2016
Hello,
I'm trying to generate heat map for differential expression data. I ranked
each data row and used that for heat map visualization (included an example
data set with script). When difference between numbers within each row is
small, still heat map is not representing correctly as it is ranking that
was used for heat map. Therefore, I tried using scale='row', but the heat
map is not looking as good as ranked data heat map.
In scale = row argument, I want the highest value and lowest values color
to be colors that I have provided and the intermediate values (example:
values of 0,1,500,700 - 0 with royalblue3, 700 with yellow, and 1 and 500
adjusted as per the scale) be colored according to their value. Are there
any arguments to fix this problem in R heatmap.2, your help will be greatly
appreciated.
#creating a sample data set
Bo <- c(0,32,200,1500)
No <- c(5,100, 250, 70)
Bc <- c(700,523,80,3000)
Nc <- c(1,0, 300, 30)
GeneID <- c("G1", "G2","G3","G4")
DEG <- data.frame(GeneID, Bo,No,Bc,Nc)
DEG_data <- DEG[ -(1)]
DEG_data <- as.matrix(DEG_data)
class(DEG_data) <- 'numeric'
ranked_DEG_data <- t(apply(DEG_data, 1, rank))
#generating a heat map using ranked values for each row
#rank 1 is royalblue3 and rank4 is yellow
heatmap.2(ranked_DEG_data, cellnote=DEG_data, notecex=0.7,
notecol="black",cexRow =0.6,cexCol =1.5, srtCol=360,
trace="none", dendrogram ='none', Rowv=F, Colv=F, keysize=1,
scale="row",
,adjCol=c(0.5,0.25),
col=colorpanel(100, low="royalblue3", high="yellow"))
#generating a heat map using real values
#rank 1 is royalblue3 and rank4 is yellow in the above heat map but scaling
is not providing similar map for high and low values
heatmap.2(DEG_data, cellnote=DEG_data, notecex=0.7,
notecol="black",cexRow =0.6,cexCol =1.5, srtCol=360,
trace="none", dendrogram ='none', Rowv=F, Colv=F, keysize=1,
scale="row",
,adjCol=c(0.5,0.25),
col=colorpanel(100, low="royalblue3", high="yellow"))
Thanks
[[alternative HTML version deleted]]
More information about the R-help
mailing list