aboutsummaryrefslogtreecommitdiff
path: root/r_qtl/r_qtl2.py
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2024-02-05 07:00:01 +0300
committerFrederick Muriuki Muriithi2024-02-05 07:00:01 +0300
commitab71b34b97f3f1eee52b5688f41644541535f281 (patch)
tree4ae94d1957a62bd739203eddc4c157d2701461e4 /r_qtl/r_qtl2.py
parent635cf832f4717da6e8e7ef273a675a4ceea42ed0 (diff)
downloadgn-uploader-ab71b34b97f3f1eee52b5688f41644541535f281.tar.gz
Do general bundle validation and show errors
* Display any and all errors on the UI * Move `validate_bundle` to QC module and refactor to use `missing_files`
Diffstat (limited to 'r_qtl/r_qtl2.py')
-rw-r--r--r_qtl/r_qtl2.py22
1 files changed, 0 insertions, 22 deletions
diff --git a/r_qtl/r_qtl2.py b/r_qtl/r_qtl2.py
index c2828d2..f8c08d9 100644
--- a/r_qtl/r_qtl2.py
+++ b/r_qtl/r_qtl2.py
@@ -288,28 +288,6 @@ def sex_information(zfile: ZipFile, cdata: dict) -> Iterator[dict]:
key: chain(value, partial(replace_sex_info, cdata=cdata))
for key, value in row.items() if key not in ci_fields}
-def validate_bundle(zfile: ZipFile):
- """Ensure the R/qtl2 bundle is valid."""
- cdata = control_data(zfile)
- def __member_exists_p__(zfile, member):
- if isinstance(member, str):
- zfile.getinfo(member)
- else:
- for inner in member:
- zfile.getinfo(inner)
-
- try:
- for member in (key for key in cdata.keys() if key in __FILE_TYPES__):
- __member_exists_p__(zfile, cdata[member])
-
- if "file" in cdata.get("sex", {}):
- __member_exists_p__(zfile, cdata["sex"]["file"])
-
- if "file" in cdata.get("cross_info", {}):
- __member_exists_p__(zfile, cdata["cross_info"]["file"])
- except KeyError as kerr:
- raise InvalidFormat(*kerr.args) from kerr
-
def genotype_data(zfile: ZipFile):
"""Convenience function to genotype data from R/qtl2 bundle."""
cdata = control_data(zfile)