Learn R Programming

SeqVarTools (version 1.10.0)

missingGenotypeRate: Missing genotype rate

Description

Calculate missing genotype rate by variant or by sample

Usage

"missingGenotypeRate"(gdsobj, margin=c("by.variant", "by.sample"), use.names=FALSE)

Arguments

gdsobj
A SeqVarGDSClass object with VCF data.
margin
Possible values are "by.variant" or "by.sample," indicating whether the calculation should be done over all samples for each variant, or over all variants for each sample.
use.names
A logical indicating whether to assign variant IDs as names of the output vector.

Value

A numeric vector of missing genotype rates. If margin="by.variant", the vector will have length equal to the number of variants in the GDS object. If margin="by.sample", the vector will have length equal to the number of samples.

Details

Calculates the fraction of missing genotypes in a GDS object, either by variant or by sample.

See Also

SeqVarGDSClass, applyMethod, getGenotype

Examples

Run this code
gds <- seqOpen(seqExampleFileName("gds"))
head(missingGenotypeRate(gds, margin="by.variant"))
head(missingGenotypeRate(gds, margin="by.sample"))
seqClose(gds)

Run the code above in your browser using DataLab