getPeakCallingScores: Calculating QC-values from peak calling procedure

Description Usage Arguments Value Examples

View source: R/GlobalFunctions.R

Description

QC-metrics based on the peak calling are the fraction of usable reads in the peak regions (FRiP) (Landt et al., 2012), for which the function calls sharp- and broad-binding peaks to obtain two types: the FRiP_sharpsPeak and the FRiP_broadPeak. The function takes the number of called of peaks using an FDR of 0.01 and an evalue of 10 (Kharchenko et al., 2008). And count the number of peaks called when using the sharp- and broad-binding option.

getPeakCallingScores

Usage

1
2
3
getPeakCallingScores(chip, input, chip.dataSelected, input.dataSelected,
    annotationID = "hg19", tag.shift = 75, mc = 1, chrorder = NULL,
    debug = FALSE)

Arguments

chip

data-structure with tag information for the ChIP (see readBamFile())

input

data-structure with tag information for the Input (see readBamFile())

chip.dataSelected

selected ChIP tags after running removeLocalTagAnomalies() which removes local tag anomalies

input.dataSelected

selected Input tags after running removeLocalTagAnomalies() which removes local tag anomalies

annotationID

String indicating the genome assembly (Default="hg19")

tag.shift

Integer containing the value of the tag shift, calculated by getCrossCorrelationScores(). Default=75

mc

Integer, the number of CPUs for parallelization (default=1)

chrorder

chromosome order (default=NULL)

debug

Boolean, to enter debugging mode. Intermediate files are saved in working directory

Value

QCscoreList List with 6 QC-values

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
mc=4
finalTagShift=98
print("Cross-correlation for ChIP")

## Not run: 
filepath=tempdir()
setwd(filepath)

data("chipSubset", package = "ChIC.data", envir = environment())
chipBam=chipSubset
data("inputSubset", package = "ChIC.data", envir = environment())
inputBam=inputSubset

## calculate binding characteristics 

chip_binding.characteristics<-spp::get.binding.characteristics(
    chipBam, srange=c(0,500), bin = 5, accept.all.tags = TRUE)

input_binding.characteristics<-spp::get.binding.characteristics(
    inputBam, srange=c(0,500), bin = 5, accept.all.tags = TRUE)

##get chromosome information and order chip and input by it
chrl_final <- intersect(names(chipBam$tags), names(inputBam$tags))
chipBam$tags <- chipBam$tags[chrl_final]
chipBam$quality <- chipBam$quality[chrl_final]
inputBam$tags <- inputBam$tags[chrl_final]
inputBam$quality <- inputBam$quality[chrl_final]

##remove sigular positions with extremely high read counts with 
##respect to the neighbourhood
selectedTags <- removeLocalTagAnomalies(chipBam, inputBam, 
    chip_binding.characteristics, input_binding.characteristics)

inputBamSelected <- selectedTags$input.dataSelected
chipBamSelected <- selectedTags$chip.dataSelected

##Finally run function
bindingScores <- getPeakCallingScores(chip = chipBam, 
    input = inputBam, chip.dataSelected = chipBamSelected, 
    input.dataSelected = inputBamSelected, 
    annotationID="hg19",
    tag.shift = finalTagShift, mc = mc)

## End(Not run)

ChIC documentation built on Nov. 8, 2020, 5:15 p.m.