addCor: Add correlation of ChIP-seq coverage to motif pairs.

Description Usage Arguments Value Examples

View source: R/interaction.R

Description

This function first adds ChIP-seq signals along all regions of motif location using the function addCovToGR. Than it calculates the correlation of coverage for each input pair using the function addCovCor. The Pearson correlation coefficient is added as new metadata column to the input interactions. Note, this function does not work on windows because reading of bigWig files is currently not supported on windows.

Usage

1
addCor(gi, bwFile, name = "chip", window = 1000, binSize = 1)

Arguments

gi

GInteractions object.

bwFile

File path or connection to BigWig file with ChIP-seq signals.

name

Character indicating the sample name.

window

Numeric scalar for window size around the center of ranges in gr.

binSize

Integer scalar as size of bins to which the coverage values are combined.

Value

An GInteractions object like gi with a new metadata column colname holding Pearson correlation coefficient of ChIP-seq signals for each anchor pair.

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
if (.Platform$OS.type != "windows") {

 # use example bigWig file of ChIP-seq signals on human chromosome 22
 exampleBigWig <- system.file("extdata",
 "GM12878_Stat1.chr22_1-30000000.bigWig", package = "sevenC")

 # use example CTCF moitf location on human chromosome 22
 motifGR <- sevenC::motif.hg19.CTCF.chr22

 # build candidate interactions
 gi <- prepareCisPairs(motifGR)


 # add ChIP-seq signals correlation
 gi <- addCor(gi, exampleBigWig)

 # use an alternative metadata column name for ChIP-seq correlation
 gi <- addCor(gi, exampleBigWig, name = "Stat1")


 # add ChIP-seq correlation for signals signals in windows of 500bp around
 # motif centers
 gi <- addCor(gi, exampleBigWig, window = 500)


 # add ChIP-seq correlation for signals in bins of 10 bp
 gi <- addCor(gi, exampleBigWig, binSize = 10)

}

sevenC documentation built on Nov. 8, 2020, 5:35 p.m.