# Ancom differential analysis

**URL:** <https://forum.qiime2.org/t/ancom-differential-analysis/8486>\
**Category:** User Support\
**Created:** [February 22, 2019, 7:23pm UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486 "2019-02-22T19:23:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yogesh\_Gupta](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yogesh_gupta/32/9097_2.png) [@Yogesh\_Gupta](https://forum.qiime2.org/u/Yogesh_Gupta)\
**Post date:** [February 22, 2019, 7:23pm UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486/1 "2019-02-22T19:23:51Z")

</div>

I do have 5 columns in metadata file: SampleID, Tissue (soil, root, shoot), Treatment (T1, T2, T3), Village and Region for all sample.

there are 3 tissue: soil, root and leaf.

I wanted to see differential abundance in all soil sample. I think I am making error in giving --P-where parameter, could you please suggest How should I correct it.

I used below command to filter and further process:

[qiime2\_16s\_analysis]$ qiime feature-table filter-samples --i-table table.qza --m-metadata-file metadata3.tsv --p-where "Tissue='Soil'" --o-filtered-table Soil-table.qza

Saved FeatureTable[Frequency] to: Soil-table.qza

qiime2\_16s\_analysis]$ qiime composition add-pseudocount --i-table Soil-table.qza --o-composition-table com-Soil-table.qza  
Saved FeatureTable[Composition] to: com-Soil-table.qza

[qiime2\_16s\_analysis]$ qiime composition ancom --i-table com-Soil-table.qza --m-metadata-file metadata3.tsv --m-metadata-column Tissue --o-visualization ancom-Soil.qzv  
Plugin error from composition:

All values the `grouping` are the same. This method cannot operate on a grouping vector with only a single group of samples(e.g., there are no 'between' variance because there is only a single group).

Debug info has been saved to /tmp/qiime2-q2cli-err-hvbdjtm7.log

Thanks

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [February 22, 2019, 10:58pm UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486/2 "2019-02-22T22:58:23Z")

</div>

> [@Yogesh\_Gupta](#):
>
> All values the `grouping` are the same. This method cannot operate on a grouping vector with only a single group of samples(e.g., there are no ‘between’ variance because there is only a single group).

This error means you don't have multiple values in the `Tissue` column. This makes sense, since in an earlier step, you filtered your table to only include `Tissue='Soil'` samples. How can you compare tissue types when you only have one type? Options include filtering your table on some other column, or computing ancom on another column.

---

<div class="post-metadata">

**Author:** ![Yogesh\_Gupta](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yogesh_gupta/32/9097_2.png) [@Yogesh\_Gupta](https://forum.qiime2.org/u/Yogesh_Gupta)\
**Post date:** [February 22, 2019, 11:11pm UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486/3 "2019-02-22T23:11:32Z")

</div>

Hi @thermokarst,

I have given three different treatment to soil sample, so I wanted to see how T1, T2 and T3 treatment affect the microbial diversity in soil. Like this I want to repeat for root and leaf.

should I use OR to add it like this:

"Tissue='Soil' OR Treatment='Yes'"

Thanks

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [February 22, 2019, 11:16pm UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486/4 "2019-02-22T23:16:45Z")

</div>

> [@Yogesh\_Gupta](#):
>
> should I use OR to add it like this:

No.

If you want to see how the treatment impacted differential abundance across the samples in the filtered table, specify the _Treatment_ column when running ancom, not the _Tissue_ column.

So:

```bash
qiime composition ancom \
  --i-table com-Soil-table.qza \
  --m-metadata-file metadata3.tsv \
  --m-metadata-column Treatment \
  --o-visualization ancom-Soil.qzv

```

---

<div class="post-metadata">

**Author:** ![Yogesh\_Gupta](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yogesh_gupta/32/9097_2.png) [@Yogesh\_Gupta](https://forum.qiime2.org/u/Yogesh_Gupta)\
**Post date:** [February 22, 2019, 11:56pm UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486/5 "2019-02-22T23:56:39Z")

</div>

Thank you very much @thermokarst.  
Now I understand it.

---

<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 26, 2019, 5:56am UTC](https://forum.qiime2.org/t/ancom-differential-analysis/8486/6 "2019-03-26T05:56:40Z")

</div>

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