This is a test version of Biostars. For the public version, visit https://www.biostars.org.
How to fix column order with pheatmap?

Dear all, I want to generate a pheatmap with rlog values from DEseq, and I want to put the samples with higher expression value to the right side, and the samples with lower expression values to the left side. Therefore I can compare the results from different experiments. Do you have any suggestions how to make that happen?

pheatmap column order

Sort the columns based on expression and use cluster_cols=FALSE.

Hi, arup, thanks a lot.

1 answer

as mentioned in this post, How to regroup columns in R using heatmap.2 or pheatmap ?, reorder the matrix as per your requirement and then as arup said below, do not cluster the cols. @ Alicia

Thank you very much. I missed the post you mentioned when I searched it. The method is quite strightforward.

np. upvote the original post if it is helpful. Alicia

Log in to answer this question.