how to set BLAST to output hits as it goes through the fasta file?
0
0
Entering edit mode
8.1 years ago

I have a relatively large fasta file. I need to keep track of the number of sequences BLAST has been through. Is there a way that I can echo each BLAST hit one by one to the output file, or more simply, is there a flag that gives an output showing how many sequences have been analyzed already?

blast • 1.6k views
ADD COMMENT
0
Entering edit mode

You could periodically poll the output file that blast is generating to see how many query sequences it has gone through. Alternatively, you could run independent blast jobs for each of your queries and write the output to individual output files keeping track of how many are done. Latter may be better if you have access to a cluster and can start multiple jobs simultaneously.

ADD REPLY
0
Entering edit mode

Thanks for the reply. In case how can I pull out the file? The way I'm running the blast it generates 1 file in the end. I'm roughly doing the following

blastn ** -query x.fasta > output.txt

Do you know a flag that sequentially updates output.txt instead of in one chunk?

ADD REPLY
0
Entering edit mode

If the file being written/continually updated as your blast goes on? If you are writing your blast output in standard blast format then you could do something like grep -c "Query=" your_blast_file to get the count of query sequences already done. If you do grep "Query=" your_blast_file then you will see the headers of the query sequences done.

If you are using one of the tabular formats then we would need to change things. If so tell us what blast output format you are using.

ADD REPLY
0
Entering edit mode

Just a small and trivial addition. The watch command repeats a given command every 2 seconds and prints the output. watch "grep -c "Query=" result_file "

ADD REPLY

Login before adding your answer.

Traffic: 2665 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