hi,
i want to retrieve some sequences from the nt database and corrently i am using this command.
blastdbcmd -db nt -entry_batch list_of_accesions.txt -range start-stop -out sequeces.fa
where listofaccesions.txt is a text file having one accession in one line. this way i can retrieve the fasta sequece of all the accessions ranging specified by the "start-stop".
but i want to specify a different range for all the accesssions. that means may be for accessions "a" i want to specify the range as (20-25) but for accesion b in the same .txt file the range can be (25-30).
plz let me know if there is any one liner code to do that.
1 answer
As far as I know the usage that you want is not directly supported by blastdbcmd
The -entry_batch flag is a replacement of the -entry flag and allows one to select the entries from a file. But it does not permit applying custom ranges.
What you could do is use another program to generate a shell script that lists the blast query command with your custom ranges, then execute that. Of course this will be orders of magnitude slower but depending on the usage case (how many such records you need) it may still be manageable. A quick test indicates that 1000 separate startups of blast require about 20 seconds.
Otherwise you will need to look for a different solutions see for example extract a group of fasta sequences from a file
Log in to answer this question.
plz improve the spelling in this question