utils.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:pheweb 作者: statgen 项目源码 文件源码
def get_phenolist():
    # TODO: should this be memoized?
    from .file_utils import common_filepaths
    filepath = common_filepaths['phenolist']
    try:
        with open(os.path.join(filepath)) as f:
            phenolist = json.load(f)
    except (FileNotFoundError, PermissionError):
        raise PheWebError(
            "You need a file to define your phenotypes at '{}'.\n".format(filepath) +
            "For more information on how to make one, see <https://github.com/statgen/pheweb#3-make-a-list-of-your-phenotypes>")
    except json.JSONDecodeError:
        print("Your file at '{}' contains invalid json.\n".format(filepath) +
              "The error it produced was:")
        raise
    for pheno in phenolist:
        pheno['phenocode'] = urllib.parse.quote_plus(pheno['phenocode'])
    return phenolist
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号