Entering edit mode
8.1 years ago
ali.shojaee.bakhtiari
▴
20
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?
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.
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?
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 dogrep "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.
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 "