aboutsummaryrefslogtreecommitdiff
path: root/gn3/api
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-09-27 14:31:50 -0500
committerFrederick Muriuki Muriithi2024-09-27 14:31:50 -0500
commit11d543eeca08fe0df4bf2be7222234fadb516a51 (patch)
tree571fe0240c9f71689fc9af33761b202dbcfc9b07 /gn3/api
parentf20a1a9f9f5c052f756b917fdce052efc8203f87 (diff)
downloadgenenetwork3-11d543eeca08fe0df4bf2be7222234fadb516a51.tar.gz
Bug: Use absolute path in place of relative path
Prior to this commit, an assumption is made that the application is invoked with the root of the repository being the current working directory. If this assumption is not met, then the system will not find the appropriate path. This commit forces the use of an absolute path, which should help avoid issues with misplaced relative paths.
Diffstat (limited to 'gn3/api')
-rw-r--r--gn3/api/rqtl.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/gn3/api/rqtl.py b/gn3/api/rqtl.py
index c2d988a..e029d8d 100644
--- a/gn3/api/rqtl.py
+++ b/gn3/api/rqtl.py
@@ -1,5 +1,6 @@
"""Endpoints for running the rqtl cmd"""
import os
+from pathlib import Path
from flask import Blueprint
from flask import current_app
@@ -42,7 +43,9 @@ run the rqtl_wrapper script and return the results as JSON
os.mkdir(outdir)
rqtl_cmd = generate_rqtl_cmd(
- rqtl_wrapper_cmd='scripts/rqtl_wrapper.R',
+ rqtl_wrapper_cmd=str(
+ Path(__file__).absolute().parent.parent.parent.joinpath(
+ 'scripts/rqtl_wrapper.R')),
rqtl_wrapper_kwargs=rqtl_kwargs,
rqtl_wrapper_bool_kwargs=rqtl_bool_kwargs
)