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
评论列表
文章目录