New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jaccard reporting invalid results #204

Closed
jayhesselberth opened this Issue Mar 19, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@jayhesselberth
Collaborator

jayhesselberth commented Mar 19, 2017

jaccard values should be [0, 1].

library(valr)
library(tidyverse, warn.conflicts = FALSE)
#> Loading tidyverse: ggplot2
#> Loading tidyverse: tibble
#> Loading tidyverse: tidyr
#> Loading tidyverse: readr
#> Loading tidyverse: purrr
#> Loading tidyverse: dplyr
#> Conflicts with tidy packages ----------------------------------------------
#> filter(): dplyr, stats
#> lag():    dplyr, stats

genome <- tribble(
  ~chrom, ~size,
  "chr1", 1e6,
  "chr2", 1e6
)

x <- bed_random(genome, n = 1e4, seed = 10000)

bed_jaccard(x, x)
#> # A tibble: 1 × 4
#>      len_i    len_u   jaccard      n
#>      <int>    <int>     <dbl>  <int>
#> 1 60095982 20000000 -1.498803 110200
@jayhesselberth

This comment has been minimized.

Collaborator

jayhesselberth commented Mar 19, 2017

also this.

library(valr)
library(tidyverse, warn.conflicts = FALSE)
#> Loading tidyverse: ggplot2
#> Loading tidyverse: tibble
#> Loading tidyverse: tidyr
#> Loading tidyverse: readr
#> Loading tidyverse: purrr
#> Loading tidyverse: dplyr
#> Conflicts with tidy packages ----------------------------------------------
#> filter(): dplyr, stats
#> lag():    dplyr, stats

genome <- tribble(
  ~chrom, ~size,
  "chr1", 1e6,
  "chr2", 1e6
)

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

bed_jaccard(x, x)
#> Warning in summarise_impl(.data, dots): integer overflow - use
#> sum(as.numeric(.))
#> # A tibble: 1 × 4
#>   len_i     len_u jaccard        n
#>   <int>     <int>   <dbl>    <int>
#> 1    NA 200000000      NA 10114884

jayhesselberth added a commit that referenced this issue Mar 19, 2017

@jayhesselberth jayhesselberth self-assigned this Mar 19, 2017

jayhesselberth added a commit that referenced this issue Mar 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment