Skip to content

Commit

Permalink
add requested test for custom column names in coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sergpolly authored Nov 23, 2023
1 parent 1d20055 commit e4f498c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,16 @@ def test_coverage():
df = pd.read_csv(StringIO(d), sep=r"\s+")
pd.testing.assert_frame_equal(df, bioframe.coverage(df1, df2))

### with custom column names
cols1 = ["chromosome", "begin", "stop"]
cols2 = ["chr", "cluster_start", "cluster_end"]
df1 = pd.DataFrame([["chr1", 3, 8]], columns=cols1)
df2 = pd.DataFrame([["chr1", 3, 8]], columns=cols2)
d = """chromosome begin stop coverage
0 chr1 3 8 5"""
df = pd.read_csv(StringIO(d), sep=r"\s+")
pd.testing.assert_frame_equal(df, bioframe.coverage(df1, df2, cols1=cols1, cols2=cols2))

### coverage of NA interval returns zero for coverage
df1 = pd.DataFrame(
[
Expand Down

0 comments on commit e4f498c

Please sign in to comment.