2
$\begingroup$

I have a list of organisms with their full scientific names and Taxonomy IDs, total ~1500. I want to BLAST my protein against this 1500 genome or proteome. How can I do that?

Here a sample protein that I want to search the following database: http://togodb.org/db/thermobase Please note that database can be downloades as CSV file. I am very comfortable using web tools or programmatic tools such as Perl, Python, bash, or Entrez Programming Utilities.

>QCC44558.1 chitinase [Halobacterium salinarum] TaxID 641522631
MPHDRRSYLRTSSAVIASLLAASTPTSAADTPPEWDPDTVYTDGDKATFDGYVWEAKWWTKGDKPGADEW
GPWTQRRPVDGSPGGPTAAFTVTDTTVEPGTAVTVDASDTTGSVDSYEWAFGDGTTAAGVTASHTYDAAG
EYTIELTVTTGDGTTDTATQQITATTSPGDDEFKVVGYYPSWKGTDDYDFYPADVPFDQVTDVLYAFLDV
QPDGTVVLPDSDVDHESLLASFASLKQDRAADTRLKLSIGGWGLSPGFEDAAADQASRERFATTAVDLMR
TYDFDGIDVDWEHPGPRRGKCECGSAQGPANHVALLETVRDRLNDAEVEDGRTYDLSVANGGSDWNAALI
NHREVAAVVDDIYMMAYDFTGVWHGTAGLNAPIYGTPPDYPPSGDAQQYTLETTLTIWKEQGYWVDWMEW
EDHGDPVDDPGTLVLGMPFYGRGCNVENGIWDTFSLSEWQQGDPKYQNDVIPPGTWNDLRGPDDANTGAF
DYGDLAANYEGADAWTKQRNEQGGVPYLWNDSEGVFISYDDPTSIAAKVELAVAEDLGGVMIWELSQDYD
GTLLETINQHTP
$\endgroup$
2
  • 1
    $\begingroup$ @M__ Yes you are assessment is correct. I will consider breaking it down. I guess I have to build a local BLAST database first using TaxIDs. I will give try and maybe delete my question. $\endgroup$
    – Supertech
    Oct 13, 2023 at 15:36
  • 1
    $\begingroup$ I will propose a different solution over the weekend. It's a lot easier than performing a local blast. My strong advice is to take the easy route. Whilst @terdon and I have done this style of calculation - there's much easier ways. This is because for major repeat projects - this level of coding is worth while - for what appears a one-off blast its not worth it. Also interogating NCBI via its link system is never fun (it's not standardised, i.e. thier databases don't use universal foreign keys). Basically solutions around remote blast only - there's a lot of caveats here and I'll describe them $\endgroup$
    – M__
    Oct 13, 2023 at 15:56

2 Answers 2

1
$\begingroup$

My solution is simply.

  1. perform a web-based Blastp using the following parameters:
  • most dissimilar
  • 5000 hits (maximum limit)
  • Restrict to Archaea (which is what you samples appear to be)*

