locus: Loci

locusR Documentation

Loci

Description

This functions adds one or more loci to a model. A locus is a continuous stretch of DNA of a given length. All loci are simulated independently of each other, and are genetically unlinked. A model can contain a large number of different loci created with locus_single. This will, however, slow down the simulation. For performance reasons, it is better to add the same number of loci with averaged length using locus_averaged if this simplification is justifiable. Both can also be combined in a single model. In the results, the summary statistics for the loci are returned in order in which they are added to the model.

Usage

locus_single(length)

locus_averaged(number, length)

Arguments

length

The length of the locus in base pairs.

number

The number of loci to add.

Functions

  • locus_single(): Adds a single locus.

  • locus_averaged(): Adds multiple loci with equal length.

See Also

For adding three loci which are linked to each other: locus_trio

Examples

# A model with one locus of length 1005 bp:
coal_model(10) + locus_single(1005)
# This is equivalent to:
coal_model(10, 1, 1005)

# A model can contain multiple loci:
coal_model(5) + locus_single(100) + locus_single(200) + locus_single(300)
# Or more efficient with averaged length:
coal_model(5) + locus_averaged(3, 200)
# Or equivalently:
coal_model(5, 3, 200)

# Single and averaged loci can also be combined arbitrarily:
coal_model(15) + locus_averaged(10, 150) + locus_single(250)
coal_model(15, 10, 150) + locus_single(250) + locus_averaged(10, 350)

coala documentation built on Jan. 5, 2023, 5:11 p.m.