diff options
author | zsloan | 2021-05-17 21:56:51 +0000 |
---|---|---|
committer | zsloan | 2021-05-17 21:56:51 +0000 |
commit | 624ece086d026da9150cd35b2404874ccf607b07 (patch) | |
tree | 50891acf4f2ad6f04fea057d696142880d99c098 /gn3/computations | |
parent | 7ed84670c0d13de38b578a4e4177b2529ff3fb40 (diff) | |
download | genenetwork3-624ece086d026da9150cd35b2404874ccf607b07.tar.gz |
Created compose_rqtl_command and generate_rqtl_command to create the actual command to be run from the command line; used the same pattern as for GEMMA for consistency
Diffstat (limited to 'gn3/computations')
-rw-r--r-- | gn3/computations/rqtl.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gn3/computations/rqtl.py b/gn3/computations/rqtl.py new file mode 100644 index 0000000..087a99f --- /dev/null +++ b/gn3/computations/rqtl.py @@ -0,0 +1,25 @@ +"""Procedures related rqtl computations"""
+import os
+
+from typing import Dict
+from gn3.commands import compose_rqtl_cmd
+from gn3.fs_helpers import get_hash_of_files
+
+def generate_rqtl_cmd(rqtl_wrapper_cmd: str,
+ output_dir: str,
+ rqtl_wrapper_kwargs: Dict) -> Dict:
+
+ _hash = get_hash_of_files(
+ [v for k, v in rqtl_wrapper_kwargs.items() if k in ["g", "p", "addcovar",
+ "model", "method",
+ "interval", "nperm",
+ "scale", "control"]])
+
+ _output_filename = f"{_hash}-output.json"
+ return {
+ "output_file":
+ _output_filename,
+ "rqtl_cmd":
+ compose_rqtl_cmd(rqtl_wrapper_cmd=rqtl_wrapper_cmd,
+ rqtl_wrapper_kwargs=rqtl_wrapper_kwargs)
+ }
\ No newline at end of file |