[BioC] heatmap.2 and makeContrasts

Supriya Munshaw smunsha1 at jhmi.edu
Wed Mar 2 16:44:46 CET 2011


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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: heatmap.png
Type: image/png
Size: 46718 bytes
Desc: heatmap.png
URL: <https://stat.ethz.ch/pipermail/bioconductor/attachments/20110302/f27a8517/attachment.png>


More information about the Bioconductor mailing list