Filtering sequences from a specific sample


I have my 16S diversity taxa-bar-plots.qzv and sequences from the dada table. I have some broad taxonomic categories that I am interested on looking into detail per sample.

I was wondering if there is an option to filter the sequences so I only extract the sequences of one sample, instead of filtering per taxonomic rank?
something like qiime filter-table sample 1? SO I would only get the sequences from the sample1 and I could check the diversity form that sample? I think it was something similar on qiime1.

Thanks in advance,



The way I have fixed this as follows. is this the shortest/most efficient way of doing this?

  1. Creating a tsp fils only containing the sample1 ID

echo SampleID > sample1.tsv
echo sample1 >>sample1.tsv

  1. Filtering the dada table with the metadata tsk file containing the desired sample ID

qiime feature-table filter-samples
–i-table table-dada2.qza
–m-metadata-file sample1.tsv
–o-filtered-table table-sample1.qza

  1. Filter the new table with the taxonomy I desire:

qiime taxa filter-table
–i-table table-station1.qza
–i-taxonomy taxonomy.qza
–p-include cyanobacteria
–o-filtered-table table-filtered-onlycyano-sample1.qza

  1. Filter the sequences from the rep-see with the filtered table

qiime feature-table filter-seqs
–i-data rep-seqs-dada2.qza
–i-table table-filtered-onlycyano-sample1.qza
–o-filtered-data rep-seqs-cyano-s1.qza

  1. make it ready for visualisation

qiime feature-table tabulate-seqs
–i-data rep-seqs-cyano-s1.qza

1 Like

Hi @ecg,
That works, and thank you for posting your solution!

Note that filter-samples and filter-seqs also have the option to filter based on metadata, so you could also filter your feature table and sequences using a unique metadata category, like the barcode ID. This is not necessarily any better than what you did, just clarifying that there are multiple routes to the same outcome.

1 Like

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