diff options
author | Frederick Muriuki Muriithi | 2024-02-05 15:42:16 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-05 15:43:26 +0300 |
commit | 364dc6598e11151fd0b146814b2aaac272eec8d7 (patch) | |
tree | 629820fa7b0f49e7b53675632a4a12afbb890c1e | |
parent | 3f879d120f7628646f383a457206b15037cc57dc (diff) | |
download | gn-uploader-364dc6598e11151fd0b146814b2aaac272eec8d7.tar.gz |
Run QC on the 'geno' file in R/qtl2 bundle.
-rw-r--r-- | qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html | 2 | ||||
-rw-r--r-- | scripts/process_rqtl2_bundle.py | 17 |
2 files changed, 17 insertions, 2 deletions
diff --git a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html index 01721e9..8082abb 100644 --- a/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html +++ b/qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html @@ -27,8 +27,6 @@ <input type="hidden" name="rqtl2_bundle_file" value="{{rqtl2_bundle_file}}" /> - {{flash_messages("error-rqtl2")}} - <fieldset> <input type="submit" value="continue" class="btn btn-main form-col-2" /> </fieldset> diff --git a/scripts/process_rqtl2_bundle.py b/scripts/process_rqtl2_bundle.py index 6ba746a..4da3936 100644 --- a/scripts/process_rqtl2_bundle.py +++ b/scripts/process_rqtl2_bundle.py @@ -11,6 +11,10 @@ from logging import Logger, getLogger, StreamHandler import MySQLdb as mdb from redis import Redis +from functional_tools import take + +import r_qtl.errors as rqe +import r_qtl.r_qtl2 as rqtl2 import r_qtl.r_qtl2_qc as rqc from qc_app import jobs @@ -60,6 +64,19 @@ def qc_r_qtl2_bundle(bundlefilepath, logger): logger.info( "Bundle successfully validated. All listed files are present.") + cdata = rqtl2.control_data(zfile) + if "geno" in cdata: + gerr = False + logger.info("Validating 'geno' file.") + for error in take(rqc.geno_errors(zfile), 10): + gerr = True + logger.error("%s: [Line %s, Field %s]", + error[2], error[0], error[1]) + if gerr: + logger.error("... more") + raise rqe.InvalidFormat("'geno' file content contains errors.") + logger.info("'geno' file validation was successful.") + def process_bundle(dbconn: mdb.Connection, rconn: Redis, rprefix: str, |