diff options
author | Frederick Muriuki Muriithi | 2023-07-19 09:52:30 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-07-19 09:52:30 +0300 |
commit | 88006dd282fc2945cd9cd510ef336e9c077cc8ce (patch) | |
tree | e0b59c72b3ba01b4a7a21a7b7c53fe2d14119c1b | |
parent | 8b441bbbd1e073b7b2e471fda0c6f1b2a4255882 (diff) | |
download | genenetwork2-88006dd282fc2945cd9cd510ef336e9c077cc8ce.tar.gz |
Replace ORM code with direct queries for ProbeSets
-rw-r--r-- | wqflask/wqflask/metadata_edits.py | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/wqflask/wqflask/metadata_edits.py b/wqflask/wqflask/metadata_edits.py index f6e74d68..47e2ae28 100644 --- a/wqflask/wqflask/metadata_edits.py +++ b/wqflask/wqflask/metadata_edits.py @@ -49,11 +49,10 @@ from gn3.db import update from gn3.db.datasets import retrieve_sample_list, retrieve_phenotype_group_name from gn3.db.metadata_audit import MetadataAudit from gn3.db.phenotypes import Phenotype -from gn3.db.phenotypes import Probeset +from gn3.db.probesets import Probeset, probeset_mapping, fetch_probeset_metadata_by_name from gn3.db.phenotypes import Publication from gn3.db.phenotypes import PublishXRef from gn3.db.phenotypes import fetch_trait, fetch_metadata, fetch_publication -from gn3.db.phenotypes import probeset_mapping from gn3.db.sample_data import delete_sample_data from gn3.db.sample_data import get_trait_sample_data, get_trait_csv_sample_data from gn3.db.sample_data import insert_sample_data @@ -101,18 +100,6 @@ def edit_phenotype(conn, name, dataset_id): } -def edit_probeset(conn, name): - probeset_ = fetchone( - conn=conn, - table="ProbeSet", - columns=list(probeset_mapping.values()), - where=Probeset(name=name), - ) - return { - "probeset": probeset_, - } - - @metadata_edit.route("/<dataset_id>/traits/<name>") @required_access( ("group:resource:view-resource", "group:resource:edit-resource")) @@ -146,7 +133,7 @@ def display_phenotype_metadata(dataset_id: str, name: str): def display_probeset_metadata(name: str): from utility.tools import get_setting with database_connection(get_setting("SQL_URI")) as conn: - _d = edit_probeset(conn=conn, name=name) + _d = {"probeset": fetch_probeset_metadata_by_name(conn, name)} return render_template( "edit_probeset.html", diff=_d.get("diff"), |