diff options
-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"]) |