diff options
author | zsloan | 2022-09-26 20:45:06 +0000 |
---|---|---|
committer | zsloan | 2022-09-26 20:45:06 +0000 |
commit | 3474a14fa4aa34def76a180395752d554592c026 (patch) | |
tree | b20af4256f1a4dd552b04f0d7785872c134e5243 /wqflask | |
parent | f3fbcc0828967d7bbbb5f60c0fcc79814af70985 (diff) | |
download | genenetwork2-3474a14fa4aa34def76a180395752d554592c026.tar.gz |
Add REST API endpoint for viewing a group's genotype file metadata
Diffstat (limited to 'wqflask')
-rw-r--r-- | wqflask/wqflask/api/router.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/wqflask/wqflask/api/router.py b/wqflask/wqflask/api/router.py index 7335ec4f..b2ad5d2c 100644 --- a/wqflask/wqflask/api/router.py +++ b/wqflask/wqflask/api/router.py @@ -776,6 +776,13 @@ def get_mapping_results(): return return_error(code=204, source=request.url_rule.rule, title="No Results", details="") +@app.route("/api/v_{}/genotypes/view/<string:group_name>".format(version)) +def view_genotype_files(group_name): + if os.path.isfile("{0}/{1}.json".format(flat_files("genotype"), group_name)): + with open("{0}/{1}.json".format(flat_files("genotype"), group_name)) as geno_json: + return flask.jsonify(json.load(geno_json)) + + @app.route("/api/v_{}/genotypes/<string:file_format>/<string:group_name>/<string:dataset_name>.zip".format(version)) @app.route("/api/v_{}/genotypes/<string:file_format>/<string:group_name>/<string:dataset_name>".format(version)) @app.route("/api/v_{}/genotypes/<string:file_format>/<string:group_name>.zip".format(version)) |