Skip to content

Commit

Permalink
Fix #12 0 cov in region with cov
Browse files Browse the repository at this point in the history
  • Loading branch information
inodb committed Sep 10, 2015
1 parent fdccfe1 commit 5e93276
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sufam/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ def get_baseparser_extended_df(sample, bp_lines, ref, alt):
columns=["sample"] + columns, dtype=np.object)
bpdf[bpdf == ""] = None

# remove zero coverage rows
bpdf = bpdf[bpdf["cov"].astype(int) > 0]

if len(bpdf) == 0:
return None

Expand Down
5 changes: 5 additions & 0 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ def test_mpileup_test3(self):
assert_equals("+", bpdf.most_common_indel_type.iloc[0])
assert_almost_equals(0.0139, float(bpdf.val_maf.iloc[0]), places=3)
assert_almost_equals(0.0139, float(bpdf.most_common_al_maf.iloc[0]), places=3)

def test_0cov_regionwithcov(self):
test = open(ospj(DATA_PATH, "mpileup_0cov_regionwithcov.tsv")).read()
bpdf = sufam.__main__.get_baseparser_extended_df("test", [mpileup_parser.parse(test)], "G", "GAA")
assert_equals(None, bpdf)

0 comments on commit 5e93276

Please sign in to comment.