From 9b51f59bc4b598c1136525300af5f696bcf66fc0 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Mon, 15 Jan 2024 18:36:06 +0300 Subject: Process `na.strings` even for default cases There was a bug where the `na.strings` were not processed correctly if the user called the `r_qtl.r_qtl2.file_data(...)` function without explicitly providing the `process_*` arguments. This commit fixes that. --- tests/r_qtl/test_files/test_pheno.zip | Bin 485 -> 503 bytes tests/r_qtl/test_files/test_pheno_transposed.zip | Bin 536 -> 557 bytes tests/r_qtl/test_r_qtl2_pheno.py | 8 ++++---- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/r_qtl/test_files/test_pheno.zip b/tests/r_qtl/test_files/test_pheno.zip index 5c709e7..ba9bbb0 100644 Binary files a/tests/r_qtl/test_files/test_pheno.zip and b/tests/r_qtl/test_files/test_pheno.zip differ diff --git a/tests/r_qtl/test_files/test_pheno_transposed.zip b/tests/r_qtl/test_files/test_pheno_transposed.zip index 9bff030..e6a87aa 100644 Binary files a/tests/r_qtl/test_files/test_pheno_transposed.zip and b/tests/r_qtl/test_files/test_pheno_transposed.zip differ diff --git a/tests/r_qtl/test_r_qtl2_pheno.py b/tests/r_qtl/test_r_qtl2_pheno.py index a7de675..c7c0c86 100644 --- a/tests/r_qtl/test_r_qtl2_pheno.py +++ b/tests/r_qtl/test_r_qtl2_pheno.py @@ -13,14 +13,14 @@ from r_qtl import r_qtl2 as rqtl2 ({"id": "1", "liver": "61.92", "spleen": "153.16"}, {"id": "2", "liver": "88.33", "spleen": "178.58"}, {"id": "3", "liver": "58", "spleen": "131.91"}, - {"id": "4", "liver": "78.06", "spleen": "126.13"}, - {"id": "5", "liver": "65.31", "spleen": "181.05"})), + {"id": "4", "liver": "78.06", "spleen": None}, + {"id": "5", "liver": None, "spleen": "181.05"})), ("tests/r_qtl/test_files/test_pheno_transposed.zip", ({"id": "1", "liver": "61.92", "spleen": "153.16"}, {"id": "2", "liver": "88.33", "spleen": "178.58"}, {"id": "3", "liver": "58", "spleen": "131.91"}, - {"id": "4", "liver": "78.06", "spleen": "126.13"}, - {"id": "5", "liver": "65.31", "spleen": "181.05"})))) + {"id": "4", "liver": "78.06", "spleen": None}, + {"id": "5", "liver": None, "spleen": "181.05"})))) def test_parse_pheno_files(filepath, expected): """Test parsing of 'pheno' files from the R/qtl2 bundle. -- cgit v1.2.3