def getUnionSlice(self, seq):
        'get union coords for this seq interval, adding seq to index if needed'
        try:
            id, ns, offset = self[seq] # look up in index
        except KeyError:
            self.saveSeq(seq) # add this new sequence to our current union
            id, ns, offset = self[seq] # look up in index
        # Make sure to handle annotations right
        i, start, stop = self.getIDcoords(seq)
        if start < 0: # reverse orientation
            return ns, slice(start - offset, stop - offset) # use union coords
        else: # forward orientation
            return ns, slice(start + offset, stop + offset) # use union coords
dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py/NLMSASeqDict.getUnionSlice/original