R/utils.R
deconvolveBidirectionalPromoters.Rd
This function splits bi-directional ranges into + and - stranded ranges. It duplicates the ranges which are '*'.
deconvolveBidirectionalPromoters(granges)
A stranded GRanges object
GRanges with only '+' and '-' strands. GRanges with '*' strand have been duplicated and split into forward and reverse strands.
data(ce11_all_REs)
library(GenomicRanges)
proms <- ce11_all_REs[grepl('prom', ce11_all_REs$regulatory_class)]
proms
#> GRanges object with 17847 ranges and 2 metadata columns:
#> seqnames ranges strand | regulatory_class which.tissues
#> <Rle> <IRanges> <Rle> | <factor> <factor>
#> [1] chrI 11273-11423 * | bidirect-promoter Intest.
#> [2] chrI 15431-15581 * | unassigned_promoter Unclassified
#> [3] chrI 16959-17109 * | unassigned_promoter Ubiq.
#> [4] chrI 24453-24603 * | unassigned_promoter Unclassified
#> [5] chrI 26903-27053 - | rev-promoter Ubiq.
#> ... ... ... ... . ... ...
#> [17843] chrX 17684894-17685044 - | rev-promoter Hypod.
#> [17844] chrX 17686030-17686180 - | rev-promoter Unclassified
#> [17845] chrX 17694789-17694939 + | fwd-promoter Intest.
#> [17846] chrX 17702756-17702906 * | unassigned_promoter Unclassified
#> [17847] chrX 17711839-17711989 - | rev-promoter Germline
#> -------
#> seqinfo: 6 sequences from an unspecified genome; no seqlengths
table(strand(proms))
#>
#> + - *
#> 6616 6480 4751
proms <- deconvolveBidirectionalPromoters(proms)
proms
#> GRanges object with 22598 ranges and 2 metadata columns:
#> seqnames ranges strand | regulatory_class which.tissues
#> <Rle> <IRanges> <Rle> | <factor> <factor>
#> [1] chrI 11273-11423 + | bidirect-promoter Intest.
#> [2] chrI 11273-11423 - | bidirect-promoter Intest.
#> [3] chrI 15431-15581 + | unassigned_promoter Unclassified
#> [4] chrI 15431-15581 - | unassigned_promoter Unclassified
#> [5] chrI 16959-17109 + | unassigned_promoter Ubiq.
#> ... ... ... ... . ... ...
#> [22594] chrX 17686030-17686180 - | rev-promoter Unclassified
#> [22595] chrX 17694789-17694939 + | fwd-promoter Intest.
#> [22596] chrX 17702756-17702906 + | unassigned_promoter Unclassified
#> [22597] chrX 17702756-17702906 - | unassigned_promoter Unclassified
#> [22598] chrX 17711839-17711989 - | rev-promoter Germline
#> -------
#> seqinfo: 6 sequences from an unspecified genome; no seqlengths
table(strand(proms))
#>
#> + - *
#> 11367 11231 0