addCovCor: Add correlation of anchor signals to pairs of close genomic...

Description Usage Arguments Value Examples

View source: R/interaction.R

Description

This function adds a vector with correlation values for each input interaction. Only works for input interaction within the given maxDist distance. Note, this function does not work on windows because reading of bigWig files is currently not supported on windows.

Usage

1
2
addCovCor(gi, datacol = "chip", colname = "cor_chip", maxDist = NULL,
  use = "everything", method = "pearson")

Arguments

gi

A sorted GInteractions object.

datacol

a string matching an annotation column in regions(gi). This column is assumed to hold the same number of values for each interaction as a NumericList.

colname

A string that is used as columnname for the new column in gi.

maxDist

maximal distance of pairs in bp as numeric. If maxDist=NULL, the maximal distance is computed from input interactions gi by max(pairdist(gi)).

use

an optional character string giving a method for computing covariances in the presence of missing values. See cor for more details.

method

a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated. See cor for more details.

Value

A GInteractions similar to gi just with an additional column added.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
if (.Platform$OS.type != "windows") {

  # use internal motif data on chromosome 22
  motifGR <- sevenC::motif.hg19.CTCF.chr22

  # use example bigWig file
 exampleBigWig <- system.file("extdata",
     "GM12878_Stat1.chr22_1-30000000.bigWig", package = "sevenC")

  # add coverage from bigWig file
  motifGR <- addCovToGR(motifGR, exampleBigWig)

  # get all pairs within 1Mb
  gi <- getCisPairs(motifGR, 1e5)

  # compute correaltion of coverge for each pair
  gi <- addCovCor(gi)

  # addCovCor adds a new metadata column:
  mcols(gi)

}

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