Bioconductor / GenomicRanges

Representation and manipulation of genomic intervals
https://bioconductor.org/packages/GenomicRanges
41 stars 17 forks source link

Bug in follow and precede #19

Closed LuukHenk closed 5 years ago

LuukHenk commented 5 years ago

In my code, I want to get the row of the y range that comes after the x range by using the code below. But when I run the code, I get the row of the y range that comes before the x range. Precede gives the opposite.

y <- data.frame('seqnames' = c('chr11', 'chr11'), 'start' = c(62789197, 62789292), 'end' = c(62789210, 62789426), strand = c('+', '+'))

x <- data.frame('seqnames' = 'chr11', 'start' = 62789211, 'end' = 62789271, strand = '+')

x <- GenomicRanges::makeGRangesFromDataFrame(x, ignore.strand = F)
y <- GenomicRanges::makeGRangesFromDataFrame(y, ignore.strand = F)

x <- GenomicRanges::GRanges(seqnames(x), IRanges(end(x),   end(x)),   strand = strand(x))
y <- GenomicRanges::GRanges(seqnames(y), IRanges(start(y), start(y)), strand = strand(y))

IRanges::follow(x, y, select = 'last', ignore.strand = F)
vobencha commented 5 years ago

This was answered on the support site:

https://support.bioconductor.org/p/115368/