-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
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
Labels
No labels