readHic {plotgardener} | R Documentation |
Read a .hic file and return Hi-C data as a dataframe
readHic( file, chrom, chromstart = NULL, chromend = NULL, altchrom = NULL, altchromstart = NULL, altchromend = NULL, assembly = "hg38", resolution = "auto", res_scale = "BP", zrange = NULL, norm = "KR", matrix = "observed", params = NULL, quiet = FALSE )
file |
A character value specifying the path to the .hic file. |
chrom |
Chromosome of data, as a string. |
chromstart |
Integer start position on chromosome. |
chromend |
Integer end position on chromosome. |
altchrom |
Alternate chromosome for interchromosomal data, as a string. |
altchromstart |
Alternate chromosome integer start position for interchromosomal data. |
altchromend |
Alternate chromosome integer end position for interchromosomal data. |
assembly |
Default genome assembly as a string or a
assembly object.
Default value is |
resolution |
A numeric specifying the width of each pixel. "auto" will attempt to choose a resolution in basepairs based on the size of the region. |
res_scale |
A character value specifying the resolution scale.
Default value is
|
zrange |
A numeric vector of length 2 specifying the range of interaction scores, where extreme values will be set to the max or min. |
norm |
Character value specifying hic data normalization method.
This value must be found in the .hic file.
Default value is |
matrix |
Character value indicating the type of matrix to output.
Default value is
|
params |
An optional pgParams object containing relevant function parameters. |
quiet |
A logical indicating whether or not to print messages. |
Returns a 3-column dataframe in sparse upper triangular
format with the following columns: chrom
, altchrom
,
counts
.
hicFile <- system.file("extdata/test_chr22.hic", package="plotgardenerData") ## Read in data for all chr22 file at 2.5Mb bp resolution hicData <- readHic(file = hicFile, chrom = "chr22", assembly = "hg19", resolution = 2500000) ## Read in region `chr22:20000000-47500000` at 100 Kb resolution hicData10Kb <- readHic(file = hicFile, chrom = "chr22", chromstart = 20000000, chromend = 47500000, assembly = "hg19", resolution = 100000)