This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Pathogen protein sequence alignment

How do I filter by taxonomy (i.e. taxid = 2 for Bacteria) using NcbiblastpCommandline in Biopython? Is there a way to do it without downloading and filtering the nr dataset manually? Are there available and downloadable protein dataset that only involves bacteria and viruses? Thanks!

nr ncbi biopython protein

Hey GenoMax, thanks for the reply. My plan is to restrict my blastp sequence alignment in bacteria database only. I have already worked with the NcbiblastpCommandline(...) in Biopython (for the first time) but the problem with using this API is that it includes all proteins from nr database. Is their a parameter for restricting the search for bacterias only e.g. taxids = 2 or something.

I've thought of doing what u suggested i.e. downloading nr database and creating a fasta file for just bacteria. But my concern is it's a 45GB file that I may not have the resource to download everything in my local computer. So I'm thinking that maybe the NcbiblastpCommandline(...) can do the work for me. Do you have any suggestion or a workaround for this? Thank you!

Latest version of blast+ allows you to limit searching to specific taxID's easily. Unfortunately you can't limit the search at the level of taxID 2. You will need to get a list of taxID's at genus/species level for this to work. You also can't use this limit if you are using -remote to do the search at NCBI. So your only option may be to include taxID's of hits in your results and filter them afterwards.

I see. This makes sense to me. Thanks a lot! :D

0 answers

No answers yet.

Log in to answer this question.