diff options
Diffstat (limited to 'gn3')
-rw-r--r-- | gn3/commands.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gn3/commands.py b/gn3/commands.py index 0a74b7d..0b8db5b 100644 --- a/gn3/commands.py +++ b/gn3/commands.py @@ -67,9 +67,17 @@ def compose_pcorrs_command( primary_trait: str, control_traits: Tuple[str, ...], method: str, **kwargs): """Compose the command to run partias correlations""" + def __parse_method__(method): + mthd = method.lower().replace("'", "") + if "pearsons" in mthd: + return "pearsons" + if "spearmans" in mthd: + return "spearmans" + raise Exception(f"Invalid method '{method}'") + prefix_cmd = ( f"{sys.executable}", "-m", "scripts.partial_correlations", - primary_trait, ",".join(control_traits), method) + primary_trait, ",".join(control_traits), __parse_method__(method)) if ( kwargs.get("target_database") is not None and kwargs.get("target_traits") is None): |