aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorAlexander Kabui2021-05-15 01:20:46 +0300
committerGitHub2021-05-15 01:20:46 +0300
commitc69b11cffba7547d65ac9812b0118cddad91be0d (patch)
treebfa55c23f702db5072e8839e44961dd72fd4a9e2 /gn3/api
parentbcba700bd2835f0a36042d781860b3407519f6d8 (diff)
parent46a96ec0b89620eed4874ada565a9643ac19a042 (diff)
downloadgenenetwork3-c69b11cffba7547d65ac9812b0118cddad91be0d.tar.gz
Merge branch 'main' into feature/minor-fixes
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/gemma.py4
-rw-r--r--gn3/api/general.py16
2 files changed, 17 insertions, 3 deletions
diff --git a/gn3/api/gemma.py b/gn3/api/gemma.py
index 81e185d..6b0b20e 100644
--- a/gn3/api/gemma.py
+++ b/gn3/api/gemma.py
@@ -9,8 +9,8 @@ from flask import request
from gn3.commands import queue_cmd
from gn3.commands import run_cmd
-from gn3.file_utils import cache_ipfs_file
-from gn3.file_utils import jsonfile_to_dict
+from gn3.fs_helpers import cache_ipfs_file
+from gn3.fs_helpers import jsonfile_to_dict
from gn3.computations.gemma import generate_gemma_cmd
from gn3.computations.gemma import do_paths_exist
diff --git a/gn3/api/general.py b/gn3/api/general.py
index 38e6154..cebb2e3 100644
--- a/gn3/api/general.py
+++ b/gn3/api/general.py
@@ -5,7 +5,8 @@ from flask import current_app
from flask import jsonify
from flask import request
-from gn3.file_utils import extract_uploaded_file
+from gn3.fs_helpers import extract_uploaded_file
+from gn3.commands import run_cmd
general = Blueprint("general", __name__)
@@ -50,3 +51,16 @@ TTL is set in the metadata file. If none is provided, the default is 1 week.
if results.get("status") > 0:
status = 500
return jsonify(results), status
+
+
+@general.route("/qtl/run/<geno_filestr>/<pheno_filestr>",
+ methods=["POST"],
+ strict_slashes=False)
+def run_r_qtl(geno_filestr, pheno_filestr):
+ """Run r_qtl command using the written rqtl_wrapper program
+
+ """
+ rqtl_wrapper = current_app.config["RQTL_WRAPPER"]
+ cmd = (f"Rscript {rqtl_wrapper} "
+ f"{geno_filestr} {pheno_filestr}")
+ return jsonify(run_cmd(cmd)), 201