Read .hic file generated by Juicebox. Currently can be used for both local and remote file.

readJuicerFragmentSites(file, chromosomes, verbose = TRUE)

Arguments

file

Filename can be a local path or remote path. The remote path full list can be obtained from http://aidenlab.org/data.html.

chromosomes

A vector contains all the chromosomes. For example c('chr1', 'chr2')

verbose

A logical value, indicate whether print message

Value

A list contains all the chromosomes and their fragment sites.

Details

This function is heavily adopted from both java version juicebox Dump function and c++ version straw.

The restriction site file is required for juicer to provide a hic file with fragment level resolution.

Examples

library(FreeHiCLite) ## Remote file location. The reomte file include downloading, it may take a while remoteFilePath = 'https://hicfiles.s3.amazonaws.com/hiseq/gm12878/in-situ/combined.hic' ## Local file location localFilePath = system.file('extdata', 'example.hic', package = 'FreeHiCLite') # \donttest{ fragSites <- readJuicerFragmentSites(remoteFilePath, c('chr1', 'chr2'))
#> You are trying to access file from: https://hicfiles.s3.amazonaws.com/hiseq/gm12878/in-situ/combined.hic. Make sure you provide a valid path.
#> Remote file can take a while. #> The full list of remote files can be found in http://aidenlab.org/data.html
str(fragSites)
#> List of 2 #> $ 1: int [1:576357] 11160 12411 12461 12686 12829 13315 13420 13566 13698 13915 ... #> $ 2: int [1:578290] 11514 11874 12160 12371 12600 12678 13547 13774 14180 15635 ...
# }