# PCoA (emperor) on two groups only rather than all groups under one variable/category?

**URL:** https://forum.qiime2.org/t/pcoa-emperor-on-two-groups-only-rather-than-all-groups-under-one-variable-category/30534
**Category:** User Support
**Tags:** pcoa
**Created:** [June 18, 2024, 5:58pm UTC](https://forum.qiime2.org/t/pcoa-emperor-on-two-groups-only-rather-than-all-groups-under-one-variable-category/30534 "2024-06-18T17:58:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![MarwaTawfik](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/m/ee59a6/32.png) [@MarwaTawfik](https://forum.qiime2.org/u/MarwaTawfik)
#### Post date: [June 18, 2024, 5:58pm UTC](https://forum.qiime2.org/t/pcoa-emperor-on-two-groups-only-rather-than-all-groups-under-one-variable-category/30534/1 "2024-06-18T17:58:24Z")

</div>

Hi team

I was wondering if I could visualize (PCoA, emperor) only two groups of the same variable (rather than all groups)?  
I was advised by Rob Knight to try this for my data and see what I would get. I used nf-core/ampliseq already with its qiime2 workflow. Do I need to run the workflow on the two groups only? can't I click and select the each two groups together?  
here a screenshot

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/1/4/143cc41142ebf395eb238c1f43a71ec738f79f3c.png)  
[emperor.zip](https://forum.qiime2.org/uploads/short-url/gj1DmK0dRxfONuoJF83M1xxq7S3.zip) (9.7 KB)

Thanks very much  
Marwa

---

<div class="post-metadata">

### Author: ![timanix](https://forum.qiime2.org/user_avatar/forum.qiime2.org/timanix/32/17879_2.png) [@timanix](https://forum.qiime2.org/u/timanix)
#### Post date: [June 18, 2024, 7:16pm UTC](https://forum.qiime2.org/t/pcoa-emperor-on-two-groups-only-rather-than-all-groups-under-one-variable-category/30534/2 "2024-06-18T19:16:12Z")

</div>

Hello!  
The option to hide samples from the PCoA plot was mostly implemented for the convinience of data exploration and should not replace data filtering.  
Please check how to [filter](https://docs.qiime2.org/2024.5/plugins/available/diversity/filter-distance-matrix/) distance matrix based on the metadata.  
You can use filtered matrix to create new PCoA visualization since PCoA plot coordinates of each sample are recalculated after filtering.

Best,

---

<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: [July 20, 2024, 1:16am UTC](https://forum.qiime2.org/t/pcoa-emperor-on-two-groups-only-rather-than-all-groups-under-one-variable-category/30534/3 "2024-07-20T01:16:28Z")

</div>

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