aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2025-05-19 11:12:13 -0500
committerFrederick Muriuki Muriithi2025-05-19 11:12:13 -0500
commitaa486e50b5d10592123daf557b1c10825d0cb94b (patch)
tree3f873d18c686fdff06aa129ff8d28679bd232d93
parentece7a615b2c13dedc1c3cdca06f92f714023a5b4 (diff)
downloadgn-uploader-aa486e50b5d10592123daf557b1c10825d0cb94b.tar.gz
Use correct files for basic phenotypes data. Add notes to self.
The basic phenotype data will be in files under the key "gn-metadata" -> "pheno". We support the possibility of having some descriptions in the "phenocovar" files, since that can happen also.
-rw-r--r--scripts/load_phenotypes_to_db.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py
index d31ade6..533b0e3 100644
--- a/scripts/load_phenotypes_to_db.py
+++ b/scripts/load_phenotypes_to_db.py
@@ -49,21 +49,27 @@ def save_phenotypes(
"""Read `phenofiles` and save the phenotypes therein."""
logger.info("Saving new phenotypes.")
logger.debug("Processing %s 'pheno' files.", len(phenofiles))
- phenofiles = control_data["pheno"]
+ ## TODO: Replace with something like this: ##
+ # phenofiles = control_data["phenocovar"] + control_data.get(
+ # "gn-metadata", {}).get("pheno", [])
+ #
+ # This is meant to load (and merge) data from the "phenocovar" and
+ # "gn-metadata -> pheno" files into a single collection of phenotypes.
+ phenofiles = control_data["phenocovar"]
if len(phenofiles) <= 0:
return tuple()
- if control_data["pheno_transposed"]:
+ if control_data["phenocovar_transposed"]:
logger.info("Undoing transposition of the files rows and columns.")
phenofiles = (
transpose_csv_with_rename(
_file
build_line_splitter(control_data)
build_line_joiner(control_data))
- for _file in control_data["pheno"])
+ for _file in control_data["phenocovar"])
- _headers = rqtl2.read_csv_file_headers(control_data["pheno"][0],
- control_data["pheno_transposed"],
+ _headers = rqtl2.read_csv_file_headers(control_data["phenocovar"][0],
+ control_data["phenocovar_transposed"],
control_data["sep"],
control_data["comment.char"])
return create_new_phenotypes(