tagDensity: Smoothed tag density

Description Usage Arguments Value Examples

View source: R/tagDensity.R

Description

Calculates the smoothed tag density using spp::get.smoothed.tag.density

tagDensity

Usage

1
tagDensity(data, tag.shift, annotationID = "hg19", mc = 1)

Arguments

data,

data-structure with tag information (see readBamFile())

tag.shift,

Integer containing the value of the tag shif, calculated by getCrossCorrelationScores()

annotationID

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

mc

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

Value

smoothed.density A list of lists, each list corresponds to a chromosome and contains a vector of coordinates of the 5' ends of the aligned tags

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
## 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=98
## Not run: 

filepath=tempdir()
setwd(filepath)

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

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)

chipBamSelected=selectedTags$chip.dataSelected

smoothedChip=tagDensity(chipBamSelected, tag.shift=finalTagShift)

## End(Not run)

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