SimilarityRules

SimilarityRules
is an option for functions such as SequenceAlignment that gives a list of rules for similarity scores to assume between pairs of elements.

DetailsDetails

  • The setting for SimilarityRules must consist of a list of rules of the form , where the give elements to compare, and v gives their similarity.
  • The can be either explicit characters or other elements, or patterns.
  • A rule for gives the score for a deletion; a rule for gives the score for an insertion.
  • SimilarityRules->Automatic is effectively equivalent to , giving a score of for any pair of identical elements, and a score of for any mismatch, deletion or insertion.
  • The following named settings for SimilarityRules implement various similarity matrices typically used for particular bioinformatics purposes:
  • "BLAST"alignment of nucleotide sequences
    "BLOSUM62"local alignment of related amino acid sequences
    "BLOSUM80"local alignment of similar sequences
    "PAM30"global alignment of very similar amino acid sequences
    "PAM70"global alignment of related sequences
    "PAM250"global alignment of dissimilar sequences

ExamplesExamplesopen allclose all

Basic Examples (3)Basic Examples (3)

Align two strings on the first :

In[1]:=
Click for copyable input
Out[1]=

Align instead on the second by making the replacement favorable:

In[2]:=
Click for copyable input
Out[2]=

Get the global similarity of two strings using default similarity scores:

In[1]:=
Click for copyable input
Out[1]=

Change the scores so and are considered a match:

In[2]:=
Click for copyable input
Out[2]=

Use the similarity matrix to globally align related protein sequences:

In[1]:=
Click for copyable input
Out[1]=
New in 7
New to Mathematica? Find your learning path »
Have a question? Ask support »