skbio.sequence.Protein.mismatch_frequency¶
-
Protein.
mismatch_frequency
(other, relative=False)[source]¶ Return count of positions that differ between two sequences.
State: Stable as of 0.4.0.
- Parameters
- Returns
Number of positions that differ between the sequences. This will be an
int
if relative isFalse
and afloat
if relative isTrue
.- Return type
- Raises
ValueError – If the sequences are not the same length.
TypeError – If other is a
Sequence
object with a different type than this sequence.
See also
Examples
>>> from skbio import Sequence >>> s = Sequence('GGUC') >>> t = Sequence('AGUC') >>> s.mismatch_frequency(t) 1 >>> s.mismatch_frequency(t, relative=True) 0.25