View Single Post
Old 09-08-2012, 04:05 AM   #2
dariober
Senior Member
 
Location: Cambridge, UK

Join Date: May 2010
Posts: 311
Default

Hi- I'm not sure how/if it can be done by Blast. However you can extract the top hit from the blast ouput (blastout.txt) with the code below:

Code:
sort -k1,1 -k12,12nr -k11,11n  blastout.txt | sort -u -k1,1 --merge
The first sort orders the blast output by query name then by the 12th column in descending order (bit score - I think), then by 11th column ascending (evalue I think).
The second sort picks the first line from each query. Obviously you can skip the first sort if the output is already sorted in the 'correct' order.

Hope it helps (make sure it does what you want)...

Dario
dariober is offline   Reply With Quote