extendTrailersUntil: Extend Trailers Until

View source: R/grl_extend.R

extendTrailersUntilR Documentation

Extend Trailers Until

Description

Extend trailers until a restriction group / position. This makes you extend until you hit another gene boundary etc.

Usage

extendTrailersUntil(
  grl,
  grl2 = grl,
  extension = 500,
  until = 200,
  min_ext = 25,
  is.circular = all(isCircular(grl) %in% TRUE),
  ...
)

Arguments

grl

a GRangesList

grl2

a GRangesList, default 'grl'. The list that defines restrictions on extension. Can also be another set, which is used as 'roadblocks' for extension.

extension

an integer, how much to max extend downstream (3' end). Either single value that will apply for all, or same as length of grl which will give 1 update value per grl object. Or a GRangesList where start / stops sites by strand are the positions to use as new starts. Will not cross the chromosome boundary for non circular chromosomes.

until

numeric, default 200. The nearest you can go to the boundary. #' Defined as boundary hit + 1, so if hit on 22, and until is 2, will set to 22+2+1 = 25. Usually if Leaders/trailers are not defined, this makes a good pseudo leader boundary around your other genes.

min_ext

numeric, default 25. What is the minimum extension, even though it crosses a boundary. Will not cross the chromosome boundary for non circular chromosomes.

is.circular

logical, default FALSE if not any is: all(isCircular(grl) Where grl is the ranges checked. If TRUE, allow ranges to extend below position 1 on chromosome. Since circular genomes can have negative coordinates.

...

Arguments sent to distanceToFollowing

Value

a GRangesList of extended grl input

Examples

grl <- GRangesList(tx1 = GRanges("1", IRanges(c(10, 15), c(13, 20)), "+"),
                   tx2 = GRanges("1", IRanges(30, 50), "+"))
extendTrailersUntil(grl, min_ext = 5)
extendTrailersUntil(grl, min_ext = 5, until = 1)
extendTrailersUntil(grl, min_ext = 5, until = 1)
extendTrailersUntil(grl, min_ext = 5, until = 1, extension = 4)

Roleren/ORFik documentation built on Dec. 18, 2024, 11:39 p.m.