From 2162cec2084f712993180618eb92c5a6dfdc5963 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Thu, 28 Dec 2023 13:19:50 +0300 Subject: Rework parsing of transposed geno files. --- tests/r_qtl/test_r_qtl2_geno.py | 125 +++++++++++++++++++++++----------------- 1 file changed, 71 insertions(+), 54 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3