From 11d543eeca08fe0df4bf2be7222234fadb516a51 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 27 Sep 2024 14:31:50 -0500 Subject: 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. --- gn3/api/rqtl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gn3/api/rqtl.py') 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 ) -- cgit v1.2.3