From 3f879d120f7628646f383a457206b15037cc57dc Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 5 Feb 2024 15:18:44 +0300 Subject: Check that data in geno file is valid Add a function to ensure the values in the geno files are all listed in the control data under the "genotypes" key. --- r_qtl/r_qtl2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'r_qtl/r_qtl2.py') diff --git a/r_qtl/r_qtl2.py b/r_qtl/r_qtl2.py index f8c08d9..e74312f 100644 --- a/r_qtl/r_qtl2.py +++ b/r_qtl/r_qtl2.py @@ -10,7 +10,7 @@ import yaml from functional_tools import take, chain -from r_qtl.errors import InvalidFormat +from r_qtl.errors import InvalidFormat, MissingFileError __FILE_TYPES__ = ( "geno", "founder_geno", "pheno", "covar", "phenocovar", "gmap", "pmap", @@ -250,7 +250,7 @@ def file_data(zfile: ZipFile, zfile, member_key, cdata, process_transposed_value): yield row except KeyError as exc: - raise InvalidFormat(*exc.args) from exc + raise MissingFileError(*exc.args) from exc def cross_information(zfile: ZipFile, cdata: dict) -> Iterator[dict]: """Load cross information where present.""" -- cgit v1.2.3