meanBySample: Mean value by sample

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Calculate the mean value of a variable by sample over all variants

Usage

1
2
## S4 method for signature 'SeqVarGDSClass'
meanBySample(gdsobj, var.name, use.names=FALSE)

Arguments

gdsobj

A SeqVarGDSClass object with VCF data.

var.name

Character string with name of the variable, most likely "annotation/format/VARIABLE_NAME".

use.names

A logical indicating whether to assign sample IDs as names of the output vector.

Details

Mean values by variant can be calculated using seqApply(gdsobj, var.name, mean, na.rm=TRUE). Currently seqApply can only be used with the option margin="by.variant". This method provides a way to calculate mean values by sample.

Value

A numeric vector of mean values.

Author(s)

Stephanie Gogarten

See Also

SeqVarGDSClass, applyMethod, seqApply

Examples

1
2
3
gds <- seqOpen(seqExampleFileName("gds"))
head(meanBySample(gds, "annotation/format/DP", use.names=TRUE))
seqClose(gds)

SeqVarTools documentation built on Nov. 22, 2020, 2 a.m.