Skip to contents

Function that computes quantification of contact frequencies in a given area and returns it in a named vector.

Usage

GetQuantif(
  matrices,
  areaFun = "center",
  operationFun = "mean_rm0",
  varName = NULL
)

Arguments

matrices

<Listmatrix>: A matrices list.

areaFun

: A character or function that allows to extract an area from each matrix that composes the matrices list (Default "center").

  • "C" or "CENTER": 3x3 pixels at the intersection between anchor and bait.

  • "UL" or "UPPER_LEFT": pixels in the uppper left square

  • "UR" or "UPPER_RIGHT": pixels in the uppper right square

  • "BL" or "BOTTOM_LEFT": pixels in the bottom left square

  • "BR" or "BOTTOM_RIGHT": pixels in the bottom right square

  • "U" or "UPPER": pixels above the center area

  • "B" or "BOTTOM": pixels below the center area

  • "L" or "LEFT": pixels in the left of the center area

  • "R" or "RIGHT": pixels in the right of the center area

  • "D" or "DONUT": pixels that surrounds the center area

operationFun

: A character or function specifying the operation applied to the selected area. (Default "mean_rm0")

  • "mean_rm0": apply a mean after replacing 0 with NA

  • "median_rm0": apply a median after replacing 0 with NA

  • "sum_rm0": apply a sum after replacing 0 with NA

  • "median": apply a median

  • "sum": apply a sum

  • "mean" or other character: apply a mean

varName

: The name of a column in GInteraction attributes of matrices used as named in the output vector (Default NULL). By default, sub-matrices IDs are used.

Value

A GRange object.

Details

GetQuantif

Examples

# Data
data(Beaf32_Peaks.gnr)
data(HiC_Ctrl.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_PF.mtx_lst <- ExtractSubmatrix(
    genomicFeature = Beaf_Beaf.gni,
    hicLst = HiC_Ctrl.cmx_lst,
    referencePoint = "pf"
)
GetQuantif(
    matrices = interactions_PF.mtx_lst,
    areaFun = "center",
    operationFun = "mean"
) |> head()
#> 2L:11_2L:12 2L:11_2L:17 2L:11_2L:20 2L:11_2L:22 2L:11_2L:23 2L:11_2L:24 
#>  31422.8750   1866.5556    779.7778    788.0000    760.1111    554.1111