skbio.sequence.Sequence.mismatches#

Sequence.mismatches(other)[source]#

Find positions that do not match with another sequence.

Parameters:
otherstr, Sequence, or 1D np.ndarray (np.uint8 or ‘|S1’)

Sequence to compare to.

Returns:
1D np.ndarray (bool)

Boolean vector where True at position i indicates a mismatch between the sequences at their positions i.

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

matches

Examples

>>> from skbio import Sequence
>>> s = Sequence('GGUC')
>>> t = Sequence('GAUU')
>>> s.mismatches(t)
array([False,  True, False,  True], dtype=bool)