

def __iadd__(self, targetIval):
    'save an alignment edge between self and targetIval'
    if self.is_lpo:
        if isinstance(targetIval, types.SliceType):
            raise ValueError('you attempted to map LPO --> LPO?!?')
        self.ns.nlmsaLetters.__iadd__(targetIval)
        splitList = splitLPOintervals(self.ns.nlmsaLetters.lpoList, slice(self.start, self.stop), targetIval)
        for (ns, src, target) in splitList:
            ns[src] = self.ns.nlmsaLetters.seqs.getIDcoords(target)
            if self.ns.nlmsaLetters.is_bidirectional:
                (nsu, myslice) = self.ns.nlmsaLetters.seqs.getUnionSlice(target)
                nsu[myslice] = (ns.id, src.start, src.stop)
    elif isinstance(targetIval, types.SliceType):
        splitList = splitLPOintervals(self.ns.nlmsaLetters.lpoList, targetIval, self.seq)
        for (ns, target, src) in ns:
            self.ns[self.offsetSlice(src)] = (ns.id, target.start, target.stop)
            if self.ns.nlmsaLetters.is_bidirectional:
                ns[target] = (self.id, src.start, src.stop)
    else:
        self.ns.nlmsaLetters.__iadd__(targetIval)
        self.ns.nlmsaLetters.init_pairwise_mode()
        ns_lpo = self.ns.nlmsaLetters.seqlist[(self.ns.id - 1)]
        ns_lpo[self.offsetSlice(self.seq)] = self.ns.nlmsaLetters.seqs.getIDcoords(targetIval)
        if self.ns.nlmsaLetters.is_bidirectional:
            (nsu, myslice) = self.ns.nlmsaLetters.seqs.getUnionSlice(targetIval)
            ns_lpo = self.ns.nlmsaLetters.seqlist[(nsu.id - 1)]
            ns_lpo[myslice] = (self.id, self.start, self.stop)
    return self

dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py BuildMSASlice.__iadd__/VarMisuse@200/317 `splitList`->`ns`