# ANCOM Analysis with Filtered FeatureTable

**URL:** https://forum.qiime2.org/t/ancom-analysis-with-filtered-featuretable/29115
**Category:** User Support
**Tags:** ancom, feature-table
**Created:** [February 1, 2024, 3:38am UTC](https://forum.qiime2.org/t/ancom-analysis-with-filtered-featuretable/29115 "2024-02-01T03:38:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![neocat](https://forum.qiime2.org/user_avatar/forum.qiime2.org/neocat/32/15910_2.png) [@neocat](https://forum.qiime2.org/u/neocat)
#### Post date: [February 1, 2024, 3:38am UTC](https://forum.qiime2.org/t/ancom-analysis-with-filtered-featuretable/29115/1 "2024-02-01T03:38:43Z")

</div>

I have a file `genus-table.qza` which is of type FeatureTable[Frequency]. I want to investigate differentially abundant OTUs using ANCOM. So first I convert to a frequency and add a pseudo count of 1:

```auto
qiime composition add-pseudocount
  --i-table taxonomy/genus-table.qza
  --o-composition-table comp-gut-table-level6.qza

```

I can now check for differentially abundant OTUs like this, for example I can compare male vs female study participants:

```auto
qiime composition ancom \
  --i-table comp-gut-table-level6.qza \
  --m-metadata-file manifest.tsv \
  --m-metadata-column sex \
  --o-visualization ancom-subject-level6.qzv

```

Now I want to compare users vs non-users only among female study participants. So first I subset by sex:

```auto
qiime feature-table filter-samples \
  --i-table comp-gut-table-level6.qza \
  --m-metadata-file manifest.tsv \
  --p-where "sex='F'" \
  --o-filtered-table fltrd_composition_genus_table_female.qza

```

But now I have a problem. `fltrd_composition_genus_table_female.qza` contains only the female study participants as desired, but the manifest.tsv with the metadata does not reflect this!

- Am I supposed to manually filter the manifest.tsv?
- Or does qiime2 understand how to match manifest.tsv onto the filtered `fltrd_composition_genus_table_female.qza`?

---

<div class="post-metadata">

### Author: ![cherman2](https://forum.qiime2.org/user_avatar/forum.qiime2.org/cherman2/32/17129_2.png) [@cherman2](https://forum.qiime2.org/u/cherman2)
#### Post date: [February 1, 2024, 4:40pm UTC](https://forum.qiime2.org/t/ancom-analysis-with-filtered-featuretable/29115/2 "2024-02-01T16:40:42Z")

</div>

Hi @neocat,  
qiime2 understands how to match your metadata to the filtered table. You should be good to run ancom!

Hope that helps!

---

<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: [March 3, 2024, 10:41pm UTC](https://forum.qiime2.org/t/ancom-analysis-with-filtered-featuretable/29115/3 "2024-03-03T22:41:23Z")

</div>

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