| seqAlleleFreq {SeqArray} | R Documentation |
Calculates the allele frequencies or counts.
seqAlleleFreq(gdsfile, ref.allele=0L, .progress=FALSE, parallel=seqGetParallel()) seqAlleleCount(gdsfile, ref.allele=0L, .progress=FALSE, parallel=seqGetParallel())
gdsfile |
a |
ref.allele |
|
.progress |
if |
parallel |
|
If ref.allele=NULL, the function returns a list of allele
frequencies/counts according to all allele per site. If ref.allele is a
single numeric value (like 0L), it returns a numeric/integer vector for
the specified allele (0L for the reference allele, 1L for the
first alternative allele, etc). If ref.allele is a numeric vector,
ref.allele specifies each allele per site. If ref.allele is a
character vector, ref.allele specifies the desired allele for each site
(e.g, ancestral allele for the derived allele frequency/count).
Xiuwen Zheng
seqNumAllele, seqMissing,
seqParallel, seqGetParallel
# the GDS file
(gds.fn <- seqExampleFileName("gds"))
# display
f <- seqOpen(gds.fn)
# return a list
head(seqAlleleFreq(f, NULL, .progress=TRUE))
# return a numeric vector
summary(seqAlleleFreq(f, 0L, .progress=TRUE))
# return a numeric vector, AA is ancestral allele
AA <- toupper(seqGetData(f, "annotation/info/AA")$data)
head(seqAlleleFreq(f, AA))
# allele counts
head(seqAlleleCount(f, NULL, .progress=TRUE))
head(seqAlleleCount(f, 0L, .progress=TRUE))
head(seqAlleleCount(f, AA, .progress=TRUE))
# close the GDS file
seqClose(f)