#NEWLINE# @ stable ( as_of = '0.4.0' ) #NEWLINE# def index( self , subsequence , start = None , end = None ) : #NEWLINE# #INDENT# "Find position where subsequence first occurs in the sequence.\n\n        Parameters\n        ----------\n        subsequence : str, Sequence, or 1D np.ndarray (np.uint8 or '\\|S1')\n            Subsequence to search for in this sequence.\n        start : int, optional\n            The position at which to start searching (inclusive).\n        end : int, optional\n            The position at which to stop searching (exclusive).\n\n        Returns\n        -------\n        int\n            Position where `subsequence` first occurs in this sequence.\n\n        Raises\n        ------\n        ValueError\n            If `subsequence` is not present in this sequence.\n        TypeError\n            If `subsequence` is a ``Sequence`` object with a different type\n            than this sequence.\n\n        Examples\n        --------\n        >>> from skbio import Sequence\n        >>> s = Sequence('ACACGACGTT-')\n        >>> s.index('ACG')\n        2\n\n        " #NEWLINE# try : #NEWLINE# #INDENT# return self . _string . index ( self . _munge_to_bytestring ( subsequence , 'index' ) , start , end ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# raise ValueError ( ( '%r is not present in %r.' % ( start , self ) ) )