Uses the junctions added by annotatERs
to modify the starts and
ends of the expressed regions. When a junction intersects an expressed region
depending on whether it is the start or end or both, the regions
corresponding starts and ends will be modified.
refine_ERs(annot_ers)
annot_ers | ERs that have been annotated (result of annotatER) |
---|
Genomic ranges with refined base pair starts and ends
As junctions mark intron boundaries, the expressed region will be changed to either being one less or one more than the junction end.
# create example set of ers to save runtime
ex_annot_ers <- GenomicRanges::GRanges(
seqnames = S4Vectors::Rle(c("chr21"), c(3)),
ranges = IRanges::IRanges(
start = c(5093576, 5097663, 5162182),
end = c(5093833, 5097762, 5162257)
),
grl = GenomicRanges::GRangesList(
GenomicRanges::GRangesList(
GenomicRanges::GRanges(
seqnames = S4Vectors::Rle(c("chr21"), c(1)),
ranges = IRanges::IRanges(
start = c(5093712),
end = c(5093744)
)
),
GenomicRanges::GRanges(
seqnames = S4Vectors::Rle(c("chr21"), c(1)),
ranges = IRanges::IRanges(
start = c(5097642),
end = c(5097669)
)
),
GenomicRanges::GRanges(
seqnames = S4Vectors::Rle(c("chr21"), c(1)),
ranges = IRanges::IRanges(
start = c(5162249),
end = c(5162287)
)
)
)
),
annotation = c("intron", "intron", "intron")
)
refined_ers <- refine_ERs(ex_annot_ers)
#> 2021-10-08 16:11:13 - Refining the Expressed regions...
refined_ers
#> GRanges object with 3 ranges and 2 metadata columns:
#> seqnames ranges strand | grl annotation
#> <Rle> <IRanges> <Rle> | <GRangesList> <character>
#> [1] chr21 5093713-5093743 * | chr21:5093712-5093744 intron
#> [2] chr21 5097670-5097762 * | chr21:5097642-5097669 intron
#> [3] chr21 5162182-5162248 * | chr21:5162249-5162287 intron
#> -------
#> seqinfo: 1 sequence from an unspecified genome; no seqlengths