skbio.sequence.Protein.matches

Protein.matches(other)[源代码]

找到与其他序列匹配的位置。

状态:0.4.0稳定。

参数:

other (str, Sequence, or 1D np.ndarray (np.uint8 or '|S1')) -- 要比较的序列。

返回:

布尔向量,其中 True 就位 i 指示序列在其位置上的匹配 i .

返回类型:

1D np.ndarray (bool)

抛出:
  • ValueError -- 如果序列长度不同。

  • TypeError -- 如果 other 是一个 Sequence 对象的类型与此序列不同。

参见

mismatches

示例

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