If I have a metagenomic dataset that contains reads from both eukaryotes and prokaryotes and then I annotate by running DIAMOND or HMMER against a bacterial database how much of a risk do I run of eukaryotic reads being annotated in the process?
I was hoping to use the eggNOG mapper to search against the bacterial and archaeal databases and to exclude the eukaryotic portion of my dataset. Is the eukaryotic filtering something that I would need to do in a step prior to this?
If you know the eukaryotic contaminant present you could use
bbsplit.sh from BBMap suite to split/bin reads first using a reference for that contaminant (into one or as many bins as reference sequences you provide).
You can use centrifuge with the NT library to profile the taxonomy, and then remove the reads from eukaryotes.
Depending on the length of your reads, the level of error in the reads, the quality of the database, and the specificity settings you give DIAMOND, you can change the level of "bleed" that you get - but you'll always have a couple reads, especially at metagenome dataset sizes, that will be annotated incorrectly.
But you'll always have this happen, whenever you annotate any large dataset. The best way to handle it is to set a threshold after annotation that removes wrongly annotated reads (looking for 'clearly wrong' organisms in your annotated dataset can help you figure out where to set the threshold level - there's probably no Bos taurus reads in a mouse metagenome).
You can do things like enable the sensitive flag on the DIAMOND annotation search to help improve annotation accuracy.