Skip to content

Filtering Long Amplicons

Remove contaminating amplicons

  • After checking the sequences file, we see that there are some amplicons in our dataset that are too long to be 16S v4 region, so we consider them contaminates (or off target amplcons) that need to be removed.
  • This happens from some unintended affinity for our primers for the 18S rRNA gene of eukaryotes... we originally thought these would come up as Unclassified and out be filtered out by using --p-include c__, but.... they are classifies as bacteria in GG2 (not sure why yet). regardless, thats not good! they need to go...

Here is an example of how you would remove these long amplicons

cd /scratch/alpine/$USER/YOUR_WORKING_DIR/dada2

#filter out long amplicons from rep seqs file
qiime feature-table filter-seqs \
--i-data seqs.qza \
--m-metadata-file seqs.qza \
--p-where 'length(sequence) < 260' \
--o-filtered-data seqs_filtered.qza

qiime feature-table tabulate-seqs \
--i-data seqs_filtered.qza \
--o-visualization seqs_filtered.qzv

#filter our long amplicons from feature table
qiime feature-table filter-features \
--i-table table.qza \
--m-metadata-file table_filtered260.qza \
--o-filtered-table table_filtered260.qza

qiime feature-table summarize \
--i-table table_filtered260.qza \
--m-sample-metadata-file ../metadata/metadata.txt \
--o-visualization table_filtered260.qzv