Skip to content
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
Closed

jaccard reporting invalid results #204

jayhesselberth opened this issue Mar 19, 2017 · 1 comment
Assignees

Comments

@jayhesselberth
Copy link
Member

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
Copy link
Member Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant