extracts Hi-C data from a .hic file

bb_readHic(
  hic,
  chrom,
  params = NULL,
  chromstart = NULL,
  chromend = NULL,
  resolution = "auto",
  zrange = NULL,
  norm = "KR",
  res_scale = "BP",
  dataType = "observed",
  assembly = "hg19",
  altchrom = NULL,
  altchromstart = NULL,
  altchromend = NULL
)

Arguments

hic

path to .hic file

chrom

chromosome of desired region

params

an optional "bb_params" object space containing relevant function parameters

chromstart

start position

chromend

end position

resolution

the width of each pixel; "auto" will attempt to choose a resolution (in basepairs) based on the size of the region

zrange

the range of interaction scores to plot, where extreme values will be set to the max or min; if null, zrange will be set to (0, max(data))

norm

hic data normalization; must be found in hic file

res_scale

resolution scale; options are "BP" and "FRAG"

dataType

type of data to be returned; options are "observed" and "oe"

assembly

desired genome assembly

altchrom

if looking at region between two different chromosomes, this is the specified alternative chromosome

altchromstart

if looking at region between two different chromosomes, start position of altchrom

altchromend

if looking at region between two different chromsomes, end position of altchrom

Value

Function will return a 3-column dataframe: chrom, altchrom, counts

Examples

download.file("https://www.encodeproject.org/files/ENCFF606XNW/@download/ENCFF606XNW.hic", destfile = "ENCFF606XNW.hic", method = "auto")
bb_readHic(hic = "./ENCFF606XNW.hic", chrom = "chr1")
bb_readHic(hic = "./ENCFF606XNW.hic", chrom = "chr1", chromstart = 22500000, chromend = 23200000, zrange = c(0, 125))
bb_readHic(hic = "./ENCFF606XNW.hic", chrom = "chr1", altchrom = "chr2")