filtering with metada doesn't work

Hello qiime 2 users ,

i have difficulty to filter a table using --p-where option in feature-table filter-samples , in order to do diversity indice analysis with only samples that have a verified condition and no "NA"

im using qiime version 2022.02

here are the data 950.3 KB folder on MEGA

the samples in the table have the same name with the ones in the metadata file
i added a column "filter" with "Y" and "N" to try to filter the samples i want to remove

here are the commands i tried so far :

qiime feature-table filter-samples --i-table table.qza --m-metadata-file sample_metadata_capamax --p-where "filter='Y'" --o-filtered-table test_filtering.qza

qiime feature-table filter-samples --i-table table.qza --m-metadata-file sample_metadata_capamax --p-where "[Condition]='BR' AND [Condition]='Mant' AND [Condition]='MSC'" --o-filtered-table test_filtering.qza

The output table file is always empty and no error messages appear.

Hello and welcome to the forum!
The issue is that you are providing impossible conditions - "AND" in that case should be used for different columns.
If you want several levels from the same columns, use formula like this (from filtering tutorial):

  "[body-site] IN ('left palm', 'right palm')"

well im trying :
qiime feature-table filter-samples --i-table table.qza --m-metadata-file sample_metadata_capamax --p-where "[Condition] IN ('BR', 'Mant', 'MSC')" --o-filtered-table test_filtering.qza

and still output en empty table

Based on metadata you shared (thanks for providing it) looks like you should use "filter" column instead of "Condition".

ok, this is what i tried :

qiime feature-table filter-samples --i-table table.qza --m-metadata-file sample_metadata_capamax --p-where "[filter]='Y'" --o-filtered-table test_filtering.qza

im just doing as the documentation say but i can't understand why it's not working with my data

Hello!
Just noticed that your metadata file contains errors - there should be no "_" in the sample ID. So you will need to rename your samples first and check if it will fix the issue.
It is recommended to copy your table to google sheets, modify it as needed and check with keemei plugin.

Please, check tutorial about metadata.

thank you for the advices , i changed the "_" into "-" and validated the table with keemei on google sheets and its seems all correct. but the command still output empty filtered table :confused:

Did you rename samples in a feature table as well?
https://docs.qiime2.org/2022.2/plugins/available/feature-table/rename-ids/

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