Skip to contents

R-native liftover backend using rtracklayer::liftOver() with a UCSC chain file. This is the default backend for liftover_intervals(); it requires no external tools but needs the Bioconductor packages rtracklayer, GenomicRanges, IRanges, and S4Vectors.

Usage

liftover_rtracklayer(intervals, chain, ...)

Arguments

intervals

A tibble of intervals with seqnames, start, end, an optional strand, and a .feature_id key (supplied by liftover_intervals()).

chain

Path to a UCSC chain file.

...

Unused.

Value

A list with mapped and unmapped tibbles.

Examples

# \donttest{
# rtracklayer and the packages it depends on take a few seconds to load.
if (
  requireNamespace("rtracklayer", quietly = TRUE) &&
    requireNamespace("GenomicRanges", quietly = TRUE)
) {
  chain <- tempfile(fileext = ".chain")
  writeLines(
    c(
      "chain 1000 chr1 100000 + 0 1000 chrT 200000 + 10000 11000 1",
      "1000",
      ""
    ),
    chain
  )
  ints <- tibble::tibble(
    seqnames = c("chr1", "chr1"),
    start = c(100, 5000),
    end = c(200, 5100),
    .feature_id = 1:2
  )
  out <- liftover_rtracklayer(ints, chain)
  out$mapped
  unlink(chain)
}
# }