skbio.sequence.Protein.matches¶
- Protein.matches(other)[source]¶
Find positions that match with another sequence.
State: Stable as of 0.4.0.
- Parameters:
other (str, Sequence, or 1D np.ndarray (np.uint8 or '|S1')) – Sequence to compare to.
- Returns:
Boolean vector where
True
at positioni
indicates a match between the sequences at their positionsi
.- Return type:
1D np.ndarray (bool)
- 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('GAUU') >>> s.matches(t) array([ True, False, True, False], dtype=bool)