importGInteractions: Reading data from a ginteractions, hic, cool, or validPairs...

View source: R/importGInteractions.R

importGInteractionsR Documentation

Reading data from a ginteractions, hic, cool, or validPairs file

Description

Read a track object from a ginteractions, hic, mcool, or validPairs file

Usage

importGInteractions(
  file,
  format = c("ginteractions", "hic", "cool", "validPairs"),
  ranges = GRanges(),
  ignore.strand = TRUE,
  out = c("track", "GInteractions"),
  resolution = 1e+05,
  unit = c("BP", "FRAG"),
  normalization = c("NONE", "VC", "VC_SORT", "KR", "SCALE", "GW_KR", "GW_SCALE", "GW_VC",
    "INTER_KR", "INTER_SCALE", "INTER_VC", "balanced"),
  matrixType = c("observed", "oe", "expected"),
  ...
)

Arguments

file

The path to the file to read.

format

The format of import file. Could be ginteractions, hic, cool or validPairs

ranges

An object of GRanges to indicate the range to be imported. For .hic file, if the length of ranges is 2, the first range will be used as anchor 1 and the second range will be used as anchor 2.

ignore.strand

ignore the strand or not when do filter. default TRUE

out

output format. Default is track. Possible values: track, GInteractions.

resolution

Resolutions for the interaction data.

unit

BP (base pair) or FRAG (fragment) (.hic file only).

normalization

Type of normalization, NONE, VC, VC_SORT or KR for .hic and NONE, balanced for .cool.

matrixType

Type of matrix for .hic file. Available choices are "observed", "oe", and "expected". default is "observed".

...

NOT used.

Value

a track object

See Also

See Also as listResolutions, listChromosomes, readHicNormTypes

Examples

#import a ginteractions file
#gi <- system.file("extdata", "test.ginteractions.tsv", package="trackViewer",
#                       mustWork=TRUE)
#dat <- importGInteractions(file=gi, format="ginteractions",
#                   ranges=GRanges("chr7", IRanges(127471197, 127474697)))

##import a hic file
if(.Platform$OS.type!="windows"){
hic <- system.file("extdata", "test_chr22.hic", package = "trackViewer",
                       mustWork=TRUE)
dat <- importGInteractions(file=hic, format="hic", 
                           ranges=GRanges("22", IRanges(1500000, 100000000)))
}

##import a cool file
cool <- system.file("extdata", "test.mcool", package = "trackViewer",
                     mustWork=TRUE)
dat <- importGInteractions(file=cool, format="cool",
                           resolution = 2,
                           ranges=GRanges("chr1", IRanges(10, 28)))

##import a validPairs file
#validPairs <- system.file("extdata", "test.validPairs", package = "trackViewer",
#                       mustWork=TRUE)
#dat <- importGInteractions(file=validPairs, format="validPairs")


jianhong/trackViewer documentation built on March 17, 2024, 2:16 p.m.