diff options
Diffstat (limited to 'qc_app/db/datasets.py')
-rw-r--r-- | qc_app/db/datasets.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qc_app/db/datasets.py b/qc_app/db/datasets.py index 3a27706..8122cfa 100644 --- a/qc_app/db/datasets.py +++ b/qc_app/db/datasets.py @@ -14,3 +14,10 @@ def geno_dataset_by_species_and_population( "WHERE iset.SpeciesId=%(sid)s AND iset.InbredSetId=%(pid)s", {"sid": speciesid, "pid": populationid}) return tuple(dict(row) for row in cursor.fetchall()) + +def geno_dataset_by_id(conn: mdb.Connection, dataset_id: int) -> dict: + """Retrieve genotype dataset by ID""" + with conn.cursor(cursorclass=DictCursor) as cursor: + cursor.execute("SELECT * FROM GenoFreeze WHERE Id=%s", + (dataset_id,)) + return dict(cursor.fetchone()) |