Question: biopython's local alignment get start and end position of both sequences
0
gravatar for juan.crescente
2.6 years ago by
juan.crescente40 wrote:

I'm trying to get the position of the start and end/length for both sequences in a pairwise alignment, but I do not get that information in output, what I have so far

    alignments = pairwise2.align.localms(seq1, seq2, 2, -2, -3, -3)
    for a in alignments:
        print a
        print pairwise2.format_alignment(*a)
        break

... 232.0, 61, 189)

where 232 is the score, 61 is the start of something and 189 is the end. I need start and end for seq1 and seq2, any hints?

ADD COMMENTlink modified 2.6 years ago by Joe17k • written 2.6 years ago by juan.crescente40
0
gravatar for Joe
2.6 years ago by
Joe17k
United Kingdom
Joe17k wrote:

Check what Type a is. If it's already a list, then try something like start = a[1] and end = a[2] (you'll have to show us the full output to be more specific).

If it's just a string, you can try something like a.split(',')[1].

Biopython probably already has an attribute for this though, so check the pairwise2 documentation (it’s been updated recently) so you probably don’t need to do anything as hacky as I’ve suggested.

ADD COMMENTlink modified 2.6 years ago • written 2.6 years ago by Joe17k

I had seen the documentation, but there's no output like you suggested. What I'm asking for it is not the way to access the tuple, but where are those results placed in the output of the algorithm

ADD REPLYlink written 2.6 years ago by juan.crescente40
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1456 users visited in the last hour