Blast results ascending sorting by nucleotide number
0
0
Entering edit mode
3.7 years ago

Hello guys,

I am trying to reorganize a blast result in ascending order considering nucleotide number of the query sequence. Basically I`m trying to view every alignment from the "first" nucleotide to the last of the query sequence. So for this I am trying to work with this line of command

grep -A 2 Query blast.txt | sort -k2 -n

but the problem is that this line of command doesn't work. I'm getting results in ascending order but only for the query lines. I want to have the ascending order for the entire alignment query-subject. For instance I want to see the alignemnt where in query the first nucleotide is number 223 up to number 507. Then I want the following alignemnt to be from number 1007 in query up to nucleotide 1705 and so on but I want to see also the alignment between query and subject.Can you please give me an insight on how this could work ? Thank you very much.

alignment • 1.1k views
ADD COMMENT
0
Entering edit mode

It would be useful to show a sample of what blast.txt looks like. head -10 blast.txt many be enough.

ADD REPLY
0
Entering edit mode

Hello, thank you for your quick reply. The files it`s like this : http://ibb.co/842zdJJ

Thank you.

ADD REPLY
0
Entering edit mode

As feed-back,

Let`s say I have the first alignment from 12001 to 13057 in query and in subject from 37057 to 38113. The second with a low score from 701 to 801 in query and in subject from 42000 to 42100. I want to have a file where the first alignment is the one from 701 to 801 and the second alignment the one from 12001 to 13057. Basically I want to view the sequence alignments in ascending order from the "first" nucleotide in query to the "last" Thank you.

ADD REPLY
0
Entering edit mode

Hi, here is the image using head command : https://ibb.co/4NG2Kpt

Thank you.

ADD REPLY
0
Entering edit mode

I don't think this is going to be simple or even feasible using plain unix utils. Blast arranges the HSP's according to their ranking and you would need to move entire HSP blocks around so a simple sort is not likely to work. Custom code made be needed for what you want.

ADD REPLY
0
Entering edit mode

Thank you. All the information is appreciated. Thanks again.

ADD REPLY
0
Entering edit mode

Why not just use -outfmt 6 and sort the whole file by the relevant column (I forget which it is off-hand).

ADD REPLY

Login before adding your answer.

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