FreeHiC directly from hic file

FreeHiCJuicer(
  file,
  chromosomes = NULL,
  pairs = NULL,
  unit = c("BP", "FRAG"),
  seqDepth = NULL,
  countScale = 1,
  noiseRate = 0,
  neighborZeroRate = 0,
  resolution = 50000L,
  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'), the resulting contact matrixes will include all the pairs of interaction (chr1_chr1, chr1_chr2, chr2_chr2).

pairs

A vector contains all the pair. The pair take format as '1_1' or 'chr1_chr1', both means the contact between chromosome1 and chromosome1. If pair presents, chromosomes argument will be ignore.

unit

Unit only supports c('BP', 'FRAG'). 'BP' means base-pair, and 'FRAG' means fragment.

seqDepth

The desired sequence depth.

countScale

The scale of counts. A number larger than 0. If both seqDepth and countScale are provided. Choose the larger one.

noiseRate

The noise rate for contact matrix. 0 - 1 scale

neighborZeroRate

The rate for neighborhood noise rate. 0 - 1 scale

resolution

The resolution used in the contacts matrix. A positive number. The resolution must be a value from following list.

  • unit: BP

    • 2500000

    • 1000000

    • 500000

    • 250000

    • 100000

    • 50000

    • 25000

    • 10000

    • 5000

  • unit: FRAG

    • 500

    • 250

    • 100

    • 50

    • 20

    • 5

    • 2

    • 1

verbose

TRUE or FALSE. Whether print information.

Value

A list contains simulated contact matrix and basic information of hic data

Examples

library(FreeHiCLite) ## Local file location localFilePath = system.file('extdata', 'example.hic', package = 'FreeHiCLite') ## Chromosomes needs to be extracted chromosomes = c('chr1', 'chr2') ## Pairs needs to be extracted pairs = c('1_1', '1_2') unit = 'BP' resolution = 500000L seqDepth <- 20000 countScale <- 0 noiseRate <- 0.1 neighborZeroRate <- 0 ## pass chrosomes into function, it will contains all the interaction pairs res <- FreeHiCJuicer(file=localFilePath, chromosomes=chromosomes, pairs = NULL, unit=unit, resolution=resolution, seqDepth = seqDepth, countScale = countScale, noiseRate = noiseRate, neighborZeroRate = neighborZeroRate)
#> You are trying to access file from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/FreeHiCLite/extdata/example.hic. Make sure you provide a valid path.
#> Use pairs: 1_1, 1_2, 2_2
str(res)
#> List of 4 #> $ 2_2 : int [1:4588, 1:3] 0 0 500000 500000 1000000 500000 1000000 1500000 1500000 2000000 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : chr [1:3] "x" "y" "counts" #> $ 1_2 : int [1:386, 1:3] 53500000 168500000 244000000 227000000 64500000 168000000 45500000 183000000 243500000 171500000 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : chr [1:3] "x" "y" "counts" #> $ 1_1 : int [1:3989, 1:3] 500000 500000 1000000 1500000 1500000 2000000 1500000 2000000 2500000 1000000 ... #> ..- attr(*, "dimnames")=List of 2 #> .. ..$ : NULL #> .. ..$ : chr [1:3] "x" "y" "counts" #> $ information:List of 4 #> ..$ genomeID : chr "hg19" #> ..$ resolution :List of 2 #> .. ..$ BP : int [1:3] 2500000 500000 5000 #> .. ..$ FRAG: int(0) #> ..$ pairs : chr [1:6] "1_1" "1_2" "1_3" "2_2" ... #> ..$ chromosomeSizes:'data.frame': 26 obs. of 2 variables: #> .. ..$ chromosome: chr [1:26] "1" "10" "11" "12" ... #> .. ..$ size : int [1:26] 249250621 135534747 135006516 133851895 115169878 107349540 102531392 90354753 81195210 78077248 ... #> ..- attr(*, "class")= chr [1:2] "juicer" "information"