feat_unphased: Feature: Unphased Sequences

View source: R/feature_unphased.R

feat_unphasedR Documentation

Feature: Unphased Sequences


This simulates unphased data by randomly mixing the sites within one individual. Each position is randomly taken from a phased chromosome..


feat_unphased(samples_per_ind, locus_group = "all")



The number of pseudo-chromosomes that are created from the phased chromosomes for each individual.


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).


For each individual, ploidy chromosomes are simulated, and samples_per_ind pseudo-chromosomes are created of these.


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

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_outgroup(), feat_pop_merge(), feat_recombination(), feat_selection(), feat_size_change()


# Simulate unphased data in a diploid population
model <- coal_model(10, 1, ploidy = 2) +
  feat_mutation(10) +
  feat_unphased(2) +

# The same as before, but return only one chromosome for
# each individual:
model <- coal_model(10, 1, ploidy = 2) +
  feat_mutation(10) +
  feat_unphased(1) +

coala documentation built on May 29, 2024, 11:14 a.m.