Skip to content

Commit

Permalink
Add test_actg_alleles_true
Browse files Browse the repository at this point in the history
  • Loading branch information
szhan committed Jun 19, 2023
1 parent 492a282 commit adf12c4
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/test_compare_vcfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,25 @@ def test_both_monoallelic():
assert np.array_equal(actual, expected)


def test_actg_alleles_true():
ds1 = make_test_case()
ds2 = ds1.copy(deep=True)
actual_alleles, actual_genotypes = compare_vcfs.remap_genotypes(ds1, ds2, actg_alleles=True)
expected_alleles = np.array([
[b'A', b'C', b'G', b'T'],
[b'A', b'C', b'G', b'T'],
])
expected_genotypes = xr.DataArray(
[
[[0, 1], [1, 0]],
[[3, 2], [2, 3]],
],
dims=["variants", "samples", "ploidy"]
)
assert np.array_equal(actual_alleles, expected_alleles)
assert np.array_equal(actual_genotypes, expected_genotypes)


@pytest.mark.parametrize(
"arr1, arr2, expected",
[
Expand Down

0 comments on commit adf12c4

Please sign in to comment.