aboutsummaryrefslogtreecommitdiff
path: root/uploader/expression_data/dbinsert.py
diff options
context:
space:
mode:
Diffstat (limited to 'uploader/expression_data/dbinsert.py')
-rw-r--r--uploader/expression_data/dbinsert.py11
1 files changed, 2 insertions, 9 deletions
diff --git a/uploader/expression_data/dbinsert.py b/uploader/expression_data/dbinsert.py
index b30f730..e746944 100644
--- a/uploader/expression_data/dbinsert.py
+++ b/uploader/expression_data/dbinsert.py
@@ -15,6 +15,7 @@ from uploader import jobs
from uploader.authorisation import require_login
from uploader.population.models import populations_by_species
from uploader.species.models import all_species, species_by_id
+from uploader.platforms.models import platform_by_species_and_id
from uploader.db_utils import with_db_connection, database_connection
dbinsertbp = Blueprint("dbinsert", __name__)
@@ -48,14 +49,6 @@ def genechips():
return {}
-def platform_by_id(genechipid:int) -> Union[dict, None]:
- "Retrieve the gene platform by id"
- with database_connection(app.config["SQL_URI"]) as conn:
- with conn.cursor(cursorclass=DictCursor) as cursor:
- cursor.execute(
- "SELECT * FROM GeneChip WHERE GeneChipId=%s",
- (genechipid,))
- return cursor.fetchone()
def studies_by_species_and_platform(speciesid:int, genechipid:int) -> tuple:
"Retrieve the studies by the related species and gene platform"
@@ -347,7 +340,7 @@ def final_confirmation():
with_db_connection(lambda conn: species_by_id(conn, speciesid)),
("SpeciesName", "Name", "MenuName")),
platform=selected_keys(
- platform_by_id(genechipid),
+ platform_by_species_and_id(speciesid, genechipid),
("GeneChipName", "Name", "GeoPlatform", "Title", "GO_tree_value")),
study=selected_keys(
study_by_id(studyid), ("Name", "FullName", "ShortName")),