Entering edit mode
rubi
▴
110
@rubi-6462
Last seen 6.4 years ago
Hi,
I have a data.frame of exons per each transcript and another, corresponding, data.frame of the cds intervals:
exon.df <- data.frame(id=c(rep("id1",4),rep("id2",3),rep("id3",5)), start=c(10,20,30,40,100,200,300,1000,2000,3000,4000,5000), end=c(15,25,35,45,150,250,350,1500,2500,3500,4500,5500)) cds.df <- data.frame(id=c(rep("id1",3),rep("id2",3),rep("id3",3)), start=c(20,30,40,125,200,300,2250,3000,4000), end=c(25,35,45,150,250,325,2500,3500,4250))
I would like to extract the UTRs from these data for each transcript. For this example, the outcomes will be:
utr5.df <- data.frame(id=c("id1","id2","id3","id3"), start=c(10,100,1000,2000), end=c(15,124,1500,2249)) utr3.df <- data.frame(id=c("id2","id3","id3"), start=c(326,4251,5000), end=c(350,4500,5500))
Can GenomicRanges
or any other package be used in any way for that?