feat_ignore_singletons {coala} | R Documentation |
Feature: Ignore Singletons
Description
Mutations that are observed in just one haplotype ('singletons') are often regarded as likely candidates for sequencing errors. Sometimes, it can be advantageous to exclude them from an analysis. This feature removes all singletons from the simulated data before the summary statistics are calculated.
Usage
feat_ignore_singletons(locus_group = "all")
Arguments
locus_group |
The loci for which this features is used. Can either be
|
Details
This function assumes that a singleton is a mutation for which the derived allele is observed exactly once in all sequences, regardless of the population structure.
Value
The feature, which can be added to a model created with
coal_model
using +
.
See Also
For creating a model: coal_model
Other features:
feat_growth()
,
feat_migration()
,
feat_mutation()
,
feat_outgroup()
,
feat_pop_merge()
,
feat_recombination()
,
feat_selection()
,
feat_size_change()
,
feat_unphased()
Examples
model <- coal_model(2, 1) +
feat_mutation(10) +
feat_ignore_singletons() +
sumstat_sfs("n_mut", transformation = sum)
# In this model, all mutations are singletons. Therefore,
# the number of mutations is 0 when removing singletons:
simulate(model)$n_mut