New in Wolfram Mathematica 7: Sequence Alignment & Analysis  previous | next 
Solve Classic Sequence Similarity Problems
Show the number of ordered matching elements between all possible prefixes of two random DNA sequences.
In[1]:=

Click for copyable input
ArrayPlot[

   Table[StringLength@

     LongestCommonSequence[StringTake[#[[1]] 1, i], 

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

     StringLength[#[[2]]], 1}], ColorFunction -> "RedBlueTones"] &@

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