diff options
author | zsloan | 2024-02-19 02:23:29 +0000 |
---|---|---|
committer | zsloan | 2024-02-19 02:23:29 +0000 |
commit | 039c1dee9add8f784911a84c7a5f16915166ba93 (patch) | |
tree | 3e47ef1293b53587212e2f038a7822e3f579210c | |
parent | 1a14fe968149908ecedb71500314f666985dfa27 (diff) | |
download | genenetwork3-039c1dee9add8f784911a84c7a5f16915166ba93.tar.gz |
Pass qtlreaper command path as argument to run_reaper
Originally the system would get the path from the environment
-rw-r--r-- | gn3/computations/qtlreaper.py | 5 | ||||
-rw-r--r-- | gn3/heatmaps.py | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/gn3/computations/qtlreaper.py b/gn3/computations/qtlreaper.py index 981a9c8..8c970f2 100644 --- a/gn3/computations/qtlreaper.py +++ b/gn3/computations/qtlreaper.py @@ -7,7 +7,7 @@ import subprocess from typing import Union from gn3.chancy import random_string -from gn3.settings import TMPDIR, REAPER_COMMAND +from gn3.settings import TMPDIR def generate_traits_file(samples, trait_values, traits_filename): """ @@ -39,6 +39,7 @@ def create_output_directory(path: str): pass def run_reaper( + reaper_cmd: str, genotype_filename: str, traits_filename: str, other_options: tuple = ("--n_permutations", "1000"), separate_nperm_output: bool = False, @@ -81,7 +82,7 @@ def run_reaper( permu_output_filename = None command_list = [ - REAPER_COMMAND, "--geno", genotype_filename, + reaper_cmd, "--geno", genotype_filename, *other_options, # this splices the `other_options` list here "--traits", traits_filename, *output_list # this splices the `output_list` list here diff --git a/gn3/heatmaps.py b/gn3/heatmaps.py index 79c4082..1a528ba 100644 --- a/gn3/heatmaps.py +++ b/gn3/heatmaps.py @@ -6,6 +6,8 @@ from pathlib import Path from functools import reduce from typing import Any, Dict, Union, Sequence +from flask import current_app as app + import numpy as np import plotly.graph_objects as go # type: ignore import plotly.figure_factory as ff # type: ignore @@ -140,7 +142,7 @@ def build_heatmap( traits_filename) main_output, _permutations_output = run_reaper( - genotype_filename, traits_filename, separate_nperm_output=True) + app.config['REAPER_COMMAND'], genotype_filename, traits_filename, separate_nperm_output=True) qtlresults = parse_reaper_main_results(main_output) organised = organise_reaper_main_results(qtlresults) |