qualityScores_LM: Wrapper function that plots non-scaled profiles for TSS of...

Description Usage Arguments Value Examples

View source: R/qualityScores_LM.R

Description

The non-scaled profile is constructed around the TSS/TES, with 2KB up- and downstream regions respectively. Different values are taken at the TSS/TES and surroundings with +/-2KB, +/-1KB and +/-500 sizes. For all the genomic positions, we kept the values for the ChIP and the normalized profile, as the normalization already contains information from the input. Additionally, we calculated for all of the intervals between the predefined positions the area under the profile, the local maxima (x, y coordinates), the variance, the standard deviation and the quantiles at 0 the function returns 43 QC-metrics.

qualityScores_LM

Usage

1
qualityScores_LM(data, tag, savePlotPath = NULL, plot = "all")

Arguments

data

metagene-list for input and chip samples as returned by createMetageneProfile()

tag

String that can be 'TSS' or 'TES',indicating if the TSS or the TES profile should be calcualted (Default='TSS')

savePlotPath

if set the plot will be saved under 'savePlotPath'. Default=NULL and plot will be forwarded to stdout.

plot

character, possible values "norm", "split", "all" (default) or "none" to plot metaprofiles for normalized ChIP/input enrichment, or the two samples reads densities separated, or both plots, or none (respectively)

Value

result Dataframe with QC-values for chip, input and normalized metagene profile

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
45
46
47
48
49
50
51
52
53
## This command is time intensive to run
##
## To run the example code the user must provide two bam files for the ChIP
## and the input and read them with the readBamFile() function. To make it
## easier for the user to run the example code we provide tow bam examples 
## (chip and input) in our ChIC.data package that have already been loaded 
## with the readBamFile() function.

mc=4
finalTagShift=82
## Not run: 

filepath=tempdir()
setwd(filepath)

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

## 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

##smooth input and chip tags
smoothedChip=tagDensity(chipBamSelected, tag.shift=finalTagShift)
smoothedInput=tagDensity(inputBamSelected, tag.shift=finalTagShift)

##calculate metagene profiles
Meta_Result=createMetageneProfile(smoothed.densityChip=smoothedChip, 
    smoothedInput,tag.shift=finalTagShift, mc=mc)

##estract QC-values and plot metageneprofile for TSS
TSS_Scores=qualityScores_LM(data=Meta_Result$TSS, tag="TSS",
savePlotPath=filepath))

## End(Not run)

carmencita/CHIC documentation built on May 2, 2021, 5:09 p.m.