Description Usage Arguments Value Author(s) See Also Examples
View source: R/normalization.R
Convenience function for multiplying signal counts in one or more GRanges object by their normalization factors.
1 2 3 4 5 6 | applyNFsGRanges(
dataset.gr,
NF,
field = "score",
ncores = getOption("mc.cores", 2L)
)
|
dataset.gr |
A GRanges object with signal data in one or more metadata fields, or a list of such GRanges objects. |
NF |
One or more normalization factors to apply by multiplication. The
number of normalization factors should match the number of datasets in
|
field |
The metadata field(s) in |
ncores |
The number of cores to use for computations. Multicore only used if there are multiple datasets present. |
A GRanges object, or a list of GRanges objects.
Mike DeBerardine
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | # Apply NFs to a single GRanges
gr <- GRanges(seqnames = "chr1",
ranges = IRanges(1:3, 3:5),
strand = c("+", "+", "-"),
score = c(2, 3, 4))
gr
applyNFsGRanges(gr, NF = 0.5, ncores = 1)
# Apply NFs to a list of GRanges
gr2 <- gr
ranges(gr2) <- IRanges(4:6, 5:7)
grl <- list(gr, gr2)
grl
applyNFsGRanges(grl, NF = c(0.5, 0.75), ncores = 1)
# Apply NFs to a multiplexed GRanges
gr_multi <- gr
names(mcols(gr_multi)) <- "gr1"
gr_multi$gr2 <- c(3, 5, 7)
gr_multi
applyNFsGRanges(gr_multi, NF = c(2, 3), field = c("gr1", "gr2"),
ncores = 1)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.