reorder group column in pheatmap
I'm trying to order the group of my heatmap with wildtype (WT) on the left and disease (SCA7) on the right. However, my heatmap always put SCA7 on the left and WT on the right even after setting cluster_cols to FALSE.
pheatmap(zscore, cluster_rows = FALSE, show_rownames = TRUE,
show_colnames = FALSE, cluster_cols = FALSE, annotation_col = df,
color = colorRampPalette(c("green","black", "red"))(100))
The df that annotation_col corresponds to looks like this, so the order is WT at first.
GenotypeS15_merged WT
S14_merged WT
S13_merged WT
S11_merged WT
S12_merged WT
S20_merged SCA7
S19_merged SCA7
S18_merged SCA7
S16_merged SCA7
S17_merged SCA7
• 2,635 views
•
link
1 answer
pheatmap will plot your data in the order of colnames(zscore) if you set cluster_cols = F. You need to make sure that the col order of your zscore is WT to SCA7
• 0 views
•
link
Log in to answer this question.
Post example data and image to understand the issue better.