Learn R Programming

coala (version 0.4.0)

feat_ignore_singletons: 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()

Arguments

Value

The feature, which can be added to a model using `+`.

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.

See Also

Other features: feat_growth, feat_migration, feat_mutation, feat_outgroup, feat_pop_merge, feat_recombination, feat_selection, feat_size_change, feat_unphased

Examples

Run this code
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

Run the code above in your browser using DataLab