I’m building a heatmap of gene LFC, and I want to include the genes’ descriptions as row labels. As of now, I have the numerical gene ID’s as row labels, since these are the rownames in the dataframe I’m using to build the heatmap (as in pheatmap(df)
).
I have tried including row_labels = df2$description
in two different ways – where the rownames of df2 are the gene ID’s and where the gene ID’s are represented as another column in df2. I have tried both formats where the gene descriptions are the only other column in the table. None are correctly labeling the rows with the respective gene description. See pictured: in the heatmap with gene descriptions, the descriptions don’t correspond with the correct row (i.e. gene ID’s and gene descriptions don’t match). I also can’t find a pattern to the gene descriptions it’s labeling.
Is there another way to do this that I’m missing in the pheatmap package or a different format df2 should be in, or will I have to build the heatmap in a different package?
heatmap with correct geneID’s
same heatmap with incorrectly corresponding gene descriptions
Emma Scales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.