View source: R/fitMeanVarCurve.R

estimateVarRatio | R Documentation |

`bioCond`

ObjectsGiven a set of `bioCond`

objects assumed to be associated with
the same mean-variance curve, `estimateVarRatio`

robustly estimates their relative variance ratio factors, by selecting one
of the `bioCond`

s as the base condition and comparing the others to it.

estimateVarRatio( conds, base.cond = NULL, subset = NULL, invariant = NULL, no.rep.rv = NULL )

`conds` |
A list of |

`base.cond` |
An optional positive integer or character name indexing the
base |

`subset` |
An optional vector specifying the subset of intervals to be
used for measuring the variation levels. Defaults to the intervals
occupied by all the |

`invariant` |
An optional non-negative real specifying the upper bound
of difference in mean signal intensity
for a genomic interval to be treated
as invariant between two |

`no.rep.rv` |
A positive real specifying the (relative) variance ratio
factor of those |

Technically, `estimateVarRatio`

uses 1 as the (relative) variance ratio
factor of the base `bioCond`

, and estimates the variance ratio
factors of the other `bioCond`

s by separately comparing each of them to
the base. Refer to `varRatio`

for details about comparing the
variance ratio factors of two `bioCond`

s by using their invariant
genomic intervals.

If the base `bioCond`

is not explicitly specified by users,
`estimateVarRatio`

will measure the variation level of each
`bioCond`

containing replicate samples. Technically, the variation
levels are calculated by applying the median ratio strategy to the observed
variances of the `bioCond`

s. This process is rather similar to the one
for estimating size factors of ChIP-seq samples (see also
`estimateSizeFactors`

). After that, the `bioCond`

whose
variation level is closest to 1 is selected as the base (with the exception
that, if there are only two `bioCond`

s that contain replicate samples,
the function will always use the `bioCond`

with the lower variation
level as the base, for avoiding potential uncertainty in selection results
due to limited numerical precision).

A named vector of the estimated relative variance ratio factors,
with the names being those of the corresponding `bioCond`

objects. Besides, the following attributes are associated with the
vector:

`var.level`

Variation levels of the

`bioCond`

objects. Present only when the base`bioCond`

is automatically selected by the function.`base.cond`

Name of the base

`bioCond`

.`no.rep.rv`

Variance ratio factor of the

`bioCond`

s with no replicate samples. Present only when it's ever been used.

Tu, S., et al., *MAnorm2 for quantitatively comparing
groups of ChIP-seq samples.* Genome Res, 2021.
**31**(1): p. 131-145.

`bioCond`

for creating a `bioCond`

object;
`fitMeanVarCurve`

for fitting a mean-variance curve for
a set of `bioCond`

objects; `varRatio`

for a formal
description of variance ratio factor.

data(H3K27Ac, package = "MAnorm2") attr(H3K27Ac, "metaInfo") ## Estimate the relative variance ratio factors of cell lines. # Perform the MA normalization and construct bioConds to represent cell # lines. norm <- normalize(H3K27Ac, 4, 9) norm <- normalize(norm, 5:6, 10:11) norm <- normalize(norm, 7:8, 12:13) conds <- list(GM12890 = bioCond(norm[4], norm[9], name = "GM12890"), GM12891 = bioCond(norm[5:6], norm[10:11], name = "GM12891"), GM12892 = bioCond(norm[7:8], norm[12:13], name = "GM12892")) autosome <- !(H3K27Ac$chrom %in% c("chrX", "chrY")) conds <- normBioCond(conds, common.peak.regions = autosome) # Automatically select the base bioCond. estimateVarRatio(conds) # Explicitly specify the base bioCond. estimateVarRatio(conds, base.cond = "GM12891")

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.