skbio.sequence.DNA.is_reverse_complement#

DNA.is_reverse_complement(other)[source]#

Determine if a sequence is the reverse complement of this sequence.

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

Sequence to compare to.

Returns:
bool

True if other is the reverse complement of the nucleotide sequence.

Raises:
TypeError

If other is a Sequence object with a different type than the nucleotide sequence.

Examples

>>> from skbio import DNA
>>> DNA('TTCATT').is_reverse_complement('AATGAA')
True
>>> DNA('TTCATT').is_reverse_complement('AATGTT')
False
>>> DNA('ACGT').is_reverse_complement('ACGT')
True