Excluding an organism in biopython BLAST
0
0
Entering edit mode
22 months ago
o.delaney • 0

I have just started using BLAST in biopython, and can do basic searches. I know how to limit my search to particular taxa with eg entrez_query = "txid9606[ORGN]" but I also want to be able to exclude some taxa. How can I do this?

biopython blast • 1.3k views
ADD COMMENT
1
Entering edit mode

Not 100% sure on this by any means but I think with entrez the usual booleans are supported so you could try = "... NOT txid1234[ORGN]" but I don't think this is possible with commandline blast. You'd probably have to filter those sequences out when you build the database, or after you run the BLAST.

Others may well know better though.

ADD REPLY
0
Entering edit mode

OK thanks that seems to have worked

ADD REPLY
1
Entering edit mode

entrez_query = "txid9606[ORGN]"

That query needs to be

entrez_query = "9606[TtaxID]" OR entrez_query = "human[ORGN]"

Entrez search limiting can only be done with remote blast searches at NCBI.

On other hand, if I recall right, taxID based inclusion/exclusion can only be done with local blast. I will confirm that later today.

ADD REPLY
0
Entering edit mode

OK thanks, I have seen [orgn], [ORGN] and [organism] in different places, do these all do the same thing? What is the different between entrez limiting and taxID inclusion/exclusion - I thought these were the same thing?

ADD REPLY
0
Entering edit mode

The search term categories should be equivalent.

TaxID exclusion can only be done with local blast searches. You can precisely include/exclude organisms/classes if you know the taxID. Here are the relevant options from blast help. Searching with taxID's is just one option for Entrez queries.

 -taxids <String>
   Restrict search of database to include only the specified taxonomy IDs
   (multiple IDs delimited by ',')
    * Incompatible with:  gilist, seqidlist, taxidlist, negative_gilist,
   negative_seqidlist, negative_taxids, negative_taxidlist, remote, subject,
   subject_loc
 -negative_taxids <String>
   Restrict search of database to everything except the specified taxonomy IDs
   (multiple IDs delimited by ',')
    * Incompatible with:  gilist, seqidlist, taxids, taxidlist,
   negative_gilist, negative_seqidlist, negative_taxidlist, remote, subject,
   subject_loc
ADD REPLY

Login before adding your answer.

Traffic: 2594 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6