meanBySample {SeqVarTools} | R Documentation |
Calculate the mean value of a variable by sample over all variants
## S4 method for signature 'SeqVarGDSClass' meanBySample(gdsobj, var.name, use.names=FALSE)
gdsobj |
A |
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. |
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.
A numeric vector of mean values.
Stephanie Gogarten
SeqVarGDSClass
,
applyMethod
,
seqApply
gds <- seqOpen(seqExampleFileName("gds")) head(meanBySample(gds, "annotation/format/DP", use.names=TRUE)) seqClose(gds)