From 65783e9b27fe58f980fbe8497f1992d7901983d4 Mon Sep 17 00:00:00 2001 From: Alexander_Kabui Date: Thu, 23 Jan 2025 14:00:33 +0300 Subject: feat: Add function to write input data to a json file. --- gn3/computations/rqtl2.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/gn3/computations/rqtl2.py b/gn3/computations/rqtl2.py index 9377fd5..0380166 100644 --- a/gn3/computations/rqtl2.py +++ b/gn3/computations/rqtl2.py @@ -92,4 +92,15 @@ def prepare_files(tmpdir): return workspace_dir, input_file, output_file, log_file +def write_input_file(input_file, workspace_dir, data): + """ + Write input data to a json file to be passed + as input to the rqtl2 script + """ + with open(input_file,"w+", encoding="UTF-8") as file_handler: + # todo choose a better variable name + rqtl2_files = generate_rqtl2_files(data, workspace_dir) + json.dump(rqtl2_files, file_handler) + + -- cgit 1.4.1