def __getitem__(self, k):
        "convert ID of form seqID:frame into slice info tuple"
        i = k.rfind(':')
        if i < 0:
            raise KeyError('invalid TranslationInfo key: %s' % (k, ))
        seqID = k[:i]
        length = len(self.seqDB[seqID]) # sequence length
        frame = int(k[i+1:])
        if k[i+1] == '-': # negative frame -0, -1, or -2
            return (seqID, -(length - ((length + frame) % 3)), frame)
        else: # positive frame 0, 1 or 2
            return (seqID, frame, length - ((length - frame) % 3))
dataset/ETHPy150Open cjlee112/pygr/pygr/translationDB.py/SixFrameInfo.__getitem__/original