This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Sort blast result in format 6 by first column

Hello, newbie here!

I have a blast result file in format 6, with the 12 columns and tab separated if I'm not mistaken.

I want to sort it by the first column. From some blogs online I tried a simple command, but the one I did kept only the first column and erased the rest. I tried this:

sort -k 1 sample1_blast.out > sample1_blast_join_try.txt

Is there a better and more correct way of doing this?

blast unix commands sort result

that should be the way to do it, and it shouldn't remove any columns. Can you post the results of:

head -3 sample1_blast.out
sort -k 1 sample1_blast.out | head -3

This means, (1) examines the first few lines of the file, and (2) examine the first few lines after sorting.

Thanks for your answer. I managed to fix it, kind of by trying a bunch of commands and I think I had in previous commands messed up the spacings between columns. And then it sorted correctly.

0 answers

No answers yet.

Log in to answer this question.