Skip to contents

Given a hi-c file or InteractionArray, pseudocounts are added to raw counts and the median of the foreground over the background is added as a score for each given interaction.

Usage

# S4 method for class 'GInteractions,character'
scoreInteractions(
  x,
  hicFile,
  fgSize = 0,
  bg = "bowtie",
  bgGap = 0,
  bgSize = 5,
  pseudo = 5,
  pruneUnder = 0,
  truncate = F,
  resolution,
  norm = "NONE"
)

# S4 method for class 'InteractionArray,missing'
scoreInteractions(x, fgSize, bg, bgGap, bgSize, pseudo, pruneUnder, truncate)

Arguments

x

GInteractions object or InteractionArray object containing interactions of interest See also `mariner::pixelsToMatrices`

fgSize

manhattan distance surrounding center pixel to include in foreground selection See also parameter `n` in `mariner::selectRadius`

bg

character keyword for background selection shape One of `c("bowtie", "donut")`

bgGap

number of pixels between foreground and background shapes

bgSize

Integer describing the width (in pixels) of the background shape

pseudo

number of pseudo counts to add to raw Hi-C counts

pruneUnder

numeric, all loops with raw counts less than this value will have score set to NA

truncate

logical indicating whether to set any values above the 99th percentile to the 99th percentile value

resolution

Integer (numeric) describing the resolution (range widths) of the paired data. Used only if GInteractions object is supplied for x. By default, will match the width of regions in `x`

norm

String (length one character vector) describing the Hi-C normalization to apply. Use `strawr::readHicNormTypes()` to see accepted values for each file in `files`. Required only if GInteractions object is supplied for x.

file

Character file paths to a `.hic` file. Required only if GInteractions object is supplied for x. See also `qc_scoreInteractions`

interactions

GInteraction object of interactions from Hi-C data

Examples

hicFile <- "inst/extdata/GM12878_chr22.hic"

mergedLoops <- mergeAnchors(GM12878_10KbLoops, 1)
connections <- connectLoopAnchors(mergedLoops, 1e6)

scoreInteractions(connections, hicFile, mergedLoops)
#> Error in fgSize + bgGap: non-numeric argument to binary operator