From 523bd6634539a2e646a7cd4215ad3ee7dbbeeb66 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 12 Feb 2024 10:14:27 +0300 Subject: Check for errors in the 'pheno' file. --- scripts/qc_on_rqtl2_bundle.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'scripts') 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: -- cgit v1.2.3