Good morning to everyone,
I'm trying to generate heatmap to show the results of DE genes found at the end of my analysis (performed with the workflows RNASeqGeneEdgeRQL and rnaseqgene which rely on edgeR quasi-likelihood and DESEQ2 respectively).
In the first case, I'm using the function coolmap, in the second pheatmap, the results look like this:
The heatmap apparently includes ALL transcripts I'm working on, not just the DE (on which I applied a threshold of logFC > 1.5) comparing a single condition.
Maybe I'm missing something.
Is it possible to generate a heatmap including only the restricted list of genes obtained after performing logFC filering? Would it make sense at all or it wouldn't be possible to make comparisons and clusterize genes like in a heatmap? Thanks in advance.
This is not quite an issue with any Bioconductor package and is more a matter of general coding in R. You simply need to subset your input data matrix to have only those genes that you want to include for the purpose of clustering and heatmap generation. This can be done directly or indirectly in many different ways, for example, via subset(), match(), which(), and others. There are undoubtedly many tutorials and code snippets online about this.
Keep in mind that clustering using the entire unfiltered dataset is generally referred to as 'unsupervised clustering'. On the other hand, when you 'supervise' the clustering by selecting only those genes that are, for example, statistically significantly differentially expressed, it is referred to as 'supervised clustering'.
The RNASeqGeneEdgeRQL workflow shows you how to make the heatmap only of DE genes.
Note that coolmap simply plots a matrix of expression values. If you give it 50 rows/genes of data, then it will plot 50 genes. If you give it data for 300 genes, it will plot 300 genes. You have to choose the genes yourself -- the function has no way of sensing which of your genes are significantly DE. If the plot shows different genes to what you expected, then you have input the wrong data to it, i.e., you've made a programming error.