aboutsummaryrefslogtreecommitdiff
path: root/gn3
diff options
context:
space:
mode:
Diffstat (limited to 'gn3')
-rw-r--r--gn3/computations/__init__.py0
-rw-r--r--gn3/computations/gemma.py14
2 files changed, 14 insertions, 0 deletions
diff --git a/gn3/computations/__init__.py b/gn3/computations/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/gn3/computations/__init__.py
diff --git a/gn3/computations/gemma.py b/gn3/computations/gemma.py
new file mode 100644
index 0000000..9a972ba
--- /dev/null
+++ b/gn3/computations/gemma.py
@@ -0,0 +1,14 @@
+"""Procedures related gemma computations"""
+
+
+def generate_pheno_txt_file(trait_filename: str,
+ values: str,
+ tmpdir: str = "/tmp") -> str:
+ """Given VALUES, and TMPDIR, generate a valide traits file"""
+ with open(f"{tmpdir}/gn2/{trait_filename}", "w") as _file:
+ for value in values:
+ if value == "x":
+ _file.write("NA\n")
+ else:
+ _file.write(f"{value}\n")
+ return f"{tmpdir}/gn2/{trait_filename}"