This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Generating heatmaps of pre-selected candidate genes after deseq2

Hi biostars, Is it possible to make a heatmap for a preselected list of genes after deseq2 DGE analysis? I wanted to represent the log2FC of 20 differentially expressed candidate genes as a heatmap.

rna-seq deseq2 heatmap

Hi, did you solve this? I want to do a similar thing with a number of candidate genes but using rlog data to include in a pheatmap

2 answers

Hi,

it is absolutely possible. Have a look at this tutorial. You could slice the matrix of normalized counts to contain only interesting genes:

pheatmap(assay(ntd)[intersting_genes,], cluster_rows=FALSE, show_rownames=FALSE,
     cluster_cols=FALSE, annotation_col=df)

How do you "slice the matrix of normalized counts to contain only interesting genes", considering a list/data frame named "GENES_TO_LABEL" (containing the names of the genes you wish to label) which you've imported from a txt file?

Hi, did you solve this? I want to do a similar thing with a number of candidate genes but using rlog data to include in a pheatmap

Hi! I'm trying to do the same thing that you did but I keep getting this error: invalid subscript type 'list'. Did you solve this??

You can use as follows: use a vector that contains list of genes you wish.

genes <- c("gene_1", "gene_2", ...)
mat <- assay(rld)[genes, ]
mat <- mat - rowMeans(mat)
anno <- as.data.frame(colData(rld)[c("Condition")])
pheatmap(mat, annotation_col = anno)

Log in to answer this question.