Ok I see. Bad for me then :-) .. Thank you very for the response.
Hello.
I want to blast multiples files, each one contains a different number of sequences against the nr database (online version). I didn't find any way to upload those files all at once, but only one per time. So I guess that there is no way to do it. Instead, I found an alternative through the command line using the option -remote in a loop. .
I am wondering if there is any way to boost up this command, for instance, by increasing the num of threads or something similar to what we can do when we use the blast locally?
Thank you in advance
2 answers
In a word, no. With the -remote option you are using public NCBI resources. It would not be right if people got to choose the number of threads, because it would be abused.
You could do e.g. this to run 4 parallel remote blasts:
#!/bin/bash
function rBlast() {
blastn -query "$1" ..... -remote
}
export -f rBlast
find /your/dir -type f -name "*.fna" | parallel -j 4 rBlast {}
However, this is probably considered abuse by the NCBI and will likely lead to them banning your IP address..
I am not sure about your decision-making process or your motivation to write this. Maybe it will sound dramatic, but it feels like leaving a recipe for making a bomb and saying that it shouldn't be used because bomb-making is frowned upon. We are discussing a USA government web server here.
From the blast manual:
The BLAST+ remote service uses a shared resource (the computers at the NCBI), so only one BLAST+ application should run remote searches at a time.
So yeah, while the script could initially speed up remote blast, the outcome would be that your IP would be banned sooner than later. However, if you set -j 1 then it's sequential. There's still the benefit that each query will start automatically just as soon as the last one finishes
Thank you very much for "the hack." I didn't test it yet, but I am so excited to do so. But before that, could you please be as kind as to give me some specifications? a) If I want to save the output as txt, how can I edit the code that you posted? b) What is the max number of the cores that I can use in the parallel command?
I didn't test it yet
Then leave it at that. As you see above, both @5heikki and @Mensur have said that your computer will get banned from accessing NCBI servers.
Log in to answer this question.