Skip to contents

Fetch interactions from a File object

Usage

fetch(
  file,
  range1 = "",
  range2 = "",
  normalization = "NONE",
  count_type = "int",
  join = FALSE,
  query_type = "UCSC",
  type = "df"
)

Arguments

file

file from which interactions should be fetched.

range1

first set of genomic coordinates of the region to be queried. Accepted formats are UCSC or BED format. When not provided, genome-wide interactions will be returned.

range2

second set of genomic coordinates of the region to be queried. When not provided, range2 is assumed to be identical to range1.

normalization

name of the normalization factors used to balance interactions. Specify "NONE" to return raw interactions.

count_type

data type used to fetch interactions. Should be "int" or "float"

join

join genomic coordinates onto pixels. When TRUE, interactions will be returned in bedgraph2 format. When FALSE, interactions will be returned in COO format. Ignored when type="dense".

query_type

type of the queries provided through range1 and range2 parameters. Types of query supported: "UCSC", "BED".

type

interactions format. Supported formats: "df", "dense".

Value

a DataFrame or Matrix object with the interactions for the given query.

Examples

if (FALSE) {
f <- File("interactions.hic",
          1000000)
fetch(f)                             # Fetch genome-wide interactions
fetch(f, "chr2L")                    # Fetch interactions overlapping a symmetric query
fetch(f,
      "chr2L:0-10,000,000",
      "chr3L:10,000,000-20,000,000") # Fetch interactions overlapping an asymmetric query
fetch(f, normalization="ICE")        # Fetch ICE-normalized interactions
fetch(f, join=TRUE)                  # Fetch interactions together with their genomic coordinates
fetch(f,
      "chr1\t0\t10000000",
      query_type="BED")              # Fetch interactions given a query in BED format
fetch(f, type="dense")               # Fetch interactions in dense format (i.e. as a Matrix)
}