set.stats {gaston}R Documentation

Basic statistics for a bed.matrix

Description

Return an updated bed.matrix with new variables for several basic statistics.

Usage

set.stats(x, set.p = TRUE, set.mu_sigma = TRUE, 
          verbose = getOption("gaston.verbose",TRUE))

set.stats.snps(x, set.p = TRUE, set.mu_sigma = TRUE, 
               verbose = getOption("gaston.verbose",TRUE)) 

set.stats.ped(x, verbose = getOption("gaston.verbose",TRUE))

Arguments

x

A bed.matrix

set.p

If TRUE, x@p is updated

set.mu_sigma

If TRUE, x@mu and x@sigma are updated

verbose

If TRUE, display information on the function actions

Details

set.stats is called by default by all functions that create a bed.matrix, unless the global option gaston.auto.set.stats is FALSE (cf example below).

set.stats and set.stats.ped update x@ped, adding the following variables:

set.stats and set.stats.snps update x@snps, adding the following variables:

If set.p = TRUE, x@p is updated with the alternate allele frequency.

If set.mu_sigma = TRUE, x@mu is updated with the genotype mean (equal to 2*x@p) and x@sigma with the genotype standard deviation (should be approximately sqrt(2*x@p*(1-x@p)) under Hardy-Weinberg Equilibrium).

Value

A bed.matrix similar to x, with slots updated as described above.

Author(s)

Hervé Perdry and Claire Dandine-Roulland

See Also

set.hwe, set.genomic.sex

Examples

# Disable auto set stats :
options(gaston.auto.set.stats = FALSE)

# Load data
data(TTN)
x <- as.bed.matrix(TTN.gen, TTN.fam, TTN.bim)
str(x@ped)
str(x@snps)

# Compute statistics
x <- set.stats(x)
str(x@ped)
str(x@snps)

# restore default behavior
options(gaston.auto.set.stats = TRUE)

[Package gaston version 1.6 Index]