diff --git a/gn3/api/rqtl.py b/gn3/api/rqtl.py
index eb49f8b..0fe971b 100644
--- a/gn3/api/rqtl.py
+++ b/gn3/api/rqtl.py
@@ -2,6 +2,7 @@
import os
import uuid
+import logging
from pathlib import Path
from flask import Blueprint
@@ -19,6 +20,7 @@ from gn3.computations.streaming import run_process, enable_streaming
from gn3.fs_helpers import assert_path_exists, get_tmpdir
rqtl = Blueprint("rqtl", __name__)
+logger = logging.getLogger(__name__)
@rqtl.route("/compute", methods=["POST"])
@@ -54,6 +56,7 @@ def compute(stream_output_file):
if not os.path.isdir(outdir):
os.mkdir(outdir)
+ logger.info("Generating the R/qtl command")
rqtl_cmd = generate_rqtl_cmd(
rqtl_wrapper_cmd=str(
Path(__file__)
@@ -63,6 +66,7 @@ def compute(stream_output_file):
rqtl_wrapper_kwargs=rqtl_kwargs,
rqtl_wrapper_bool_kwargs=rqtl_bool_kwargs,
)
+ logger.info("Generated R/qtl command: %s", rqtl_cmd)
rqtl_output = {}
run_id = request.args.get("id", str(uuid.uuid4()))
@@ -72,13 +76,18 @@ def compute(stream_output_file):
)
):
pass
- run_process(rqtl_cmd.get("rqtl_cmd").split(), stream_output_file, run_id)
+ logger.info("Running R/qtl command")
+ _status = run_process(
+ rqtl_cmd.get("rqtl_cmd").split(), stream_output_file, run_id)
+ logger.info("R/qtl command finished with: %s", _status)
if "pairscan" in rqtl_bool_kwargs:
+ logger.info("R/qtl: processing pairscan")
rqtl_output["results"] = process_rqtl_pairscan(
rqtl_cmd.get("output_file"), genofile
)
else:
+ logger.info("R/qtl: processing mapping")
rqtl_output["results"] = process_rqtl_mapping(rqtl_cmd.get("output_file"))
if int(rqtl_kwargs["nperm"]) > 0:
@@ -89,4 +98,6 @@ def compute(stream_output_file):
rqtl_output["suggestive"],
rqtl_output["significant"],
) = process_perm_output(perm_output_file)
+
+ logger.info("R/qtl compute completed.")
return jsonify(rqtl_output)
diff --git a/gn3/app.py b/gn3/app.py
index b0a1e5f..afe6781 100644
--- a/gn3/app.py
+++ b/gn3/app.py
@@ -85,6 +85,7 @@ def create_app(config: Union[Dict, str, None] = None) -> Flask:
verify_app_config(app)
setup_app_logging(app)
setup_modules_logging(loglevel(app), ("gn3.db.menu",
+ "gn3.api.rqtl",
"gn_libs.mysqldb"))
# DO NOT log anything before this point
logging.info("Guix Profile: '%s'.", os.environ.get("GUIX_PROFILE"))
|