about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/r_qtl/test_files/test_founder_geno.zipbin0 -> 672 bytes
-rw-r--r--tests/r_qtl/test_files/test_founder_geno_transposed.zipbin0 -> 725 bytes
-rw-r--r--tests/r_qtl/test_r_qtl2_geno.py87
3 files changed, 80 insertions, 7 deletions
diff --git a/tests/r_qtl/test_files/test_founder_geno.zip b/tests/r_qtl/test_files/test_founder_geno.zip
new file mode 100644
index 0000000..f77626b
--- /dev/null
+++ b/tests/r_qtl/test_files/test_founder_geno.zip
Binary files differdiff --git a/tests/r_qtl/test_files/test_founder_geno_transposed.zip b/tests/r_qtl/test_files/test_founder_geno_transposed.zip
new file mode 100644
index 0000000..6cc8151
--- /dev/null
+++ b/tests/r_qtl/test_files/test_founder_geno_transposed.zip
Binary files differdiff --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