Skip to content

Feature request "pull" function #94

@eggrandio

Description

@eggrandio

Hello,

I wonder if there is a "tidy" way of retrieving metadata from grange objects. I haven't found an equivalent pull function.

Right now I find it quite cumbersome to filter and retrieve another metadata column as a vector.

I am doing this, but maybe there is a cleaner way (is there another way of converting from S4 to vector?):

gr <- GRanges(seqnames = "chr1", strand = c("+", "-", "+"),
              ranges = IRanges(start = c(1,3,5), width = 3)) %>% 
  mutate(score = c(0.1, 0.5, 0.3),
         peak = c("a", "b", "c"))

output <- gr %>% filter(score > 0.2) %>% select(peak, .drop_ranges = TRUE) %>% as.data.frame() %>% unlist() %>% unname()

Having a pull function would simplify this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions