Learn R Programming

Repitools (version 1.18.0)

mappabilityCalc: Calculate The Mappability of a Region

Description

Function to calculate mappability of windows

Usage

"mappabilityCalc"(x, organism, window = NULL, type = c("block", "TSS", "center"), verbose = TRUE) "mappabilityCalc"(x, organism, window = NULL, type = c("block", "TSS", "center"), ...)

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.
type
What part of the interval to make the window around. If the value is "TSS", the the start coordinate is used for all + strand features, and the end coordinate is used for all - strand features. If "cemter" is chosen, then the coordinate that is half way between the start and end of each feature will be used as the reference point. "block" results in the use the start and end coordinates without modification.
organism
The BSgenome object to calculate mappability upon, or the file path to a FASTA file generated by GEM Mappability, or the path to a bigWig file containing mappability scores.
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 mappability 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 of stranded features, and the same number of bases towards the start and end of the chromosome for unstranded features. The value returned for each region is a percentage of bases in that region that are not N (any base in IUPAC nomenclature).

For any positions of a window that are off the end of a chromosome, they will be considered as being N.

Examples

Run this code
  ## Not run: 
#     require(BSgenome.Hsapiens36bp.UCSC.hg18mappability)
#     TSSTable <- data.frame(chr = paste("chr", c(1,2), sep = ""), position = c(100000, 200000))
#     mappabilityCalc(TSSTable, Hsapiens36bp, window = 200, type = "TSS")
#   ## End(Not run)

Run the code above in your browser using DataLab