diff options
author | BonfaceKilz | 2021-04-27 11:58:54 +0300 |
---|---|---|
committer | BonfaceKilz | 2021-05-08 19:19:47 +0300 |
commit | 5217a366e7904142fc443594facb126d28cd2b25 (patch) | |
tree | 095513342ee3d17564e5a30c3fecd0c30d6b401f /gn3/db | |
parent | 46cee438cedc5d855676958d97bf67d127d5e3e3 (diff) | |
download | genenetwork3-5217a366e7904142fc443594facb126d28cd2b25.tar.gz |
db: traits: Add extra method for looking up webqtl datasets
Diffstat (limited to 'gn3/db')
-rw-r--r-- | gn3/db/traits.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gn3/db/traits.py b/gn3/db/traits.py index 3134d31..0cebe2c 100644 --- a/gn3/db/traits.py +++ b/gn3/db/traits.py @@ -34,6 +34,19 @@ class webqtlCaseData: return _str +def lookup_webqtldataset_name(riset_name: str, conn: Any): + """Given a group name(riset), return it's name e.g. BXDPublish, +HLCPublish.""" + with conn.cursor() as cursor: + cursor.execute( + "SELECT PublishFreeze.Name FROM " + "PublishFreeze, InbredSet WHERE " + "PublishFreeze.InbredSetId = InbredSet.Id " + "AND InbredSet.Name = '%s'" % riset_name) + _result, *_ = cursor.fetchone() + return _result + + def get_riset(data_type: str, name: str, conn: Any): query, _name, _id = None, None, None if data_type == "Publish": |