# Ancom analysis- Error

**URL:** https://forum.qiime2.org/t/ancom-analysis-error/12198
**Category:** User Support
**Tags:** ancom
**Created:** [October 28, 2019, 8:20pm UTC](https://forum.qiime2.org/t/ancom-analysis-error/12198 "2019-10-28T20:20:47Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Kpatel](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/k/ecb155/32.png) [@Kpatel](https://forum.qiime2.org/u/Kpatel)
#### Post date: [October 28, 2019, 8:20pm UTC](https://forum.qiime2.org/t/ancom-analysis-error/12198/1 "2019-10-28T20:20:47Z")

</div>

Hi,  
I am running following command and i am meeting error,  
qiime feature-table filter-samples --i-table table.qza --m-metadata-file Meta.tsv --p-where "BodySite='gut'" --o-filtered-table gut-table.qza

If i run the command without --p-where i can get the results, I just wanted to ask here that my samples are taken from distal and proximal colon does it matter if i put --p-where parameter? Basically i am putting this parameter just to limit my analysis to single body-site.

Error:  
Traceback (most recent call last):  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/metadata/metadata.py", line 605, in get\_ids  
c.execute(query)  
sqlite3.OperationalError: no such column: BodySite

The above exception was the direct cause of the following exception:

Traceback (most recent call last):  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2cli/commands.py", line 327, in **call**  
results = action(\*\*arguments)  
File "\</home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/decorator.py:decorator-gen-323\>", line 2, in filter\_samples  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py", line 240, in bound\_callable  
output\_types, provenance)  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/sdk/action.py", line 383, in _callable\_executor_  
output\_views = self.\_callable(\*\*view\_args)  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2\_feature\_table/\_filter.py", line 73, in filter\_samples  
where=where, axis='sample', exclude\_ids=exclude\_ids)  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/q2\_feature\_table/\_filter.py", line 46, in \_filter\_table  
ids\_to\_keep = metadata.get\_ids(where=where)  
File "/home/Krunal/miniconda3/envs/qiime2-2019.7/lib/python3.6/site-packages/qiime2/metadata/metadata.py", line 614, in get\_ids  
"`where` statement." % query) from e  
ValueError: Selection of IDs failed with query:  
SELECT "sampleid" FROM metadata WHERE BodySite='gut' GROUP BY "sampleid" ORDER BY "sampleid";

If one of the metadata column names specified in the `where` statement is on this list of reserved keywords ([SQLite Keywords](http://www.sqlite.org/lang_keywords.html)), please ensure it is quoted appropriately in the `where` statement.

Plugin error from feature-table:

Selection of IDs failed with query:  
SELECT "sampleid" FROM metadata WHERE BodySite='gut' GROUP BY "sampleid" ORDER BY "sampleid";

If one of the metadata column names specified in the `where` statement is on this list of reserved keywords ([SQLite Keywords](http://www.sqlite.org/lang_keywords.html)), please ensure it is quoted appropriately in the `where` statement.

Also further i am going to run qiime taxa collapse and qiime composition add-pseudocount, what will be the effects if i dont add the --p-where.

Best  
Krunal

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [October 28, 2019, 10:32pm UTC](https://forum.qiime2.org/t/ancom-analysis-error/12198/2 "2019-10-28T22:32:46Z")

</div>

Hi @Kpatel,

Just to get the full context, are you following the moving pictures tutorial, but working with your own data?

If that's the case and you don't have a column called `BodySite` containing data labeled `gut`, the --p-where flag isn't going to work for you on your own data. (If you get to needing to filter your own data, the data filtering tutorial linked with the command is excellent.)

In the moving pictures tutorial, the moviation for filtering si that we know that bodysite has a _huge_ effect on the microbiome and the difference between skin, oral, and fecal is huge. By filtering in that example you (a) get an example of filtering data and (b) get to focus on a single bodysite.

That leads then to your second question: should _you_ filter. And, my recommendation here is to look in PCoA space and/or use hypothesis testing to see if there's a big difference based on the sampling site. It won't be as big as the body site effect you saw in moving pictures, but it's good to check. (Or check the literature and see what others have found!)

Best,  
Justine

---

<div class="post-metadata">

### Author: ![Kpatel](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/k/ecb155/32.png) [@Kpatel](https://forum.qiime2.org/u/Kpatel)
#### Post date: [October 29, 2019, 2:47pm UTC](https://forum.qiime2.org/t/ancom-analysis-error/12198/3 "2019-10-29T14:47:02Z")

</div>

Hi @jwdebelius,

You are right i was following tutorial with my data and my body site in metadata was distal and proximal colon which is basically gut not written in that form, so i changed metadata and i was able to proceed for differential abundance analysis.

That was a silly mistake indeed. Thank you so much for your help

---

<div class="post-metadata">

### Author: ![jwdebelius](https://forum.qiime2.org/user_avatar/forum.qiime2.org/jwdebelius/32/9655_2.png) [@jwdebelius](https://forum.qiime2.org/u/jwdebelius)
#### Post date: [October 29, 2019, 8:38pm UTC](https://forum.qiime2.org/t/ancom-analysis-error/12198/4 "2019-10-29T20:38:42Z")

</div>

A post was split to a new topic: [Resources for Learning Move about Diversity](https://forum.qiime2.org/t/resources-for-learning-move-about-diversity/12221)

---

<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: [November 30, 2019, 2:46am UTC](https://forum.qiime2.org/t/ancom-analysis-error/12198/5 "2019-11-30T02:46:45Z")

</div>

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