From b3b85a6241bacecae3997ec063dde007143289f0 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Tue, 3 Dec 2024 14:20:30 -0600 Subject: Add some phenocovar metadata. --- scripts/rqtl2/phenotypes_qc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'scripts') diff --git a/scripts/rqtl2/phenotypes_qc.py b/scripts/rqtl2/phenotypes_qc.py index 26c049b..bfbfab6 100644 --- a/scripts/rqtl2/phenotypes_qc.py +++ b/scripts/rqtl2/phenotypes_qc.py @@ -209,11 +209,11 @@ def qc_phenocovar_file( return _errs, _lc+1 - return { - filepath.name: dict(zip( - ("errors", "linecount"), - reduce(collect_errors, _csvfile, (_errors, 1)))) - } + _errors, _linecount = reduce(collect_errors, _csvfile, (_errors, 1)) + rconn.hset( + f"{fqkey}:metadata", + mapping={"linecount": _linecount, "total-errors": len(_errors)}) + return {filepath.name: {"errors": _errors, "linecount": _linecount}} def merge_dicts(*dicts): -- cgit v1.2.3