def __setitem__(self, k, ns):
        'save mapping of seq to the specified NLMSASequence'
        self.seqlist.append(ns)
        if isinstance(k, types.StringType):
            # Allow build with a string object.
            self._cache[k] = (ns.id, ns, 0)
        elif k is not None:
            self._cache[k.pathForward] = (ns.id, ns, 0)
dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py/NLMSASeqDict.__setitem__/original