From bf1c2ec1b16b50f419a349a54031baf85fcd4abd Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 17 Jan 2024 05:38:29 +0300 Subject: UI: Initialise summary page. --- qc_app/upload/rqtl2.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'qc_app/upload') diff --git a/qc_app/upload/rqtl2.py b/qc_app/upload/rqtl2.py index 7db005c..9bed4f1 100644 --- a/qc_app/upload/rqtl2.py +++ b/qc_app/upload/rqtl2.py @@ -23,8 +23,9 @@ from qc_app.db import ( species_by_id, save_population, populations_by_species, - population_by_species_and_id, - geno_dataset_by_species_and_population) + population_by_species_and_id,) +from qc_app.db.datasets import ( + geno_dataset_by_id, geno_dataset_by_species_and_population) rqtl2 = Blueprint("rqtl2", __name__) @@ -214,20 +215,27 @@ def select_dataset_info(species_id: int, population_id: int): if bool(error_page): return error_page + species = species_by_id(conn, species_id) + population = population_by_species_and_id( + conn, species_id, population_id) thefile = fullpath(form["rqtl2_bundle_file"]) with ZipFile(str(thefile), "r") as zfile: cdata = r_qtl2.control_data(zfile) if "geno" in cdata and not bool(form.get("geno-dataset-id")): return render_template( "rqtl2/select-geno-dataset.html", - species=species_by_id(conn, species_id), - population=population_by_species_and_id( - conn, species_id, population_id), + species=species, + population=population, rqtl2_bundle_file=thefile.name, datasets=geno_dataset_by_species_and_population( conn, species_id, population_id)) - return "All data points collected. Should proceed to launching the job." + geno_dataset = geno_dataset_by_id(conn, form["geno-dataset-id"]) + + return render_template("rqtl2/summary-info.html", + species=species, + population=population, + geno_dataset=geno_dataset) @rqtl2.route(("/upload/species//population/" "/rqtl2-bundle/select-geno-dataset"), -- cgit v1.2.3