Skip to content

Commit

Permalink
fix(generate): ped parser accept None value as null
Browse files Browse the repository at this point in the history
  • Loading branch information
natir committed May 9, 2023
1 parent a7c45fc commit 67bf3fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/variantplaner/io/ped.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def into_lazyframe(input_path: pathlib.Path) -> polars.LazyFrame:
input_path,
separator="\t",
has_header=False,
null_values="None",
new_columns=["family_id", "personal_id", "father_id", "mother_id", "sex", "affected"],
dtypes={
"family_id": polars.Utf8,
Expand Down
8 changes: 2 additions & 6 deletions tests/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ def test_transmission(tmp_path: pathlib.Path) -> None:
filecmp.cmp(truth, out_path)


def test_transmission_missing_mother(tmp_path: pathlib.Path) -> None:
def test_transmission_missing_mother() -> None:
"""Check add_origin of genotype."""
out_path = tmp_path / "transmission.parquet"

genotypes_lf = polars.scan_parquet(DATA_DIR / "no_info.genotypes.parquet")
genotypes_lf = genotypes_lf.filter(polars.col("sample") != "sample_3")

Expand All @@ -50,10 +48,8 @@ def test_transmission_missing_mother(tmp_path: pathlib.Path) -> None:
assert transmission.get_column("mother_gq").to_list() == [None, None, None, None, None]


def test_transmission_missing_father(tmp_path: pathlib.Path) -> None:
def test_transmission_missing_father() -> None:
"""Check add_origin of genotype."""
out_path = tmp_path / "transmission.parquet"

genotypes_lf = polars.scan_parquet(DATA_DIR / "no_info.genotypes.parquet")
genotypes_lf = genotypes_lf.filter(polars.col("sample") != "sample_2")

Expand Down

0 comments on commit 67bf3fd

Please sign in to comment.