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

bed_map dot spec / pass colname suffixes to bed_intersect #14

Closed
jayhesselberth opened this issue Apr 26, 2016 · 0 comments
Closed

bed_map dot spec / pass colname suffixes to bed_intersect #14

jayhesselberth opened this issue Apr 26, 2016 · 0 comments
Assignees

Comments

@jayhesselberth
Copy link
Member

The bed_intersect call in bed_map yields new columns with .y suffixes, causing surprising behavior:

bed_tbl <- tibble::frame_data(
~chrom, ~start, ~end,
"chr1", 100, 250,
"chr2", 250, 500)

signal_tbl <- tibble::frame_data(
~chrom, ~start, ~end, ~value,
"chr1", 100, 250, 10,
"chr1", 150, 250, 20,
"chr2", 250, 500, 500)

bed_map(bed_tbl, signal_tbl, sum = sum(value))
#> Error: object 'value' not found
bed_map(bed_tbl, signal_tbl, sum = sum(value.y))
#> Source: local data frame [2 x 4]
#> 
#>   chrom start   end   sum
#>   <chr> <dbl> <dbl> <dbl>
#> 1  chr1   100   250    30
#> 2  chr2   250   500   500

The way around is to enable passing of suffix values to bed_intersect:

bed_intersect(x, y, suffix.y = '')
@jayhesselberth jayhesselberth self-assigned this Apr 26, 2016
@jayhesselberth jayhesselberth changed the title bed_map dot spec / allow colname suffixes to bed_intersect bed_map dot spec / pass colname suffixes to bed_intersect Apr 27, 2016
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