alleleFrequency | R Documentation |
Calculate allele frequency for each variant
## S4 method for signature 'SeqVarGDSClass'
alleleFrequency(gdsobj, n=0, use.names=FALSE, parallel=FALSE)
## S4 method for signature 'SeqVarData'
alleleFrequency(gdsobj, n=0, use.names=FALSE, sex.adjust=TRUE, male.diploid=TRUE,
genome.build=c("hg19", "hg38"), parallel=FALSE)
## S4 method for signature 'SeqVarGDSClass'
alleleCount(gdsobj, n=0, use.names=FALSE, parallel=FALSE)
## S4 method for signature 'SeqVarData'
alleleCount(gdsobj, n=0, use.names=FALSE, sex.adjust=TRUE, male.diploid=TRUE,
genome.build=c("hg19", "hg38"), parallel=FALSE)
## S4 method for signature 'SeqVarData'
minorAlleleCount(gdsobj, use.names=FALSE, sex.adjust=TRUE, male.diploid=TRUE,
genome.build=c("hg19", "hg38"), parallel=FALSE)
gdsobj |
A |
n |
An integer indicating which allele to calculate the frequency
of. |
use.names |
A logical indicating whether to assign variant IDs as names of the output vector. |
sex.adjust |
Logical for whether to adjust frequency calculations based on sex. If |
male.diploid |
Logical for whether males on sex chromosomes are coded as diploid. |
genome.build |
A character sting indicating genome build; used to identify pseudoautosomal regions on the X and Y chromosomes. |
parallel |
Logical, numeric, or other value to control parallel
processing; see |
Frequency or count can be calculated over any allele, specified by the argument
n
. Default is the reference allele frequency (n=0
).
The SeqVarData
method will calculate frequency and count correctly for X and Y chromosomes, provided a column "sex" is included in the sampleData slot with values "M"/"F" or 1/2. Arguments given to this method are passed to the parent method for SeqVarGDSClass
. If the ploidy of the "genotype" node in the GDS file is 2, the default assumption is that genotypes for males on sex chromosomes are coded as diploid, "0/0" or "1/1". If this is not the case, use male.diploid=FALSE
.
For multiallelic variants, the minor allele count will be the smaller of the reference allele count or the sum of all alternate allele counts.
A numeric vector of allele frequencies.
Stephanie Gogarten
chromWithPAR
,
SeqVarGDSClass
,
applyMethod
,
heterozygosity
gds <- seqOpen(seqExampleFileName("gds"))
head(alleleFrequency(gds))
head(alleleFrequency(gds, n=1))
head(alleleFrequency(gds, n=2))
seqClose(gds)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.