diff options
author | Frederick Muriuki Muriithi | 2025-05-19 13:07:41 -0500 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2025-05-19 14:20:34 -0500 |
commit | e153eb4a0aeeff28cf838b63074ac53bc2164bb3 (patch) | |
tree | cf90ff01c22b905aabd22d89dc7a66444d75e457 | |
parent | 547bd24ec422dc33622d30c5b3562cde32e0e98f (diff) | |
download | gn-uploader-e153eb4a0aeeff28cf838b63074ac53bc2164bb3.tar.gz |
Retrieve samples' details from the database.
-rw-r--r-- | scripts/load_phenotypes_to_db.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py index 533b0e3..82324fc 100644 --- a/scripts/load_phenotypes_to_db.py +++ b/scripts/load_phenotypes_to_db.py @@ -11,6 +11,7 @@ from gn_libs import jobs, mysqldb, sqlite3 from r_qtl import r_qtl2 as rqtl2 from uploader.publications.models import create_new_publications +from uploader.samples.models import samples_by_species_and_population from scripts.rqtl2.bundleutils import build_line_joiner, build_line_splitter @@ -139,9 +140,10 @@ def load_data(conn, job): # TODO: Map the pheno ids to the publication ids } # 3. a. Fetch the strain names and IDS: create name->ID map - samples = samples_by_species_and_population( - # from uploader.samples.models import samples_by_species_and_population - conn, species["SpeciesId"], population["PopulationId"]) + samples = { + row["Name"]: row + for row in samples_by_species_and_population( + conn, species["SpeciesId"], population["PopulationId"])} # b. Save all the data items (DataIds are vibes), return new IDs data = save_phenotypes_data( cursor, dataidmap, samples, , _control_data["pheno"]) |