From 6c872943597f3664cca77abbdf56f074fc5231e6 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Tue, 31 Aug 2021 06:56:35 +0300 Subject: Fix bugs with `run_reaper` function Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * gn3/computations/qtlreaper.py: Fix some bugs * qtlfilesexport.py: Test out running rust-qtlreaper Test out the qtlreaper interface code and fix some bugs caught in the process. --- gn3/computations/qtlreaper.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'gn3/computations/qtlreaper.py') diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py index 9b13a55..c058e14 100644 --- a/gn3/computations/qtlreaper.py +++ b/gn3/computations/qtlreaper.py @@ -42,7 +42,7 @@ def create_output_directory(path: str): def run_reaper( genotype_filename: str, traits_filename: str, - other_options: tuple = ("--n_permutations", 1000), + other_options: tuple = ("--n_permutations", "1000"), separate_nperm_output: bool = False, output_dir: str = TMPDIR): """ @@ -70,7 +70,7 @@ def run_reaper( The function will raise a `subprocess.CalledProcessError` exception in case of any errors running the `qtlreaper` command. """ - create_output_directory(output_dir) + create_output_directory("{}/qtlreaper".format(output_dir)) output_filename = "{}/qtlreaper/main_output_{}.txt".format( output_dir, random_string(10)) output_list = ["--main_output", output_filename] @@ -84,7 +84,9 @@ def run_reaper( command_list = [ REAPER_COMMAND, "--geno", genotype_filename, *other_options, # this splices the `other_options` list here - "--traits", traits_filename, "--main_output", output_filename] + "--traits", traits_filename, + *output_list # this splices the `output_list` list here + ] subprocess.run(command_list, check=True) return (output_filename, permu_output_filename) -- cgit v1.2.3