Sort blast result in format 6 by first column
0
0
Entering edit mode
3 months ago
Elene • 0

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 • 200 views
1
Entering edit mode

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.

0
Entering edit mode

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.