GC content computation for BSgenome

Share:

Description

Compute GC content in a certain region of a BSgenome object

Usage

1
GCcontent(obj, ..., view.width, as.prob = TRUE)

Arguments

obj

BSgenome object

...

Arguments passed to getSeq method for BSgenome package.

view.width

Passed to letterFrequencyInSlidingView, the constant (e.g. 35, 48, 1000) size of the "window" to slide along obj. The specified letters are tabulated in each window of length view.width. The rows of the result (see value) correspond to the various windows.

as.prob

If TRUE return percentage of GC content, otherwise return counts.

Details

GC content is an interesting variable may be related to various biological questions. So we need a way to compute GC content in a certain region of a reference genome. GCcontent function is a wrapper around getSeq function in BSgenome package and letterFrequency, letterFrequencyInSlidingView in Biostrings package.

if the view.width is specified, the GC content will be computed in the sliding view

Value

Numeric value indicate count or percentage

Author(s)

Tengfei Yin

Examples

1
2
library(BSgenome.Hsapiens.UCSC.hg19)
GCcontent(Hsapiens, GRanges("chr1", IRanges(1e6, 1e6 + 1000)))

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.