Question: biopython's local alignment get start and end position of both sequences
0
gravatar for juan.crescente
20 months ago by
juan.crescente20 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 20 months ago by Joe14k • written 20 months ago by juan.crescente20
0
gravatar for Joe
20 months ago by
Joe14k
United Kingdom
Joe14k 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 20 months ago • written 20 months ago by Joe14k

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 20 months ago by juan.crescente20
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: 565 users visited in the last hour