aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--qc_app/templates/rqtl2/upload-rqtl2-bundle-step-02.html2
-rw-r--r--scripts/process_rqtl2_bundle.py17
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,