Group/filter sequences by metadata


I tried to look for an answer for this question but found nothing similar-
I want to filter my rep-seqs.qza (after it was clustered and filtered along the table.qza) to 2 groups, based on the samples (in my example, I have 2 treatments (lettuce/tomato), with 3 samples each). How can I create 2 .qza files- one with the lettuce seqs and the other with the tomato seqs, that I can later convert to .fasta files and use for downstream applications?

Thank you,

1 Like

Good morning Barak,

I think the qiime feature-table filter-seqs will work great. You can run this command twice, once for lettuce and once for tomatoes, and change the --p-where flag. Like this:

qiime feature-table filter-seqs \
  --i-data rep-seqs.qza \
  --m-metadata-file sample-metadata.tsv \
  --p-where "treatment='tomato'" \
  --o-filtered-data rep-seqs-tomato.qza

Let me know if that works,

Hi @barakdror,

Colin’s metadata isn’t Feature Metadata, so this won’t work here. What I suggest is to

This should drop features not found in those samples:

then, use that table to filter their seqs using the optional –i-table input.

1 Like

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