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 on grouped df yields only some list-cols #216

Closed
jayhesselberth opened this issue Mar 24, 2017 · 0 comments · Fixed by #293
Closed

jaccard on grouped df yields only some list-cols #216

jayhesselberth opened this issue Mar 24, 2017 · 0 comments · Fixed by #293

Comments

@jayhesselberth
Copy link
Member

jayhesselberth commented Mar 24, 2017

The intersection (len_i) should also be grouped.

library(valr)
library(tidyverse)
#> 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

seed <- 1010486

genome <- read_genome(valr_example('genome.txt.gz'))
x <- bed_random(genome, seed = seed)
y <- bed_random(genome, seed = seed)

bed_jaccard(group_by(x, chrom),
            group_by(y, chrom))
#> # A tibble: 1 × 4
#>       len_i      len_u    jaccard      n
#>       <dbl>     <list>     <list>  <dbl>
#> 1 856392888 <dbl [93]> <dbl [93]> 727101
agillen added a commit to agillen/valr that referenced this issue May 22, 2017
agillen added a commit to agillen/valr that referenced this issue May 23, 2017
 - throws an error if inputs are not sorted on the same column

Closes: rnabioco#216
jayhesselberth added a commit that referenced this issue Jul 23, 2017
jayhesselberth added a commit that referenced this issue Jul 23, 2017
* calculate jaccard for grouped inputs
- fixes #216, closes #260

* qualify group_by in example and update globals
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

Successfully merging a pull request may close this issue.

1 participant