aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorBonfaceKilz2021-02-17 16:43:22 +0300
committerBonfaceKilz2021-02-24 14:20:29 +0300
commitdab1ec0d819df91cb61775bb885b0c6d72b144f1 (patch)
tree245681250285932760210f7ac9bffa14a3f93ce1 /gn3/api
parent396a48df30e3449a6ba61ef86d54f8038ccab221 (diff)
downloadgenenetwork3-dab1ec0d819df91cb61775bb885b0c6d72b144f1.tar.gz
gn3: api: gemma: Add endpoint for checking gemma-wrapper version
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/gemma.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/gn3/api/gemma.py b/gn3/api/gemma.py
index d0cf5f8..c9c4e54 100644
--- a/gn3/api/gemma.py
+++ b/gn3/api/gemma.py
@@ -1,9 +1,11 @@
"""Endpoints for running the gemma cmd"""
from flask import Blueprint
+from flask import current_app
from flask import jsonify
gemma = Blueprint("gemma", __name__)
+from gn3.commands import run_cmd
@gemma.route("/")
def index() -> str:
@@ -13,8 +15,10 @@ def index() -> str:
@gemma.route("/version")
def get_version():
- pass
-
+ """Display the installed version of gemma-wrapper"""
+ gemma_cmd = current_app.config['APP_DEFAULTS'].get('GEMMA_WRAPPER_CMD')
+ return jsonify(
+ run_cmd(f"{gemma_cmd} -v | head -n 1"))
@gemma.route("/k-compute/<token>", methods=["POST"])
def run_k_compute(token) -> str:
@@ -31,6 +35,3 @@ def run_pheno_permutation(token) -> str:
pass
-@gemma.route("/lmm2/loco/<token>", methods=["POST"])
-def run_gemma_with_loco(token) -> str:
- pass