Skip to content

Commit

Permalink
test larger data sets for correct jaccard result
Browse files Browse the repository at this point in the history
- closes #204
  • Loading branch information
jayhesselberth committed Mar 19, 2017
1 parent 82266c8 commit 43e4d85
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# valr 0.1.2.9000

## Bug fixes

* Merge intervals in `bed_jaccard()` and use numeric values for calculation (fixes #204).

# valr 0.1.2

## Major changes
Expand Down
10 changes: 10 additions & 0 deletions tests/testthat/test_jaccard.r
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,13 @@ test_that("jaccard coeff is calculated correctly", {
res <- bed_jaccard(x, y)
expect_equal(res$jaccard, 0.25)
})

test_that("jaccard coeff is calc'd for large data sets", {
genome <- read_genome(valr_example('hg19.chrom.sizes.gz'))

x <- bed_random(genome, n = 1e5, seed = 10000)
y <- bed_random(genome, n = 1e5, seed = 20000)

res <- bed_jaccard(x, y)
expect_equal(res$jaccard, 0.01613906)
})

0 comments on commit 43e4d85

Please sign in to comment.