[Biopython] Help modify this code so it can do what I want it to do

Peter Cock p.j.a.cock at googlemail.com
Mon Feb 3 12:19:40 UTC 2014


On Sun, Feb 2, 2014 at 7:28 PM, Edson Ishengoma
<ishengomae at nm-aist.ac.tz> wrote:
> Hi folks,
>
> I picked this code from somewhere and edited it a bit but it still can't
> achieve what I need. I have an xml output of tblastn hits on my customized
> database and now I am in the process to extract the results with biopython.
> With tblastn sometimes the returned hit is multiple local hits corresponding
> to certain positions along the query with significant scores. Now I want to
> concatenate these local hits which initially requires sorting according to
> positions.
>
> ...
>                       complete_query_seq += str(query[q_start:q_end])
>                       complete_sbjct_seq += str(query[sb_start:sb_end])
> ...

Shouldn't you be taking a slice from the subject sequence (the database
match) there, rather than the query sequence?

Another approach would be to use the alignment sequence fragments
BLAST gives you (and remove the gap characters).

Peter



More information about the Biopython mailing list