New in Wolfram Mathematica 7: Sequence Alignment & Analysis  previous | next 
Rapidly Visualize Large-Scale Sequence Similarity
Show the global similarity score between all possible prefixes of two random DNA sequences.
In[1]:=

Click for copyable input
ArrayPlot[

   Table[NeedlemanWunschSimilarity[StringTake[#[[1]], i], 

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

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

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