How can I use formatted output file in the following code?
1
0
Entering edit mode
8.0 years ago
wowzero • 0

I'm a beginner in blast. I want to find the best BLAST hit. I add -outfmt 6 in my code like blastn -query $input -out out.txt -db db1 -outfmt 6. I can get out.txt, which is formatted in my directory. However, in the same script, when I try to loop the out.txt to find the best BLAST hit, I can only use out.txt that is not formatted. How can I use formatted output file in the following code?

blast • 1.4k views
ADD COMMENT
0
Entering edit mode

You only need to find the top hit from each search? Why not consider using a separate output file for each query so you won't overwrite the output file (e.g. -out $input\_out.txt. Otherwise it is not clear exactly what you are asking.

ADD REPLY
0
Entering edit mode
8.0 years ago

You need to define what "best blast hit" means for your use case.

Then look at the blast help to see all types of columns that you can output and select that one that captures what you call "best".

Then use the -outfmt 6 and add to the output your selected column of interest. Sort by it and you have what you wanted.

ADD COMMENT

Login before adding your answer.

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