cooler_methods | R Documentation |
These are a set of methods for working with data in cooler file format.
getChrIdx(chr.length, chr, step)
getChrCGFromCools(files, chr, step, index.gr, work.dir, exp.name,
coldata, norm.factor=NULL)
cg2bedgraph2(cg, out.dir, prefix)
chr.length |
The length of a chromosome. |
step |
The resolution of the data inside the cooler file. |
files |
A vector of cooler file names. |
chr |
The target chromosome to be read. |
index.gr |
A |
work.dir |
Directory for saving temporary files. |
exp.name |
The name of the experiment, will be appended all output file names. |
coldata |
A |
cg |
A |
out.dir |
A directory in which individual bedgraph2 (BG2) files are to be written. |
prefix |
A prefix for all output files; e.g. "treatment_study_". |
norm.factor |
The normalization factor |
These methods allow for the normalization of cooler files. Users must
create their own index, for which we provide getChrIdx
, which
is an input into getChrCGFromCools
, which uses HiCBricks to
access the cooler files, and returns a ContactGroup
object. Users can then follow the standard pipeline, and save their
data in bedgraph2 (BG2) format using cg2bedgraph2
. cooler
provides a tool to convert this format to cooler and users are
encouraged to make use of this tool. Note that HiCBricks expects
multiple resolutions in the cooler file.
For getChrIdx
a GRanges
object with coordinates
for each bin. For getChrCGFromCools
, a
ContactGroup
object. There is nothing returned by
cg2bedgraph2
.
ContactGroup
## Not run:
coolerDir <- system.file("cooler", package = "bnbc")
cools <- list.files(coolerDir, pattern="cool$", full.names=TRUE)
step <- 4e4
ixns <- bnbc:::getGenomeIdx(seqlengths(BSgenome.Hsapiens.UCSC.hg19)["chr22"], step)
data(cgEx)
cool.cg <- bnbc:::getChrCGFromCools(files = cools,
chr = "chr22",
step=step,
index.gr=ixns,
work.dir="tmp.dir",
exp.name="example_case",
colData = colData(cgEx)[1:2,])
all.equal(contacts(cgEx)[[1]], contacts(cool.cg)[[1]])
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.