decay_correlation.HiCcomparator: Calculates correlations between diagonals.

Description Usage Arguments Value See Also Examples

Description

Computes correlations (Pearson, Spearman, Kendall) and significances of corresponding diagonals between 2 Hi-C maps of HiCcomparator object.

Usage

1
2
3
4
5
6
## S3 method for class 'HiCcomparator'
decay_correlation(
  hic.comparator,
  which.cors = c("pearson", "spearman", "kendall")[1:2],
  pooled = TRUE
)

Arguments

hic.comparator

object of type HiCcomparator

which.cors

character indicating which correlation measures to calculate, available choices are: pearson, spearman and kendall

pooled

logical if true then calculates correlations over pools of diagonals, otherwise uses single diagonals

Value

dataframe with following columns: diagonal, pcc, pearson.pval, rho, spearman.pval, tau, kendall.pval, name which can be used to conveniently visualise dependancy between 2 Hi-C maps being compared (see examples)

See Also

HiCcomparator on how to construct HiCcomparator object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
first create HiCcomparator object - see ?HiCcomparator for examples
library("ggplot2")
library("reshape2")
decay.cors <- decay_correlation(hic.comparator)
# wide to long
decay.cors.long <- reshape2::melt(decay.cors[c("name","diagonal","pcc","rho","tau")], id.vars = c("name","diagonal"), variable.name = "correlation", value.name = "coefficient")
# remove 0 diagonal (as it is non informative anyways) and illustrate results
ggplot(decay.cors.long[decay.cors.long$diagonal != 0,],
  aes(x = diagonal, y = coefficient, color = correlation)) +
 geom_point(size = 0.3) +
 facet_wrap(~ name, ncol = 1, scales = "free") +
 theme(legend.position = "bottom")

rz6/DIADEM documentation built on Dec. 31, 2019, 3:51 a.m.