DESeq heatmap based on threshold
2
0
Entering edit mode
John ▴ 30
@john-9676
Last seen 6.5 years ago

Hi,

 

I am trying to plot heatmap on my counts from HTSeq. Here is my codes (partial).

dds<-DESeq(ddsHTSeq)
res<-results(dds)
res<-res[order(res$padj),]

rld <- rlogTransformation(dds, blind=TRUE)
vd <- varianceStabilizingTransformation(dds, blind=TRUE)

library("genefilter")
topVarGenes <- head(order(rowVars(assay(vd)),decreasing=TRUE),200)
mat <- assay(rld)[ topVarGenes, ]
mat <- mat - rowMeans(mat)
df <- as.data.frame(colData(rld)[,c("cond1","cond2, "cond3")])

pheatmap(mat, annotation_col=df, show_rownames=FALSE)

This is my summary of the results

 

out of 42075 with nonzero total read count
adjusted p-value < 0.1
LFC > 0 (up)     : 4674, 11%
LFC < 0 (down)   : 5123, 12%
outliers [1]     : 0, 0%
low counts [2]   : 11998, 29%
(mean count < 5.6)
 

This pheatmap results only for top 200 genes. My question is,

1) is it possible to heatmap based on threshold like above some p-value or fold change?

2) is it possible to use different colours for different conditions?

3) how can I force pheatmap to do the heatmap based on foldchange or adjusted p-value?

 

Thanks

J.

deseq2 • 5.2k views
ADD COMMENT
1
Entering edit mode
@mikelove
Last seen 13 hours ago
United States

hi John

1) Yes, you would just change topVarGenes to a vector defined by res$padj or res$log2FoldChange. You can define this matrix you provide to pheatmap however you like.

2) Yes, please take a look at the pheatmap documentation for further details.

3) I guess, the point of the heatmap is to visualize the actual counts (normalized and transformed) across samples. There are other, perhaps better ways of visualizing fold changes and p-values (e.g. MA plots for fold changes, and histograms or "volcano" plots for p-values).

ADD COMMENT
0
Entering edit mode
John ▴ 30
@john-9676
Last seen 6.5 years ago

Hi Michael,

Thank you for the help.

>2) Yes, please take a look at the pheatmap documentation for further details.

I looked into that and the only colour change I could do was the following.

ann_colors=list(Condition=c(control="blue", health="yellow"))

pheatmap(mat, annotation_col=df,  cluster_rows=TRUE, cluster_cols=FALSE, legend=FALSE, show_rownames=FALSE, show_colnames=TRUE, annotation_colors = ann_colors)

 

This changes the label colours but not the actual heatmap pattern. I wanted each condition to have different colouring pattern on the heatmap. Do you think that is possible.

 

Thank you again

J.

 

ADD COMMENT
0
Entering edit mode
See ?pheatmap second argument is 'color'
ADD REPLY

Login before adding your answer.

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