trimGRanges: trim GRanges object

View source: R/gff.R

trimGRangesR Documentation

trim GRanges object

Description

trim to get the first or last bases from GRanges.

Usage

  trimGRanges(x, width = 100, start = TRUE)

Arguments

x

A GRanges object.

width

integer(1): the length of bases to fetch.

start

logical(1): fetch from the start or end.

Details

Image we have exons from the same transcript in the x. We want to fetch 100 bases of CDS from 5' end or 3' end.

Value

A GRanges object.

Author(s)

Ge Tan

Examples

  gr <- GRanges(seqnames="chr1",
                ranges=IRanges(start=c(2,10,20),
                               end=c(5, 15, 23)),
                strand="+")
  trimGRanges(gr, width=3, start=TRUE)
  trimGRanges(gr, width=4, start=TRUE)
  trimGRanges(gr, width=11, start=TRUE)
  trimGRanges(gr, width=11, start=FALSE)

uzh/ezRun documentation built on Dec. 26, 2024, 9:53 a.m.