If you hit the limit of 5000 results, I would repeat the search for each class or phylum within Archaea. I can't remember if it was re-classified as a kingdom or was just another phylum. Concatenate all hits into a single fasta file.

  1. Reg-ex your extremophiles database (personally I'd use pandas), so that the species name of each bacterium is recovered no other information is present. Or this is an easily accessible value within a hash/database (this is a better solution).

  2. Use Biopython to loop through your blast fasta file and filter using re search against the species from your database. If you get a hit save that sequence.

Ideally, the point 2 and 3 would be a pandas merge operation, but looping is easier.

*, If there are extremophiles which are not Archaea (I don't know much about them), then take each general taxonomic group and repeat the operation for the search criteria "restrict the blastp to ... specific group".


Issues The issues with command line blastp, not via the web, is that access is greatly restricted during US working hours. If you are searching more than 100 hits and carrying out the search during the working day US time - they will not let it through. 100 hits or less is fine however. For >100 hits (e.g. 5000) it's got to be done well outside US working hours/ weekends. Web-based blastp doesn't carry this restriction of access during US working hours. Basically, the API route is deprioritised for the web-based approach. I assume this is to stop bots - albeit of course a bot can automate through NCBI's webpage.

Note The original solution by @terdon might easily work as a remote blastp because each query is restricted to <100 - so it will always get through during working hours. What I am saying is if you're using Blast API it needs a carefully defined strategy, else shift to the web for blanket approaches.

Entrez operations from a commandline do work ok during US working day time - albeit it's got to be coded to deal with "random" server refusals otherwise it will break the code (sporadic queries are refused). This is just my recent experience nothing more.

Just to be clear - this is potentially a medium sized project. Once the strategy has been decided then specific code that supports this approach can be given in separate questions.

$\endgroup$
4
  • 1
    $\begingroup$ I deleted my answer because I couldn't get the entrez query to work well. Too many of the species names were problematic. $\endgroup$
    – terdon
    Oct 14, 2023 at 11:35
  • 1
    $\begingroup$ @M__ your comment on the Issues is revelation to me as in the past I tried to BLAST >100 proteins at the same time. And sometime it worked other time it did not. Now it makes perfect sense. I have also submitted a ticket to BLAST team, if they offer another solution I will share. $\endgroup$
    – Supertech
    Oct 14, 2023 at 12:21
  • $\begingroup$ NCBI Entrez not working @terdon ... I've encountered bizarre non-universal foreign "link" key issues (I assume they're using SQL). In bacteria this is terrible: there were separate data and link structures present for one protein database and not the other, particularly how they linked to nucleotides ... it's disjointed. As a user I had to write two separate solutions in the code (I wouldn't mind but they never tell you either, got to figure it out). Whats happened is separate teams worked on "biologically the same" problem. The result is a committee meeting. $\endgroup$
    – M__
    Oct 14, 2023 at 13:40
  • $\begingroup$ @Supertech ticket to blast support I tried this too. I hope you get better success than I had. You said "[my] comments ... revelation", thanks, but upvotes and "accepts" are much more welcome than "revelations". $\endgroup$
    – M__
    Oct 14, 2023 at 13:45
1
$\begingroup$

In the interface of blastp, you can limit the search space to organisms you want to. Yo can do this by introducing name species or Tax IDs, you can add more than one, but I bet you don't wanna introduce the 1,500 one by one.

The only other way to do this, is by using blastp in its command-line version. You would need to build a custom database to be used as the searching space, and then run blast on your computer or server using this database. Bulding it is a pain in the ass, as far as I know. You need first to download all the proteins in all organisms in fasta format and then use this compilation as a database (makeblastdb command). I am not aware of a way to download all proteins from various organism given a list of taxonomic IDs, but if any, it has to be NCBI, Uniprot or similar. Then you can use blastp locally together with your custom database.

But why limiting the search space is such a way? You are biasing your results to what you want to get, instead of finding the stuff that actually is closest to your protein of interest. My suggestion is to use the online version of blastp with one of the various databases available and rather than pre-selecting organisms, you can exclude the ones from which you definitely don't want to get results from, and you can also exclude entire families/genera such as primates (taxid:9443), to name an example.

$\endgroup$
4
  • 1
    $\begingroup$ There are many valid reasons why you would want to limit the results. For instance, if you are looking for the protein's homologs in particular taxa, you don't care about what is closest. $\endgroup$
    – terdon
    Oct 13, 2023 at 16:04
  • $\begingroup$ If you have noticed, database I want to use contains only (hyper)thermophilic organisms. That is exactly what I want. $\endgroup$
    – Supertech
    Oct 14, 2023 at 0:11
  • 2
    $\begingroup$ There should be a way of downloading genomes based on the TaxIDs. I will send a ticket to the NCBI support team. In the past they have been very responsive. Maybe a feature they want to add if is not already possible. $\endgroup$
    – Supertech
    Oct 14, 2023 at 0:12
  • $\begingroup$ @terdon, True, there are such cases or others. I still would suggest to first try to play with the "add/remove organism" boxes in the interface and then parse the blast output in order to search for the organisms of interest. $\endgroup$
    – JRodrigoF
    Oct 14, 2023 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.