Documentation for SLiM function initializeGenomicElementType, which is a method of the SLiM class Initialize. Note that the R function is a stub, it does not do anything in R (except bring up this documentation). It will only do anything useful when used inside a slim_block function further nested in a slim_script function call, where it will be translated into valid SLiM code as part of a full SLiM script.

initializeGenomicElementType(id, mutationTypes, proportions, mutationMatrix)

Arguments

id

An object of type integer or string. Must be of length 1 (a singleton). See details for description.

mutationTypes

An object of type integer or MutationType object. See details for description.

proportions

An object of type numeric. See details for description.

mutationMatrix

An object of type null or float. The default value is NULL. See details for description.

Value

An object of type GenomicElementType object. Return will be of length 1 (a singleton)

Details

Documentation for this function can be found in the official SLiM manual: page 648.

Add a genomic element type at initialization time. The id must not already be used for any genomic element type in the simulation. The mutationTypes vector identifies the mutation types used by the genomic element, and the proportions vector should be of equal length, specifying the relative proportion of mutations that will be drawn from the corresponding mutation type (proportions do not need to add up to one; they are interpreted relatively). The id parameter may be either an integer giving the ID of the new genomic element type, or a string giving the name of the new genomic element type (such as "g5" to specify an ID of 5). The mutationTypes parameter may be either an integer vector representing the IDs of the desired mutation types, or an object vector of MutationType elements specified directly. The global symbol for the new genomic element type is immediately available; the return value also provides the new object. The mutationMatrix parameter is NULL by default, and in non-nucleotide-based models it must be NULL. In nucleotide-based models, on the other hand, it must be non-NULL, and therefore must be supplied. In that case, mutationMatrix should take one of two standard forms. For sequence-based mutation rates that depend upon only the single nucleotide at a mutation site, mutationMatrix should be a 4×4 float matrix, specifying mutation rates for an existing nucleotide state (rows from 0- 3 representing A/C/G/T) to each of the four possible derived nucleotide states (columns, with the same meaning): The mutation rates in this matrix are absolute rates, per nucleotide per gamete; they will be used by SLiM directly unless they are multiplied by a factor from the hotspot map (see initializeHotspotMap()). Rates in mutationMatrix that involve the mutation of a nucleotide to itself (A to A, C to C, etc.) are not used by SLiM and must be 0.0 by convention (shown above with asterisks). It is important to note that the order of the rows and columns used in SLiM, A/C/G/T, is not a universal convention; other sources will present substitution-rate/transition-rate matrices using different conventions, and so care must be taken when importing such matrices into SLiM. For sequence-based mutation rates that depend upon the trinucleotide sequence centered upon a mutation site (the adjacent bases to the left and right, in other words, as well as the mutating nucleotide itself), mutationMatrix should be a 64×4 float matrix, specifying mutation rates for the central nucleotide of an existing trinucleotide sequence (rows from 0-63, representing trinucleotides as described in the documentation for the ancestralNucleotides() method of Chromosome) to each of the four possible derived nucleotide states (columns from 0-3 for A/C/G/T as before): Note that in every case it is the central nucleotide of the trinucleotide sequence that is mutating, but rates can be specified independently based upon the nucleotides in the first and third positions as well, with this type of mutation matrix. Several helper functions are defined to construct common types of mutation matrices, such as mmJukesCantor() to create a mutation matrix for a Jukes-Cantor model; see section 25.18.1. See chapter 18 for practical examples of mutation matrices, and section 23.2.3 for further discussion of the mutational paradigm in nucleotide-based models.

Author

Benjamin C Haller (bhaller@benhaller.com) and Philipp W Messer (messer@cornell.edu)

Examples

## This just brings up the documentation:
initializeGenomicElementType()