diff options
author | Frederick Muriuki Muriithi | 2024-02-12 10:14:27 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2024-02-12 18:17:41 +0300 |
commit | 523bd6634539a2e646a7cd4215ad3ee7dbbeeb66 (patch) | |
tree | 5396f7c20cb038b62885293365d76e2893f30deb | |
parent | 22ef0cad3cfe4a0464b00624835372f2734ec154 (diff) | |
download | gn-uploader-523bd6634539a2e646a7cd4215ad3ee7dbbeeb66.tar.gz |
Check for errors in the 'pheno' file.
-rw-r--r-- | qc_app/templates/rqtl2/rqtl2-qc-job-error.html | 2 | ||||
-rw-r--r-- | scripts/qc_on_rqtl2_bundle.py | 15 |
2 files changed, 14 insertions, 3 deletions
diff --git a/qc_app/templates/rqtl2/rqtl2-qc-job-error.html b/qc_app/templates/rqtl2/rqtl2-qc-job-error.html index e809e7c..1650a79 100644 --- a/qc_app/templates/rqtl2/rqtl2-qc-job-error.html +++ b/qc_app/templates/rqtl2/rqtl2-qc-job-error.html @@ -87,7 +87,7 @@ <div class="explainer"> We found the following errors in the 'pheno' file in your R/qtl2 bundle: </div> -{{errorspheno}} +{{errors_table("tbl-errors-pheno", errorspheno[0:50])}} {%endif%} {%if errorsphenocovar | length > 0%} diff --git a/scripts/qc_on_rqtl2_bundle.py b/scripts/qc_on_rqtl2_bundle.py index 02c8c3a..aea1baa 100644 --- a/scripts/qc_on_rqtl2_bundle.py +++ b/scripts/qc_on_rqtl2_bundle.py @@ -58,7 +58,7 @@ def qc_missing_files(rconn: Redis, def qc_geno_errors(rconn, fqjobid, zfile, logger) -> bool: """Check for errors in `geno` file(s).""" - logger.info("Checking for geno errors…") + logger.info("Checking for errors in the 'geno' file…") gerrs = tuple(rqc.geno_errors(zfile)) add_to_errors(rconn, fqjobid, "errors-generic", tuple( err for err in gerrs if isinstance(err, rqfe.MissingFile))) @@ -67,10 +67,21 @@ def qc_geno_errors(rconn, fqjobid, zfile, logger) -> bool: if len(gerrs) > 0: logger.error("The 'geno' file has errors.") return True + logger.info("No errors found in the 'geno' file.") return False -def qc_pheno_errors(_rconn, _fqjobid, _zfile, _logger) -> bool: +def qc_pheno_errors(rconn, fqjobid, zfile, logger) -> bool: """Check for errors in `pheno` file(s).""" + logger.info("Checking for errors in the 'pheno' file …") + perrs = tuple(rqc.pheno_errors(zfile)) + add_to_errors(rconn, fqjobid, "errors-generic", tuple( + err for err in perrs if isinstance(err, rqfe.MissingFile))) + add_to_errors(rconn, fqjobid, "errors-pheno", tuple( + err for err in perrs if not isinstance(err, rqfe.MissingFile))) + if len(perrs) > 0: + logger.error("The 'pheno' file has errors.") + return True + logger.info("No errors found in the 'pheno' file.") return False def qc_phenocovar_errors(_rconn, _fqjobid, _zfile, _logger) -> bool: |