Converts intervals from another assembly to the current one.

gintervals.liftover(intervals = NULL, chain = NULL)

Arguments

intervals

intervals from another assembly

chain

name of chain file or data frame as returned by 'gintervals.load_chain'

Value

A data frame representing the converted intervals.

Details

This function converts 'intervals' from another assembly to the current one. Chain file instructs how the conversion of coordinates should be done. It can be either a name of a chain file or a data frame in the same format as returned by 'gintervals.load_chain' function.

The converted intervals are returned. An additional column named 'intervalID' is added to the resulted data frame. For each interval in the resulted intervals it indicates the index of the original interval.

Examples


gdb.init_examples()
chainfile <- paste(.misha$GROOT, "data/test.chain", sep = "/")
intervs <- data.frame(
    chrom = "chr25", start = c(0, 7000),
    end = c(6000, 20000)
)
gintervals.liftover(intervs, chainfile)
#>   chrom start   end intervalID
#> 1  chr1 12700 13500          1
#> 2  chr1 14100 16500          1
#> 3  chr1 17500 18500          2
#> 4  chrX  5000  7000          2