Filtering all Metazoa and bacteria out of my sample

Here is my code:

qiime taxa filter-seqs \
    --i-sequences rep-seqs.qza \
    --i-taxonomy taxonomy.qza \
    --p-exclude d__Bacteria, p__Arthropoda, p__Annelida, p__Thermoplasmatota, p__Incertae_Sedis, Unassigned, p__Rotifera, p__Tunicata, p__Platyhelminthes, p__Mollusca, p__Nematozoa, p__Holozoa, p__Florideophycidae, p__Porifera, p__Xenacoelomorpha, p__Nemertea, p__Gastrotricha, p__Bryozoa, p__Vertebrata, p__uncultured, p__Phragmoplastophyta, p__Cnidaria \
    --o-filtered-sequences filtered_taxonomy.qza

I want to filter out all of my eDNA assigned taxonomy so i just have microeukaryotes. I’m using the 18S region. I’ve tried using –p-exclude with quotation around the individual phyla, and having them each on a separate line. Nothing seems to work

Hello @zu_mu,

This is a classic command-line syntax issue.

Try this command:

qiime taxa filter-seqs \
  --i-sequences rep-seqs.qza \
  --i-taxonomy taxonomy.qza \
  --p-exclude "d__Bacteria,p__Arthropoda,p__Annelida,p__Thermoplasmatota,p__Incertae_Sedis,Unassigned,p__Rotifera,p__Tunicata,p__Platyhelminthes,p__Mollusca,p__Nematozoa,p__Holozoa,p__Florideophycidae,p__Porifera,p__Xenacoelomorpha,p__Nemertea,p__Gastrotricha,p__Bryozoa,p__Vertebrata,p__uncultured,p__Phragmoplastophyta,p__Cnidaria" \
  --o-filtered-sequences filtered-rep-seqs.qza

Note how I wrapped everything in " quotes " and removed the spaces.

Also, I noticed your output file is named filtered_taxonomy.qza, but the filter-seqs command outputs filtered sequences, so I've changed its name.


Bonus!

When I do this, I often also check what I just filtered out. Like this:
qiime taxa filter-seqs \
  --i-sequences rep-seqs.qza \
  --i-taxonomy taxonomy.qza \
  --p-include "d__Bacteria,p__Arthropoda,p__Annelida,p__Thermoplasmatota,p__Incertae_Sedis,Unassigned,p__Rotifera,p__Tunicata,p__Platyhelminthes,p__Mollusca,p__Nematozoa,p__Holozoa,p__Florideophycidae,p__Porifera,p__Xenacoelomorpha,p__Nemertea,p__Gastrotricha,p__Bryozoa,p__Vertebrata,p__uncultured,p__Phragmoplastophyta,p__Cnidaria" \
  --o-filtered-sequences removed-rep-seqs.qza

Code on GitHub: q2-forums/33735 at main · colinbrislawn/q2-forums · GitHub

3 Likes