# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Align sequences known to be nearly identical

Contributed by:
John Cassel, Wolfram|Alpha Scientific Content

ResourceFunction["AlignNearlyIdenticalSequences"][ ]seq_{2}create an alignment between two strings or biomolecular sequences .seq_{2} |

The "UniqueSubsequenceLength" option asserts how long a contiguous subsequence must be to be different than all other contiguous subsequences of the same length. The default value is 1000.

The result of this function is an alignment given as a list of successive matching and differing sequences. See SequenceAlignment for further documentation and examples.

The alignment generated by this method may not be optimal, though it should always be correct if the subsequence length parameter is set appropriately.

Intended for similar sequences as are typically found in organisms of the same species.

Find an alignment for nearly identical sequences:

In[1]:= |

Out[1]= |

This function is suitable for aligning biomolecular sequences:

In[2]:= |

Out[2]= |

This function can be used with the AlignmentToPositionDifferences resource function to produce manageable differences between quite large but nearly identical sequences:

In[3]:= |

Out[3]= |

Use this alignment to compare a variant of the SARS-CoV-2 coronavirus with the reference sequence:

In[4]:= |

Out[4]= |

In[5]:= |

Out[5]= |

When we cannot assume these sequences are nearly identical, we have to work longer to assure an optimal alignment:

In[6]:= |

Out[6]= |

In[7]:= |

Out[7]= |

- 1.0.0 – 13 April 2021

This work is licensed under a Creative Commons Attribution 4.0 International License