aboutsummaryrefslogtreecommitdiff
path: root/gn3/db/traits.py
diff options
context:
space:
mode:
authorMuriithi Frederick Muriuki2021-08-09 11:46:26 +0300
committerMuriithi Frederick Muriuki2021-08-09 11:46:26 +0300
commit9ed71447892922c0039dd749a9052be502f1b818 (patch)
treee44265a79e5464df9ae44d465c12053d16ff3408 /gn3/db/traits.py
parent667e67bae832ca5083f3319ada4fda67aca41f44 (diff)
downloadgenenetwork3-9ed71447892922c0039dd749a9052be502f1b818.tar.gz
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.
Diffstat (limited to 'gn3/db/traits.py')
-rw-r--r--gn3/db/traits.py16
1 files changed, 13 insertions, 3 deletions
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)