From ee0b1836f33004c62d05408c4ee2b69086652131 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Wed, 28 Jan 2026 00:23:56 +0000 Subject: Do not drop zero standard deviation SNPs with --only-center. --- tests/test_pyhegp.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'tests/test_pyhegp.py') diff --git a/tests/test_pyhegp.py b/tests/test_pyhegp.py index 569ebe5..3192bf7 100644 --- a/tests/test_pyhegp.py +++ b/tests/test_pyhegp.py @@ -178,6 +178,19 @@ def test_encrypt_genotype_does_not_produce_na(genotype, key, only_center): def test_encrypt_phenotype_does_not_produce_na(phenotype, key): assert not encrypt_phenotype(phenotype, key).isna().any(axis=None) +def test_encrypt_with_only_center_does_not_drop_snps(tmp_path): + genotype_file = Path("test-data/genotype-with-zero-stddev-snp.tsv") + shutil.copy(genotype_file, tmp_path) + result = CliRunner().invoke(main, ["encrypt", + "--only-center", + str(tmp_path / genotype_file.name)]) + assert result.exit_code == 0 + with genotype_file.open("rb") as file: + genotype = read_genotype(file) + with (tmp_path / f"{genotype_file.name}.hegp").open("rb") as file: + encrypted_genotype = read_genotype(file) + assert len(genotype) == len(encrypted_genotype) + @pytest.mark.parametrize("summary_files", [[Path("test-data/pool-test-summary1"), Path("test-data/pool-test-summary2")], -- cgit 1.4.1