diff options
author | Frederick Muriuki Muriithi | 2024-09-27 14:31:50 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-09-27 14:31:50 -0500 |
commit | 11d543eeca08fe0df4bf2be7222234fadb516a51 (patch) | |
tree | 571fe0240c9f71689fc9af33761b202dbcfc9b07 /gn3/api | |
parent | f20a1a9f9f5c052f756b917fdce052efc8203f87 (diff) | |
download | genenetwork3-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.py | 5 |
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 ) |