skbio.core.sequence.DNASequence.index

DNASequence.index(subsequence)[source]

Return the position where subsequence first occurs

Returns:

int

The position where subsequence first occurs in the BiologicalSequence.

Examples

>>> from skbio.core.sequence import BiologicalSequence
>>> s = BiologicalSequence('ACACGACGTT-')
>>> s.index('ACG')
2