

def read_seq_dict(pathstem, trypath=None):
    'read seqDict for NLMSA'
    if os.access((pathstem + '.seqDictP'), os.R_OK):
        from pygr import worldbase
        ifile = file((pathstem + '.seqDictP'), 'rb')
        try:
            seqDict = worldbase._mdb.loads(ifile.read())
        finally:
            ifile.close()
    elif os.access((pathstem + '.seqDict'), os.R_OK):
        import seqdb
        seqDict = seqdb.PrefixUnionDict(filename=(pathstem + '.seqDict'), trypath=trypath)
    else:
        raise ValueError(('Unable to find seqDict file\n%s.seqDictP or %s.seqDict\nand no seqDict provided as an argument' % (pathstem, pathstem)))
    return trypath

dataset/ETHPy150Open cjlee112/pygr/pygr/nlmsa_utils.py read_seq_dict/VarMisuse@145/249 `seqDict`->`trypath`