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?
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.