| Trees | Indices | Help |
|
|---|
|
|
Algorithms for commonly-used distance metrics.
Author: Mark Granroth-Wilding <mark.granroth-wilding@ed.ac.uk>
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
__package__ = Nonehash(x) |
|||
|
|||
Compute the Levenshtein distance between two sequences. By default, will compare the elements using the == operator, but any binary function can be given as the equality argument. delins_cost is the cost applied for deletions and insertions. subst_cost_fun is a binary function that gives the cost to substitute the first argument with the second. If not given, a cost of delins is used for any substitution. |
Compute the Levenshtein distance between two sequences. This does the same thing as levenshtein_distance, but stores pointers to indicate what alignments gave the costs and returns the full cost matrix, plus the pointer matrix.
|
Finds the optimal alignment of the two sequences using Levenshtein distance and traces back the pointers to find the alignment. Returns a list of pairs, containing the points from the two lists. In the case of a substitution, it will contain the two points that
were aligned. In the case of an insertion, the first value will be
Note that the pair of values in the case of a substitution may be equal - an alignment - or not - a substitution - depending on the substitution cost function.
|
Compute a local alignment variant of the Levenshtein distance between two sequences. Options are the same as levenshtein_distance_with_pointers. Finds the optimal alignment of seq2 within seq1. In addition to the operations I, D and S used in levenshtein_distance_with_pointers, we use here '.' to indicate a deletion at zero-cost at the beginning or end. |
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:56 2012 | http://epydoc.sourceforge.net |