traceback (was [Biophp-dev] scripts)

biophp-dev@bioinformatics.org biophp-dev@bioinformatics.org
Fri, 30 May 2003 16:19:50 +0200


------------EDA71A98306DE3
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hola serge,


SG> Your code seems to be working fine.  I'll
SG> do more tests on it.  Btw, could you be more specific as to
SG>  what you were looking for last time?  The traceback thing?
SG> I might have some links for you...
from what i've learned so far alignment can be done by variuous
algorithms, needleman-wunsch being the most basic one described on the
site u linked to in a recent mail.
(http://molvis.chem.indiana.edu/C687_S99/lecture2.html#alignments)
All of them seem to be related, just varying in the different cost
models they use.
The traceback step comes after filling the matrix with the different
costs for transformations, starting in the lower right corner one
traces the possible alignments back to the upper left corner, by
going up, left, or diagonal to where the lowest cell values are and
diagonal having priority over the others. It is perfectly escribed in
this article which uses a matrix build out of the levensthein
distance.
http://bioinfo.weizmann.ac.il/courses/BCG/lectures/02_pairwise/2.4tools/03DP.html

Until now im not quite sure if the traceback process is the same in
all those different global alignment algorithms, i might not know ;)
If yes, one could have one single traceback function for all the different
algorithms.
Thats why im looking for material regarding the different algorithms, the
ones i found where needleman-wunsch, smith-waterman and some
extensions of them, which seem to share the Traceback procedure.

i attached a very basic bit that returns a matrix as a result of a
needleman-wunsch algorithm which could be passed to a traceback
function doing the actual alignment. Of course its gotta be oo in the
end, but i did tell u im lazy ;)
------------EDA71A98306DE3
Content-Type: application/octet-stream; name="alignabit.inc.php"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="alignabit.inc.php"

PD9waHANCmZ1bmN0aW9uIG5lZWRsZW1hbl93dW5zY2hfbWF0cml4KCRzb3VyY2UsJHRhcmdldCl7
DQoJJG1hdHJpeD1hcnJheShyYW5nZSgwLHN0cmxlbigkc291cmNlKS0xKSxyYW5nZSgwLHN0cmxl
bigkdGFyZ2V0KS0xKSk7DQoJLy9pbml0aWFsaXplIG1hdHJpeA0KCWZvciAoJGk9MDskaTw9c3Ry
bGVuKCRzb3VyY2UpOyRpK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