From 7316e4a3bacaa1c4984fb2068fac1de9f839edf4 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 2 Jul 2025 13:31:25 -0500 Subject: Compute the means while doing the cross-refences. --- scripts/load_phenotypes_to_db.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts') diff --git a/scripts/load_phenotypes_to_db.py b/scripts/load_phenotypes_to_db.py index 08ee558..9c636b9 100644 --- a/scripts/load_phenotypes_to_db.py +++ b/scripts/load_phenotypes_to_db.py @@ -226,6 +226,12 @@ def cross_reference_phenotypes_publications_and_data( "%(publication_id)s, %(data_id)s, 'Upload of new data.'" ")"), _params) + cursor.executemany( + "UPDATE PublishXRef SET mean=" + "(SELECT AVG(value) FROM PublishData WHERE PublishData.Id=PublishXRef.DataId) " + "WHERE PublishXRef.Id=%(xref_id)s AND " + "InbredSetId=%(population_id)s", + _params) return _params return tuple() -- cgit v1.2.3