Skip to contents

Prepares matrices list for further analysis (eg. Aggregation or GetQuantif). Orientation can be corrected, and per matrix transformation can be performed.

Usage

PrepareMtxList(
  matrices,
  minDist = NULL,
  maxDist = NULL,
  rm0 = FALSE,
  transFun = NULL,
  orientate = FALSE
)

Arguments

matrices

<listmatrix>: The matrices list to prepare.

minDist

: The minimal distance between anchor and bait.

maxDist

: The maximal distance between anchor and bait.

rm0

: Whether 0 should be replaced with NA. (Default FALSE)

transFun

: The function used to transform or scale values in each submatrix before aggregation. The following characters can be submitted:

  • "quantile" or "qtl" apply function dplyr::ntile(x,500)

  • "percentile" or "prct" apply percentile.

  • "rank" apply a ranking.

  • "zscore" apply a scaling.

  • "minmax" scales on a min to max range.

  • "mu" scales on mean: (x-mean(x))/(max(x)-min(x)).

  • other or NULL don't apply transformation (Default).

orientate

: Whether matrices must be corrected for orientatation before the aggregation.

Value

A matrix list ready for aggregation of values extraction.

Details

PrepareMtxList

Examples

# Data
data(Beaf32_Peaks.gnr)
data(HiC_Ctrl.cmx_lst)
data(HiC_HS.cmx_lst)

# Index Beaf32
Beaf32_Index.gnr <- IndexFeatures(
    gRangeList = list(Beaf = Beaf32_Peaks.gnr),
    chromSizes = data.frame(seqnames = c("2L", "2R"),
          seqlengths = c(23513712, 25286936)),
    binSize = 100000
)

# Beaf32 <-> Beaf32 Pairing
Beaf_Beaf.gni <- SearchPairs(indexAnchor = Beaf32_Index.gnr)
Beaf_Beaf.gni <- Beaf_Beaf.gni[seq_len(2000)] # subset 2000 first for exemple

# Matrices extractions center on Beaf32 <-> Beaf32 point interaction
interactions_Ctrl.mtx_lst <- ExtractSubmatrix(
    genomicFeature = Beaf_Beaf.gni,
    hicLst = HiC_Ctrl.cmx_lst,
    referencePoint = "pf"
)
interactions_HS.mtx_lst <- ExtractSubmatrix(
    genomicFeature = Beaf_Beaf.gni,
    hicLst = HiC_HS.cmx_lst,
    referencePoint = "pf"
)
interactions_Ctrl.mtx_lst <- PrepareMtxList(
    matrices = interactions_Ctrl.mtx_lst
)

# Aggregate matrices in one matrix
aggreg.mtx <- Aggregation(interactions_Ctrl.mtx_lst)


interactions_HS.mtx_lst <- PrepareMtxList(
    matrices = interactions_HS.mtx_lst
)

# Differential Aggregation
aggregDiff.mtx <- Aggregation(
    ctrlMatrices = interactions_Ctrl.mtx_lst,
    matrices = interactions_HS.mtx_lst
)