[BioC] heatmap.2 and makeContrasts
Wolfgang Huber
whuber at embl.de
Fri Mar 4 19:20:43 CET 2011
Dear Supriya
I assume you are refering to the heatmap.2 function in the gplots
package. Have a look at its man page and in particular its argument 'Colv'.
Best wishes
Wolfgang
Il Mar/2/11 4:44 PM, Supriya Munshaw ha scritto:
> Hi all, I had 2 questions for you reg. using R and Bioconductor.
>
> Question 1: I'm using heatmap.2 to make a heatmap for my top
> differentially expressed genes. I also create a dendogram for my
> columns that clusters by sample. However, is there a way to modify
> these dendograms? For example, if you look at the color coding in the
> attached heatmap, I have clustered by 2 regions. But if you look
> closely, there is no reason that the dendogram can't be flipped so
> that the green sections align i.e. the first blue section from the
> left can be flipped with the second green section from the left which
> would keep the same information but provide a better visual
> representation of the clustering. Does anyone know how I can do
> this?
>
> Question 2:
>
> My phenotype data file looks like this
>
> Patient
>
> Disease State
>
> Tissue
>
> A
>
> D
>
> T1
>
> A
>
> D
>
> T2
>
> B
>
> D
>
> T1
>
> B
>
> D
>
> T2
>
> C
>
> N
>
> T1
>
> C
>
> N
>
> T2
>
> D
>
> N
>
> T1
>
> D
>
> N
>
> T2
>
>
> So the first comparison I want to make is between disease and non
> disease in all tissues. I can do that in 2 ways:
>
> Option 1: desMat<- model.matrix(~0+ DiseaseState) colnames(desMat)<-
> levels(DiseaseState) contMat<- makeContrasts(D-N, levels=
> colnames(desMat)) # I'm assuming this groups all disease states in
> one group and all non disease states in another, without regard to
> patient, treating each sample independently, which is fine.
>
> Option 2: Combine<-factor(paste(DiseaseState,Tissue,sep=".") #So
> now my states are D.T1, D.T2, N.T1, N.T2 desMat<- model.matrix(~0+
> Combine) colnames(desMat)<- levels(Combine) contMat<-
> makeContrasts(((D.T1+D.T2)/2)- ((N.T1+N.T2)/2), levels=
> colnames(desMat))
>
> Shouldn't option 1 and 2 give me the same answer? In my case, it does
> not and I'm not sure I understand why.
>
> I would really appreciate any help. Thank you!
>
>
>
> _______________________________________________ Bioconductor mailing
> list Bioconductor at r-project.org
> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the
> archives:
> http://news.gmane.org/gmane.science.biology.informatics.conductor
--
Wolfgang Huber
EMBL
http://www.embl.de/research/units/genome_biology/huber
More information about the Bioconductor
mailing list