aboutsummaryrefslogtreecommitdiff
path: root/tests/r_qtl/test_r_qtl2_geno.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/r_qtl/test_r_qtl2_geno.py')
-rw-r--r--tests/r_qtl/test_r_qtl2_geno.py87
1 files changed, 80 insertions, 7 deletions
diff --git a/tests/r_qtl/test_r_qtl2_geno.py b/tests/r_qtl/test_r_qtl2_geno.py
index d323c4b..787d13a 100644
--- a/tests/r_qtl/test_r_qtl2_geno.py
+++ b/tests/r_qtl/test_r_qtl2_geno.py
@@ -177,11 +177,80 @@ def test_parse_geno_files(relpath, expected):
@pytest.mark.unit_test
@pytest.mark.parametrize(
"relpath,expected",
- (
- ("tests/r_qtl/test_files/test_founder_geno.zip",
- ()),
- ("tests/r_qtl/test_files/test_founder_geno_transposed.zip",
- ())))
+ (("tests/r_qtl/test_files/test_founder_geno.zip",
+ (({
+ "id": "1",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "2",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "3",
+ "PVV4": 2,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": None,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "4",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "5",
+ "PVV4": None,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 2,
+ "EC.66C": 2
+ }))),
+ ("tests/r_qtl/test_files/test_founder_geno_transposed.zip",
+ (({
+ "id": "1",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "2",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "3",
+ "PVV4": 2,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": None,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "4",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "5",
+ "PVV4": None,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 2,
+ "EC.66C": 2
+ })))))
def test_parse_founder_geno_files(relpath, expected):
"""Test parsing of founder_geno files from the R/qtl2 bundle.
@@ -190,5 +259,9 @@ def test_parse_founder_geno_files(relpath, expected):
THEN: ensure that the data we get is as expected
"""
with ZipFile(Path(relpath).absolute(), "r") as zfile:
- assert tuple(rqtl2.founder_genotype_data(
- zfile, rqtl2.control_data(zfile))) == expected
+ cdata = rqtl2.control_data(zfile)
+ assert tuple(rqtl2.file_data(
+ zfile,
+ "founder_geno",
+ cdata,
+ *rqtl2.make_process_data_geno(cdata))) == expected