Count the number of read pairs mapped to each bin across multiple Hi-C libraries.
a character vector containing paths to the index files
an integer scalar specifying the width of each bin
A logical scalar indicating whether the output regions should be limited to entries in
The genome is first split into non-overlapping adjacent bins of size
width, which are rounded to the nearest restriction site.
The marginal count for each bin is defined as the number of reads in the library mapped to the bin.
This acts as a proxy for genomic coverage by treating Hi-C data as single-end.
Each row of the output RangedSummarizedExperiment refers to a single bin in the linear genome, instead of a bin pair in the interaction space.
The count matrix for all row can be extracted using the
Bin coordinates can be extracted using the
Larger marginal counts can be collected by increasing the
However, this comes at the cost of spatial resolution as adjacent events in the same bin can no longer be distinguished.
Note that no filtering is performed to remove empty bins.
This is meant to make it easier to match up results with the output of
squareCounts, as anchor IDs are directly comparable.
restrict.regions=TRUE, only counts for bins in chromosomes in
param$fragments are returned.
Counting will consider the values of
pairParam for more details.
A RangedSummarizedExperiment object containing the marginal counts for each bin.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
hic.file <- system.file("exdata", "hic_sort.bam", package="diffHic") cuts <- readRDS(system.file("exdata", "cuts.rds", package="diffHic")) param <- pairParam(fragments=cuts) # Setting up the parameters fout <- tempfile(fileext=".h5") invisible(preparePairs(hic.file, param, fout)) # Collating to count combinations. mar <- marginCounts(fout, param, width=10) head(assay(mar)) mar <- marginCounts(fout, param, width=50) head(assay(mar)) mar <- marginCounts(fout, param, width=100) head(assay(mar)) # Attempting with other parameters. mar <- marginCounts(fout, reform(param, restrict="chrA"), width=50) head(assay(mar)) mar <- marginCounts(fout, reform(param, cap=1), width=50) head(assay(mar)) mar <- marginCounts(fout, reform(param, discard=GRanges("chrA", IRanges(1, 50))), width=50) head(assay(mar))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.