PESCAn: Paired-end spatial chromatin analysis

View source: R/ARMLA.R

PESCAnR Documentation

Paired-end spatial chromatin analysis

Description

Performs an all-to-all Hi-C contact analysis for specified regions.

Usage

PESCAn(
  explist,
  bed,
  shift = 1000000L,
  dist_thres = c(5000000L, Inf),
  size_bin = NULL,
  size_bp = NULL,
  outlier_filter = c(0, 1),
  min_compare = 10,
  anchors = NULL,
  raw = TRUE
)

Arguments

explist

Either a single GENOVA contacts object or a list of GENOVA contacts objects.

bed

A BED-formatted data.frame with the following 3 columns:

  1. A character giving the chromosome names.

  2. An integer with start positions.

  3. An integer with end positions.

shift

An integer of length 1 indicating how many basepairs the anchors should be shifted. Essentially performs circular permutation of size for a reasonable estimate of background. The argument is ignored when shift <= 0.

dist_thres

An integer vector of length 2 indicating the minimum and maximum distances in basepairs between anchorpoints.

size_bin, size_bp

The size of the lookup regions in bins (i.e. a score of 21 yields an output with 10 Hi-C bins both up- and downstream of the anchor). When NULL (default), it is internally set to 21 when the size_bp is also NULL. size_bp is an alternative parametrisation for the lookup regions, expressed in basepairs. size_bp is not used when the argument size_bin is set.

outlier_filter

A numeric of length 2 between [0-1] indicating quantiles of data to be used as thresholds. Data outside these thresholds are set to the nearest threshold. Setting this to c(0, 1) performs no outlier correction.

min_compare

An integer of length 1 indicating the minimum number of pairwise interactions on a chromosome to consider.

anchors

(Optional) A matrix with two columns containing pre-computed anchor indices. If this is set, skips calculation of anchor indices and uses this argument instead. See anchors_PESCAn().

raw

A logical of length 1: should the raw array underlying the summary matrices be returned in the output? Should be TRUE if the intention is to use the quantify function.

Value

An PESCAn_discovery object containing the following slots:

obsexp

An array with the dimensions size_bin x size_bin x length(explist) containing fold change values for the signal over the median shifted values.

signal

An array with the dimensions size_bin x size_bin x length(explist) containing mean contact values for bins surrounding the anchors.

signal_raw

A list with length(explist) elements for each contacts object, wherein an element is an n x size_bin x size_bin array with contact values for each anchor. 'n' is the number of non-empty valid anchors.

shifted

An array with the dimensions size_bin x size_bin x length(explist) containing mean contact values for bins that are shift basepairs away from the anchors.

shifted_raw

A list with length(explist) elements for each contacts object, wherein an alemeent is an n x size_bin x size_bin array with contact values for each shifted anchors. 'n' is the number of non-empty valid (unshifted) anchors.

Resolution recommendation

20kb-40kb

See Also

The rep_mat_lookup function that performs the lookup and summary for the PESCAn function and others.
The discovery class for a general description of discovery classes.
The visualise function for visualisation of the results.
The quantify function for quantification of interaction strenghts.
The anchors documentation for more information about anchors.

Other aggregate repeated matrix lookup analyses: APA(), ARA(), ATA(), CSCAn(), rep_mat_lookup()

Examples

## Not run: 
# Typical usage: PESCAn for super enhancers using a 1 MB
# circular permutation on a pair of experiments.
pescan <- PESCAn(
  explist = list(WT_40kb, KO_40kb),
  bed = super_enhancers,
  shift = 1e6
)

# Alternative usage with pre-calculated anchors and no permutation
anchors <- anchors_PESCAn(WT_40kb$IDX, resolution(WT_40kb),
  genes_tss,
  dist_thres = c(5e6, 15e6)
)
pescan <- PESCAn(
  explist = list(WT_40kb),
  anchors = anchors,
  shift = 0
)

# Visualising PE-SCAns
visualise(pescan)

## End(Not run)

robinweide/GENOVA documentation built on March 14, 2024, 11:16 p.m.