Skip to contents

Extract matrices in the HiC maps list around genomic features.

Usage

ExtractSubmatrix(
  feature.gn = NULL,
  hic.cmx_lst = NULL,
  referencePoint.chr = "pf",
  res.num = NULL,
  matriceDim.num = 21,
  shiftFactor.num = 1,
  cores.num = 1,
  verbose.bln = FALSE
)

Arguments

feature.gn

<GRanges or Pairs[GRanges] or GInteractions>: The genomic coordinates on which compute the extraction of HiC submatrix.

hic.cmx_lst

<List[contactMatrix]>: The HiC maps list.

referencePoint.chr

<character>: Type of extracted submatrices. "rf" for "region feature" to extract triangle-shaped matrices around regions or "pf" for "point feature" to extract square-shaped matrices around points. (Default "rf")

res.num

<numeric>: The resoulution in used in hic.cmx_lst. If NULL automatically find in resolution attributes of hic.cmx_lst. (Default NULL)

matriceDim.num

<numeric>: The size of matrices in output. (Default 21).

shiftFactor.num

<numeric>: Only when "referencePoint.chr" is "rf". Factor defining how much of the distance between anchor and bait is extracted before and after the region (Default 1). Ex: for shiftFactor.num=2, extracted matrices will be 2*regionSize+regionSize+2*regionSize.

cores.num

<integer> : An integer to specify the number of cores. (Default 1)

verbose.bln

<logical>: If TRUE show the progression in console. (Default FALSE)

Value

A matrices list.

Details

ExtractSubmatrix

Examples

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

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

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

# Matrices extractions of regions defined between Beaf32 <-> Beaf32 interactions
interactions_RF.mtx_lst <- ExtractSubmatrix(
    feature.gn = Beaf_Beaf.gni,
    hic.cmx_lst = HiC_Ctrl.cmx_lst,
    referencePoint.chr = "rf"
)
#> Warning: GRanges object contains 1847 out-of-bound ranges located on sequence
#>   2L. Note that ranges located on a sequence whose length is unknown (NA)
#>   or on a circular sequence are not considered out-of-bound (use
#>   seqlengths() and isCircular() to get the lengths and circularity flags
#>   of the underlying sequences). You can use trim() to trim these ranges.
#>   See ?`trim,GenomicRanges-method` for more information.
#> Warning: GRanges object contains 3694 out-of-bound ranges located on sequence
#>   2L. Note that ranges located on a sequence whose length is unknown (NA)
#>   or on a circular sequence are not considered out-of-bound (use
#>   seqlengths() and isCircular() to get the lengths and circularity flags
#>   of the underlying sequences). You can use trim() to trim these ranges.
#>   See ?`trim,GenomicRanges-method` for more information.

# Matrices extractions center on Beaf32 <-> Beaf32 pointinteraction
interactions_PF.mtx_lst <- ExtractSubmatrix(
    feature.gn = Beaf_Beaf.gni,
    hic.cmx_lst = HiC_Ctrl.cmx_lst,
    referencePoint.chr = "pf"
)