Description Usage Arguments Details Value Author(s) See Also Examples
Get the total number of read pairs in a set of Hi-C libraries.
1 | totalCounts(files, param)
|
files |
a character vector containing paths to the index files generated from each Hi-C library |
param |
a |
As the name suggests, this function counts the total number of read pairs in each index file prepared by preparePairs.
Use of param$fragments ensures that the chromosome names in each index file are consistent with those in the desired genome (e.g., from cutGenome).
Counting will also consider the values of restrict, discard and cap in param.
An integer vector is returned containing the total number of read pairs in each library.
Aaron Lun
preparePairs,
cutGenome,
pairParam,
squareCounts
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(cuts)
# Setting up the parameters
fout <- tempfile(fileext=".h5")
invisible(preparePairs(hic.file, param, file=fout))
# Counting totals, and comparing them.
totalCounts(fout, param)
squareCounts(fout, param, width=10)$totals
new.param <- reform(param, restrict="chrA")
totalCounts(fout, new.param)
squareCounts(fout, new.param, width=10)$totals
new.param <- reform(param, discard=GRanges("chrA", IRanges(1, 50)))
totalCounts(fout, new.param)
squareCounts(fout, new.param, width=10)$totals
new.param <- reform(param, cap=1)
totalCounts(fout, new.param)
squareCounts(fout, new.param, width=10)$totals
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.