Remove.lineage() to filter unclassified OTUs at specific taxonomic levels

I’m sure I’m missing something obvious here, but I have not found an answer that works for my specific situation. I am wanting to remove OTUs that are unclassified at anything above a family level.

I have used this code, but I am not sure how to get the filter down to a finer resolution without knowing specifically which phyla, orders, or families to put into the code:

remove.lineage(fasta=seqs.good.unique.pick.txt, count=seqs.good.pick.count_table,, taxon=Fungi_unclassified-unclassified_Fungi)

Again, I’m probably just being dense about this, but I would love to figure this out.


Hi there,

Unfortunately, there isn’t an easy way to do what you’re asking purely in mothur. Here’s what I would do…

If you’re using Mac/Linux, you can run this command to get the listing of sequences that have a taxonomy that includes “unclassified”…

$ grep "unclassified" | cut -f 1 > unclassified.accnos

This creates a file called unclassified.accnos that has the listing of sequences that are unclassified. You can then use this within the remove.seqs command from within mothur along with your current fasta, count_table, and taxonomy files (i.e. the ones parallel to used in the example above)

mothur > remove.seqs(fasta=stability.trim.contigs.good.unique.good.filter.unique.precluster.pick.fasta, count=stability.trim.contigs.good.unique.good.filter.unique.precluster.count_table,, accnos=unclassified.accnos)


1 Like

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