estimateDispersion-methods: Estimate the Dispersion factor in a beta-binomial model.

estimateDispersionR Documentation

Estimate the Dispersion factor in a beta-binomial model.

Description

This function estimates the dispersion factor in a beta-binomial model of the nucleotide counts. This model assumes that the count for nucleotide j at position i is distributed after a beta-binomial X_ib ~ BB(n_i; alpha, beta_ij), where n_i is the coverage. The base and nucleotide specific parameter beta_ij is estimated from the local mean by the method-of-moments estimate, alpha is a shared overdispersion parameter. It is estimated via a numerical optimization of the likelihood under the null-hypothesis.

Usage

estimateDispersion(test, control, ...)

## S4 method for signature 'deepSNV,missing'
estimateDispersion(test, control, alternative = NULL, interval = c(0,1000))

## S4 method for signature 'matrix,matrix'
estimateDispersion(test, control, alternative = NULL, interval = c(0,1000))

Arguments

test

Either a deepSNV object, or a matrix with the test counts.

control

Missing if test is a deepSNV object, otherwise missing.

...

Additional param passed to specific methods

alternative

The alternative to be tested. One of "greater", "less", "two-sided" (default). If test is a deepSNV object, automatically taken from the corresponding slot if unspecified.

interval

The interval to be screened for the overdispersion factor. Default (0,1000).

Value

A deepSNV-class object if the input was a deepSNV object. Otherwise the loglikelihood and the estimated parameter.

Author(s)

Moritz Gerstung

Examples

data("RCC", package="deepSNV")
plot(RCC)
summary(RCC)[,1:6]
RCC.bb = estimateDispersion(RCC, alternative = "two.sided")
summary(RCC.bb)

gerstung-lab/deepSNV documentation built on June 3, 2022, 3:05 p.m.