# heatmap reordering samples

**URL:** <https://forum.qiime2.org/t/heatmap-reordering-samples/23760>\
**Category:** User Support\
**Tags:** heatmap\
**Created:** [August 1, 2022, 2:51pm UTC](https://forum.qiime2.org/t/heatmap-reordering-samples/23760 "2022-08-01T14:51:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rnasrah](https://forum.qiime2.org/user_avatar/forum.qiime2.org/rnasrah/32/13101_2.png) [@rnasrah](https://forum.qiime2.org/u/rnasrah)\
**Post date:** [August 1, 2022, 2:51pm UTC](https://forum.qiime2.org/t/heatmap-reordering-samples/23760/1 "2022-08-01T14:51:05Z")

</div>

Hello,  
I have created a heatmap of my data where I have reordered my samples based on weight change (my two groups labelled AisGS vs BisLoss) using the following command:

qiime feature-table heatmap   
--i-table table.qza   
--m-sample-metadata-file metadata.tsv   
--m-sample-metadata-column wt\_category   
--p-cluster features   
--o-visualization heatmaptrial.qzv

However, I would like to now reorder the heatmap samples or 'rows' based on how similar they are to one another independent of weight change category - this way I can compare and see if the samples still separate in two groups (i.e.reordered based on weight change, ie. AisGS group on top and BisLoss group at bottom ). Not sure if I'm making sense but any ideas if this is doable?

Thank you!

using QIIME2-2022.2

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/4/4d882ccfbcbe615fa80ab6e27088b478911df27d.png)

---

<div class="post-metadata">

**Author:** ![colinbrislawn](https://forum.qiime2.org/user_avatar/forum.qiime2.org/colinbrislawn/32/6221_2.png) [@colinbrislawn](https://forum.qiime2.org/u/colinbrislawn)\
**Post date:** [August 1, 2022, 3:26pm UTC](https://forum.qiime2.org/t/heatmap-reordering-samples/23760/2 "2022-08-01T15:26:25Z")

</div>

This is possible!

From the [docs for feature-table heatmap](https://docs.qiime2.org/2022.2/plugins/available/feature-table/heatmap/),

> --m-sample-metadata-column COLUMN MetadataColumn[Categorical]  
> Annotate the sample IDs with these sample metadata  
> values. When metadata is present and  
> `cluster`='feature', samples will be sorted by the  
> metadata values. [optional]

> --p-cluster TEXT Choices('features', 'samples', 'both', 'none')  
> Specify which axes to cluster. [default: 'both']

Try changing those and see if you can get samples to cluster by similarity and not metadata.

---

<div class="post-metadata">

**Author:** ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)\
**Post date:** [September 1, 2022, 9:26pm UTC](https://forum.qiime2.org/t/heatmap-reordering-samples/23760/3 "2022-09-01T21:26:28Z")

</div>

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
