trimTranscripts: Resize 5' and 3' ends of a transcript GenomicRanges

View source: R/trimTranscripts.R

trimTranscriptsR Documentation

Resize 5' and 3' ends of a transcript GenomicRanges

Description

Resize 5' and 3' ends of a transcript GenomicRanges

Usage

trimTranscripts(x, start = 0, end = 0)

Arguments

x

GRanges or GRangesList object containing exon coordinates for each transcript

start

Number of bases to trim from the start of transcript. Providing a negative value will extend the transcript instead. If 'x' is a GRanges object, 'start' is a single integer. If 'x' is a GRangesList, 'start' can be a single integer or a list of integers of the same length as 'x'

end

Number of bases to trim from the end of transcript. Providing a negative value will extend the transcript instead. If 'x' is a GRanges object, 'end' is a single integer. If 'x' is a GRangesList, 'end' can be a single integer or a list of integers of the same length as 'x'

Value

Trimmed GenomicRanges object

Author(s)

Fursham Hamid

Examples

library(GenomicRanges)
gr1 <- GRanges(
  seqnames = "chr1", strand = c("+", "+", "+"),
  ranges = IRanges(
    start = c(1, 500, 1000),
    end = c(100, 600, 1100)
  )
)

trimTranscripts(gr1, 20, 80)
trimTranscripts(gr1, 110, 150)

fursham-h/factR documentation built on Aug. 20, 2023, 1:58 p.m.