def __init__(self, path, start=0, stop=None, step=None, reversePath=False,
                 relativeToStart=False, absoluteCoords=False):
        '''Return slice of path[start:stop:step].
        NB: start>stop means reverse orientation, i.e. (-path)[-stop:-start]
        start/stop are LOCAL coordinates relative to the specified path
        By default, start/stop are interpreted in the usual Python slicing way,
        i.e. a negative start value is interpreted as len(path)-start.
        The relativeToStart option turns off this behavior, so that negative
        values are interpreted as negative coordinates in the local coordinate
        system of path.

        absoluteCoords option allows intervals to be created using
        Pygr's internal coordinate convention i.e.
        -20,-10 --> -(path.pathForward[10:20])
        '''
        if reversePath: # create top-level negative orientation path
            start = -(path.stop)
            stop = 0
            self._reverse = path
            path = None # make this a top-level path object
        if absoluteCoords: # THIS OPTION PROVIDES TRANSPARENT WAY TO CREATE
            if start >= 0:   # INTERVALS USING start,stop PAIRS THAT FOLLOW
                path = path.pathForward # OUR INTERNAL SIGN CONVENTION
            else: # i.e. start<0 MEANS REVERSE ORIENTATION!
                path = - (path.pathForward)
        else: # ADJUST start,stop ACCORDING TO path.start / path.stop
            start = sumSliceIndex(start, path, relativeToStart or start is None
                                  or start>=0)
            stop = sumSliceIndex(stop, path, relativeToStart or
                                 (stop is not None and stop>=0))
        if start is not None and stop is not None and start>stop:
            start = -start # start>stop MEANS REVERSE ORIENTATION!
            stop = -stop
            if path is not None:
                path = -path
        if path is not None: # perform bounds checking
            if start < path.path.start:
                start = path.path.start
            if stop > path.path.stop:
                stop = path.path.stop
        if start is None or stop is None or start>=stop:
            raise IndexError('cannot create empty sequence interval!')
        self.start = start
        self.stop = stop
        if step is None:
            step = 1
        if path is None:
            self.path = self
            self.step = step
        else: # STORE TOP-LEVEL SEQUENCE PATH...
            self.path = path.path
            self.step = step * path.step
dataset/ETHPy150Open cjlee112/pygr/pygr/sequence.py/SeqPath.__init__/original