heterozygosity | R Documentation |
Calculate heterozygosity and homozygosity by variant or by sample
## S4 method for signature 'SeqVarGDSClass'
heterozygosity(gdsobj, margin=c("by.variant", "by.sample"),
use.names=FALSE, parallel=FALSE)
## S4 method for signature 'SeqVarGDSClass'
homozygosity(gdsobj, allele=c("any", "ref", "alt"), margin=c("by.variant", "by.sample"),
use.names=FALSE, parallel=FALSE)
## S4 method for signature 'SeqVarGDSClass'
hethom(gdsobj, use.names=FALSE)
gdsobj |
A |
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 or samples IDs as names of the output vector. |
allele |
Possible values are "any", "ref," or "alt," indicating which alleles to consider when calculating homozygosity. |
parallel |
Logical, numeric, or other value to control parallel
processing; see |
heterozyogosity
calulates the fraction of heterozygous genotypes
in a GDS object, either by variant or by sample.
homozygosity
calculates the rate of homozygous genotypes in a
GDS object, either by sample or by variant. If allele="any"
,
all homozygous genotypes are considered (reference or any alternate
allele). If allele="ref"
, only reference homozygotes are
considered. If allele="alt"
, any alternate allele homozygote
is considered. For example, "ref" will count "0/0" genotypes only,
"alt" will count "1/1", "2/2", etc. (but not "0/0"), and "any" will
count all of the above.
hethom
calculates the ratio of heterozygous genotypes to alternate homozygous genotypes by sample.
A numeric vector of heterozyogity or homozygosity 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.
Stephanie Gogarten
SeqVarGDSClass
,
applyMethod
,
alleleFrequency
gds <- seqOpen(seqExampleFileName("gds"))
head(heterozygosity(gds, margin="by.variant"))
head(homozygosity(gds, allele="any", margin="by.variant"))
head(homozygosity(gds, allele="ref", margin="by.variant"))
head(homozygosity(gds, allele="alt", margin="by.variant"))
## Het/Hom Non-Ref by sample
head(hethom(gds))
seqClose(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.