feat_outgroup: Feature: Outgroup

View source: R/feature_outgroup.R

feat_outgroupR Documentation

Feature: Outgroup

Description

This feature declares an existing population as outgroup. Outgroups are used to determine the ancestral allele in finite sites simulations and are required there. All individuals of the outgroup are ignored when calculating summary statistics. If the outgroup consists of multiple individuals, all positions where the individuals have different alleles are ignored.

Usage

feat_outgroup(population, locus_group = "all")

Arguments

population

The population that is marked as outgroup. If finite-sites mutation models are used, the last population must be specified as outgroup.

locus_group

The loci for which this features is used. Can either be "all" (default), in which case the feature is used for simulating all loci, or a numeric vector. In the latter case, the feature is only used for the loci added in locus_ commands with the corresponding index starting from 1 in order in which the commands where added to the model. For example, if a model has locus_single(10) + locus_averaged(10, 11) + locus_single(12) and this argument is c(2, 3), than the feature is used for all but the first locus (that is locus 2 - 12).

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_ignore_singletons(), feat_migration(), feat_mutation(), feat_pop_merge(), feat_recombination(), feat_selection(), feat_size_change(), feat_unphased()

Examples

# A simple finite sites model
model <- coal_model(c(4, 6, 1), 2, 10) +
   feat_outgroup(3) +
   feat_pop_merge(0.5, 2, 1) +
   feat_pop_merge(2, 3, 1) +
   feat_mutation(5, model = "GTR", gtr_rates = 1:6)

statgenlmu/coala documentation built on March 5, 2024, 10:49 p.m.