Learn R Programming

Repitools (version 1.18.0)

gcContentCalc: Calculate The gcContent of a Region

Description

Function to calculate the GC content of windows

Usage

"gcContentCalc"(x, organism, verbose = TRUE) "gcContentCalc"(x, organism, window = NULL, ...)

Arguments

x
A GRanges object or a data.frame, with columns chr and either position or start, end and strand.
window
Bases around the locations that are in the window. Calculation will consider windowSize/2 bases upstream, and windowSize / 2 - 1 bases downstream.
organism
The BSgenome object to calculate gcContent upon.
verbose
Whether to print the progess of processing.
...
The verbose variable for the data.frame method, passed onto the GRanges method.

Value

A vector of GC content percentages, one for each region.

Details

The windows considered will be windowSize/2 bases upstream and windowSize/2-1 bases downstream of the given position, for each position. The value returned for each region is a percentage of bases in that region that are a G or C.

Examples

Run this code
require(BSgenome.Hsapiens.UCSC.hg18)
TSSTable <- data.frame(chr = paste("chr", c(1,2), sep = ""), position = c(100000, 200000))
gcContentCalc(TSSTable, 200, organism=Hsapiens)

Run the code above in your browser using DataLab