seqUnitFilterCond | R Documentation |
Filters out the unit variants according to MAF, MAC and missing rates.
seqUnitFilterCond(gdsfile, units, maf=NaN, mac=1L, missing.rate=NaN,
minsize=1L, parallel=seqGetParallel(), verbose=TRUE)
gdsfile |
a |
units |
a list of units of selected variants, with S3 class
|
maf |
minimum minor reference allele frequency, or a range of MAF
|
mac |
minimum minor reference allele count, or a range of MAC
|
missing.rate |
maximum missing genotype rate |
minsize |
the minimum of unit size |
parallel |
|
verbose |
if |
A S3 object with the class name "SeqUnitListClass" and two components
(desp
and index
): the first is a data.frame with columns "chr",
"start" and "end", and the second is list of integer vectors (the variant
indices).
Xiuwen Zheng
seqUnitApply
, seqUnitCreate
,
seqUnitSubset
, seqUnitMerge
# open the GDS file
gdsfile <- seqOpen(seqExampleFileName("gds"))
unit1 <- seqUnitSlidingWindows(gdsfile)
unit1 # "desp" "index"
# only rare variants
newunit <- seqUnitFilterCond(gdsfile, unit1, maf=c(0, 0.01))
newunit
# excluded variants
exvar <- setdiff(unique(unlist(unit1$index)), unique(unlist(newunit$index)))
seqSetFilter(gdsfile, variant.sel=exvar)
maf <- seqAlleleFreq(gdsfile, minor=TRUE)
table(maf > 0)
summary(maf[maf > 0]) # > 0.01
# close the GDS file
seqClose(gdsfile)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.