Question: Local alignment in biopython
0
gravatar for tinysnippets
3.2 years ago by
tinysnippets40
tinysnippets40 wrote:

Hi there, folks! I have a misunderstanding about biopython`s local alignment function (localxx from there). So I have a rather short sequence of DNA - about 300 bp, lets call it S. And I have a large set of short (about 75 bp) seqs that considered as candidates to be S`s prefix, lets call this guys R. What I`d like to do is to align R members to S by local alignment algorithm. Lets say S is "PREFIXPART_LOOONGSUFFIXPART" and R member is "PREFIX" it yields following

>>> for res in pairwise2.align.localxx("PREFIX", "PREFIXPART_LOOONGSUFFIXPART"): print(res)
('PREFI-----------------X----', 'PREFIXPART_LOOONGSUFFIXPART', 6.0, 0, 23)
('PRE----------------F-IX----', 'PREFIXPART_LOOONGSUFFIXPART', 6.0, 0, 23)
('PREF-----------------IX----', 'PREFIXPART_LOOONGSUFFIXPART', 6.0, 0, 23)
('PRE-----------------FIX----', 'PREFIXPART_LOOONGSUFFIXPART', 6.0, 0, 23)
('PREFIX---------------------', 'PREFIXPART_LOOONGSUFFIXPART', 6.0, 0, 6)

As you can see it actually works as expected for this two strings, but in my case it refuses to see, that prefix actually aligns to template one - to - one (or with very minor modifications) and instead of getting "compact" alignments I get very distributed ones. How to handle this situation? Should I use some kind of score matrix or something?

alignment sequence • 1.1k views
ADD COMMENTlink modified 3.2 years ago by Eric T.2.4k • written 3.2 years ago by tinysnippets40
3
gravatar for Eric T.
3.2 years ago by
Eric T.2.4k
San Francisco, CA
Eric T.2.4k wrote:

The function localxx aligns the sequences with no gap penalties, but you do want to penalize gaps. You could try localxs instead:

>>> for res in pairwise2.align.localxs("PREFIX", "PREFIXPART_LOOONGSUFFIXPART", -1, -1): print(res)
('PREFIX---------------------', 'PREFIXPART_LOOONGSUFFIXPART', 6.0, 0, 6)
ADD COMMENTlink modified 3.2 years ago • written 3.2 years ago by Eric T.2.4k
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: 1073 users visited in the last hour