polymerist.genutils.sequences.similarity.distances

Implementations of calculation methods for sequence distance (“inverse similarity”) metrics

Attributes

T

tanimoto_distance

Functions

hamming_distance(→ int)

Compute the Hamming distance between a pair of sequences with elements of compatible type (sequences must have the same length)

jaccard_distance(→ float)

Compute the Jaccard distance between a pair of sequences with elements of compatible type

Module Contents

polymerist.genutils.sequences.similarity.distances.T
polymerist.genutils.sequences.similarity.distances.hamming_distance(seq1: Sequence[T], seq2: Sequence[T]) int[source]

Compute the Hamming distance between a pair of sequences with elements of compatible type (sequences must have the same length) Denotes the number of elements at the same positions in each sequence which are different

polymerist.genutils.sequences.similarity.distances.jaccard_distance(seq1: Sequence[T], seq2: Sequence[T]) float[source]

Compute the Jaccard distance between a pair of sequences with elements of compatible type Denotes the complement of the ratio of shared elements (intersection) to total elements (union)

polymerist.genutils.sequences.similarity.distances.tanimoto_distance