New in Wolfram Mathematica 7: Sequence Alignment & Analysis  previous | next 
Generate Sequence Alignments in a Computable Form
Globally align the prefixes of two random DNA sequences, generating a convenient nested list structure.
In[1]:=

Click for copyable input
Manipulate[

   SequenceAlignment[StringTake[#[[1]], i], 

    StringTake[#[[2]], j]], {i, 1, StringLength[#[[1]]], 1}, {j, 1, 

    StringLength[#[[2]]], 1}] &@

 Table[StringJoin[RandomChoice[{"A", "C", "T", "G"}, 80]], {2}]
Out[1]=