Question: Semi Global Alignment
2
gravatar for Maria
5.5 years ago by
Maria140
Maria140 wrote:

hello,

I'm trying to write a code to algin 2 sequences where gaps are for free in the beginning and the end of the second sequence i.e.

s1 = CATACGTCGACGGCT
s2 = ACGACGT**AAAAC**

Alignment:

CATACGTCGACGGCT
---ACGACGT-----------

I need to stop at some point(T for example) in s2 where the two sequences don't match anymore ( global alignment with free gaps at start and end)

I used a semi global alignment approach s1 in row, s2 in column , initialize the first row to 0 , initialize the 1st column as gaps accumulation

Questions :1- what is the best way to chose the beginning of trace back , is it the maximum of the last row ? 2- for this problem filling the matrix is like local alignment (minimum =0) or like the global one ore negative values are allowed ?

• 2.6k views
ADD COMMENTlink modified 5.5 years ago by brentp22k • written 5.5 years ago by Maria140

There's nothing bold in s2.

ADD REPLYlink written 5.5 years ago by Spitshine620

check the right part now

ADD REPLYlink written 5.5 years ago by Maria140
0
gravatar for audrius.meskauskas
5.5 years ago by
audrius.meskauskas90 wrote:

This looks much more like local alignment for me (no start/end gap penalty). May be this is the right algorithm for you?

ADD COMMENTlink written 5.5 years ago by audrius.meskauskas90

local also sets all negative scores to 0. If you only want no start/end gap penalties it is semi-global

ADD REPLYlink written 5.5 years ago by Niek De Klein2.4k
0
gravatar for brentp
5.5 years ago by
brentp22k
Salt Lake City, UT
brentp22k wrote:

I think what you're looking for is global alignment with cost-free-ends.

You can try various strategies with this module: https://github.com/brentp/align

Here's an example script:

s1 = "CATACGTCGACGGCT"
s2 = "ACGACGTAAAAC"

from align import aligner

for method in ("global_cfe", "glocal", "local", "global"):

    print "-" * len(method)
    print method
    print "-" * len(method)
    print "\n".join(aligner(s1, s2, method=method))
    print

which creates the following output:

----------
global_cfe
----------
CATACGTCG-ACGGCT
---ACGACGTAAAAC-

------
glocal
------
ACGTCG-ACGGC
ACGACGTAAAAC

-----
local
-----
ACGTCG-ACGGC
ACGACGTAAAAC

------
global
------
CATACGTCGACGGCT
ACGACGTAAAA--C-
ADD COMMENTlink written 5.5 years ago by brentp22k

thank you for your answer, I'm interested in the first one (global cfe) where can find how the algorithm works ?

ADD REPLYlink written 5.5 years ago by Maria140

i;m trying to implement under perl

ADD REPLYlink written 5.5 years ago by Maria140
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: 1364 users visited in the last hour