

def getUnionSlice(self, seq):
    'get union coords for this seq interval, adding seq to index if needed'
    try:
        (id, ns, offset) = self[seq]
    except KeyError:
        self.saveSeq(seq)
        (id, ns, offset) = self[seq]
    (i, start, stop) = self.getIDcoords(seq)
    if (start < 0):
        return (ns, slice((start - offset), (stop - offset)))
    else:
        return (ns, slice((start + offset), (stop + offset)))

dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py NLMSASeqDict.getUnionSlice/original