def __init__(self, nlmsa, filename, mode, idDictClass=None,
                 maxSequenceCacheSize=_DEFAULT_SEQUENCE_CACHE_SIZE):
        self._cache = classutil.RecentValueDictionary(maxSequenceCacheSize)
        self.seqlist = NLMSASeqList(self)
        self.nlmsa = nlmsa
        self.filename = filename
        if mode == 'memory': # just use python dictionary
            idDictClass = dict
        elif mode == 'w': # new database
            mode = 'n'
        if idDictClass is None: # use persistent id dictionary storage
            self.seqIDdict = classutil.open_shelve(filename + '.seqIDdict',
                                                   mode)
            self.IDdict = classutil.open_shelve(filename + '.idDict', mode)
        else: # user supplied class for id dictionary storage
            self.seqIDdict = idDictClass()
            self.IDdict = idDictClass()
dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py/NLMSASeqDict.__init__/original