Sorting BLAST file
1
0
Entering edit mode
4.4 years ago
stan.aanhane ▴ 30

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 • 1.1k views
ADD COMMENT
0
Entering edit mode

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
ADD REPLY
0
Entering edit mode

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

ADD REPLY
2
Entering edit mode
4.4 years ago
Gio12 ▴ 220

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
ADD COMMENT
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
0
Entering edit mode

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

ADD REPLY
1
Entering edit mode

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

ADD REPLY

Login before adding your answer.

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