gr.trim: Trims pile of 'GRanges' relative to the specified <local>...

View source: R/gUtils.R

gr.trimR Documentation

Trims pile of GRanges relative to the specified <local> coordinates of each range

Description

Example: GRanges with genomic coordinates 1:1,000,000-1,001,000 can get the first 20 and last 50 bases trimmed off with start = 20, end = 950. if end is larger than the width of the corresponding gr, then the corresponding output will only have end(gr) as its coordinate.

This is a role not currently provided by the standard GenomicRanges functions (e.g. shift, reduce, restrict, shift, resize, flank)

Usage

gr.trim(gr, starts = 1, ends = 1)

Arguments

gr

GRanges to trim

starts

integer Beginning of interval trimmed; Number of bases to trim off of the front[1]

ends

integer End of interval trimmed

Value

GRanges with trimmed intervals relative to the specified <local> coordinates of each range

Examples


## trim the first 20 and last 50 bases
gr.trim(GRanges(1, IRanges(1e6, width=1000)), starts=20, ends=950)
## return value: GRanges on 1:1,000,019-1,000,949


mskilab/gUtils documentation built on June 6, 2023, 12:08 a.m.