This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sorting BLAST file

Hi everyone,

I have some blast files which I want to filter. Because I am only interested in the blast results with an E-value of 0.0.

The results are in a .txt file and the E-value is located in column number 10. How can I filter the unwanted results away with bash?

Thank you in advance!

blast bash

If selecting for evalues below, let's say 0.001 and assuming your file is tab delimited,

awk -F '\t' '{if ($10 <= 0.001) print $0}' blast_file.txt > Filtered_blast_file.txt

I'm not sure it's working, because it's taking quite a while for just a test run(50 results)

My file looks like this:

lclav   scf7180005140699        99.970  60186   10      6       1       60181   66205   6023    0.0     1.110e+05

And that for all the blast results

1 answer

Ah, is your file space delimited? If so, try this

 awk -F ' ' '{if ($10 <= 0.001) print $0}' blast_file.txt > Filtered_blast_file.txt

Yes the file is space delimited, but its still not working... When using this command there is no error, but the new txt file empty, and I'm not sure why

Are you sure your e-value is in column 10?

Well stupid me... Cant count, it was column eleven. Thank you!

You can accept this answer (green checkmark) to provide closure to this thread.

Log in to answer this question.