RNA.
distance
(other, metric=None)[source]¶Compute the distance to another sequence.
State: Experimental as of 0.4.0.
Parameters: | other : str, Sequence, or 1D np.ndarray (np.uint8 or ‘|S1’)
metric : function, optional
|
---|---|
Returns: | float
|
Raises: | ValueError
TypeError
|
See also
fraction_diff
, fraction_same
, scipy.spatial.distance.hamming
Examples
>>> from skbio import Sequence
>>> s = Sequence('GGUC')
>>> t = Sequence('AGUC')
>>> s.distance(t)
0.25
>>> def custom_dist(s1, s2): return 0.42
>>> s.distance(t, custom_dist)
0.42