aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorFrederick Muriuki Muriithi2023-12-28 13:19:50 +0300
committerFrederick Muriuki Muriithi2023-12-28 13:20:27 +0300
commit2162cec2084f712993180618eb92c5a6dfdc5963 (patch)
treec07f6b18d9cb5dcf31e8731adbde36a75b6553fa /tests
parentd4fff5fda2d9fe2b9730a7cffcc8f85b3a8eff17 (diff)
downloadgn-uploader-2162cec2084f712993180618eb92c5a6dfdc5963.tar.gz
Rework parsing of transposed geno files.
Diffstat (limited to 'tests')
-rw-r--r--tests/r_qtl/test_r_qtl2_geno.py125
1 files changed, 71 insertions, 54 deletions
diff --git a/tests/r_qtl/test_r_qtl2_geno.py b/tests/r_qtl/test_r_qtl2_geno.py
index 908ef55..7b660a6 100644
--- a/tests/r_qtl/test_r_qtl2_geno.py
+++ b/tests/r_qtl/test_r_qtl2_geno.py
@@ -92,60 +92,77 @@ from r_qtl import r_qtl2 as rqtl2
"EC.66C": 2
})),
("tests/r_qtl/test_files/test_geno_transposed.zip",
- ({"id": "1", "PVV4": 1},
- {"id": "2", "PVV4": 1},
- {"id": "3", "PVV4": 2},
- {"id": "4", "PVV4": 1},
- {"id": "5", "PVV4": 2},
- {"id": "6", "PVV4": 2},
- {"id": "7", "PVV4": 1},
- {"id": "8", "PVV4": 2},
- {"id": "9", "PVV4": None},
- {"id": "10", "PVV4": 2},
-
- {"id": "1", "AXR-1": 1},
- {"id": "2", "AXR-1": 1},
- {"id": "3", "AXR-1": 2},
- {"id": "4", "AXR-1": 1},
- {"id": "5", "AXR-1": 2},
- {"id": "6", "AXR-1": 2},
- {"id": "7", "AXR-1": 1},
- {"id": "8", "AXR-1": 2},
- {"id": "9", "AXR-1": 2},
- {"id": "10", "AXR-1": 2},
-
- {"id": "1", "HH.335C-Col/PhyA": 1},
- {"id": "2", "HH.335C-Col/PhyA": 1},
- {"id": "3", "HH.335C-Col/PhyA": None},
- {"id": "4", "HH.335C-Col/PhyA": 1},
- {"id": "5", "HH.335C-Col/PhyA": 2},
- {"id": "6", "HH.335C-Col/PhyA": 2},
- {"id": "7", "HH.335C-Col/PhyA": 1},
- {"id": "8", "HH.335C-Col/PhyA": 2},
- {"id": "9", "HH.335C-Col/PhyA": 2},
- {"id": "10", "HH.335C-Col/PhyA": 2},
-
- {"id": "1", "EC.480C": 1},
- {"id": "2", "EC.480C": 1},
- {"id": "3", "EC.480C": 1},
- {"id": "4", "EC.480C": 1},
- {"id": "5", "EC.480C": 2},
- {"id": "6", "EC.480C": 2},
- {"id": "7", "EC.480C": 1},
- {"id": "8", "EC.480C": 1},
- {"id": "9", "EC.480C": 2},
- {"id": "10", "EC.480C": 2},
-
- {"id": "1","EC.66C": 1},
- {"id": "2", "EC.66C": 1},
- {"id": "3", "EC.66C": 1},
- {"id": "4", "EC.66C": 1},
- {"id": "5", "EC.66C": 2},
- {"id": "6", "EC.66C": 2},
- {"id": "7", "EC.66C": 1},
- {"id": "8", "EC.66C": 1},
- {"id": "9", "EC.66C": 2},
- {"id": "10", "EC.66C": 2}))))
+ ({
+ "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": 2,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 2,
+ "EC.66C": 2
+ }, {
+ "id": "6",
+ "PVV4": 2,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 2,
+ "EC.66C": 2
+ }, {
+ "id": "7",
+ "PVV4": 1,
+ "AXR-1": 1,
+ "HH.335C-Col/PhyA": 1,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "8",
+ "PVV4": 2,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 1,
+ "EC.66C": 1
+ }, {
+ "id": "9",
+ "PVV4": None,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 2,
+ "EC.66C": 2
+ }, {
+ "id": "10",
+ "PVV4": 2,
+ "AXR-1": 2,
+ "HH.335C-Col/PhyA": 2,
+ "EC.480C": 2,
+ "EC.66C": 2
+ }))))
def test_parse_geno_files(relpath,expected):
"""
GIVEN: Path to a zip file with R/qtl2 data