From 9ed71447892922c0039dd749a9052be502f1b818 Mon Sep 17 00:00:00 2001 From: Muriithi Frederick Muriuki Date: Mon, 9 Aug 2021 11:46:26 +0300 Subject: Add missing arguments. Fix typo. Issue: https://github.com/genenetwork/gn-gemtext-threads/blob/main/topics/gn1-migration-to-gn2/clustering.gmi * Fix minor bugs in the code. --- gn3/db/traits.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'gn3/db') diff --git a/gn3/db/traits.py b/gn3/db/traits.py index fb48fc3..be46437 100644 --- a/gn3/db/traits.py +++ b/gn3/db/traits.py @@ -263,7 +263,12 @@ def load_publish_qtl_info(trait_info, conn): "AND PublishXRef.InbredSetId = PublishFreeze.InbredSetId " "AND PublishFreeze.Id = %(dataset_id)s") with conn.cursor() as cursor: - cursor.execute() + cursor.execute( + query, + { + "trait_name": trait_info["trait_name"], + "dataset_id": trait_info["db"]["dataset_id"] + }) return dict(zip(["locus", "lrs", "additive"], cursor.fetchone())) return {"locus": "", "lrs": "", "additive": ""} @@ -279,7 +284,12 @@ def load_probeset_qtl_info(trait_info, conn): " AND ProbeSet.Name = %(trait_name)s " "AND ProbeSetXRef.ProbeSetFreezeId = %(dataset_id)s") with conn.cursor() as cursor: - cursor.execute() + cursor.execute( + query, + { + "trait_name": trait_info["trait_name"], + "dataset_id": trait_info["db"]["dataset_id"] + }) return dict(zip( ["locus", "lrs", "pvalue", "mean", "additive"], cursor.fetchone())) return {"locus": "", "lrs": "", "pvalue": "", "mean": "", "additive": ""} @@ -307,7 +317,7 @@ def load_qtl_info(qtl, trait_type, trait_info, conn): "Publish": load_publish_qtl_info, "ProbeSet": load_probeset_qtl_info } - if trait_inf["name"] not in qtl_info_functions.keys(): + if trait_info["name"] not in qtl_info_functions.keys(): return trait_info return qtl_info_functions[trait_type](trait_info, conn) -- cgit v1.2.3