library(GenomicRanges)
txdf <- data.frame(GENEID=c("101","101","102"),
TXID=c("201","202","203"))
ebt <- GRangesList(GRanges("1",IRanges(c(100,200),width=50)),
GRanges("1",IRanges(2e6 + c(100,200),width=50)),
GRanges("1",IRanges(3e6 + c(100,200),width=50)))
names(ebt) <- c("201","202","203")
ebg <- GRangesList(reduce(unlist(ebt[1:2])),ebt[[3]])
names(ebg) <- c("101","102")
splitLongGenes(ebg, ebt, txdf)
Run the code above in your browser using DataLab