skbio.sequence.GrammaredSequence.mismatches

GrammaredSequence.mismatches(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 对象的类型与此序列不同。

参见

matches

示例

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