R / cummeRbund : difficulty changing x-axis labels in gg / ggplot class while generating heatmap
0
0
Entering edit mode
7.7 years ago

I am trying to generate the heat map plots from the cummeRbund package (see p22). It generates the plot. However initially, the values in h$data$variable were [q1,q2,q3,q4,...,q18] (which were set by a previous program in a particular data file located in ../cuffdiff). Below, I changed the values of h$data$variable to something more meaningful to me, however when I plot, the x-axis still has q1,q2,etc for the x-axis labels.

library("cummeRbund")
cuffset<-readCufflinks(dir = "../cuffdiff", gtfFile="../cuffmerge/merged.gtf", genome="GRCh38")
cuffdat<-genes(cuffset)
myGeneIds<-rownames(countMatrix(cuffdat))
myGenes<-getGenes(cuffset,myGeneIds)
h<-csHeatmap(myGenes,cluster='both')
h$data$variable[h$data$variable == "q1"]<-"tissue-1"
h$data$variable[h$data$variable == "q2"]<-"tissue-2"
h$data$variable[h$data$variable == "q3"]<-"tissue-3"
h$data$variable[h$data$variable == "q4"]<-"tissue-4"
>
> class(h)
[1] "gg"     "ggplot"
> h

How do I change the labels to something more meaningful (e.g. tissue-1, tissue-2, etc.)?

R cummeRbund • 1.8k views
ADD COMMENT

Login before adding your answer.

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