Documentation for Species class from SLiM

Details

This class represents a species in a SLiM simulation. In a single-species model, the single Species instance is defined as a global constant named sim; in multispecies models, each Species instance is defined as a global constant with the same name as the species. This class has the following methods (functions):

This class has the following properties:

avatar

A property of type string. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The avatar string used to represent this species in SLiMgui. Outside of SLiMgui, this property still exists, but is not used by SLiM. Avatars are typically one-character strings, often using an emoji that symbolizes the species. This property is read-only; its value should be set with the avatar parameter of initializeSpecies().

chromosome

A property of type Chromosome object. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The Chromosome object used by the species.

chromosomeType

A property of type string. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The type of chromosome being simulated by this species; this will be one of "A", "X", or "Y".

color

A property of type string. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The color used to display information about this species in SLiMgui. Outside of SLiMgui, this property still exists, but is not used by SLiM. Colors may be specified by name, or with hexadecimal RGB values of the form "#RRGGBB" (see the Eidos manual). This property is read-only; its value should be set with the color parameter of initializeSpecies().

cycle

A property of type integer. It is of length one (a singleton). This property is a variable, so it is modifiable. Property Description: The current cycle count for this species. This counter begins at 1, and increments at the end of every tick in which the species is active. In models with non-overlapping generations, particularly WF models, this can be thought of as a generation counter.

description

A property of type string. It is of length one (a singleton). This property is a variable, so it is modifiable. Property Description: A human-readable string description for the species. By default, this is the empty string, ""; however, it may be set to whatever you wish.

dimensionality

A property of type string. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The spatial dimensionality of the simulation for this species, as specified in initializeSLiMOptions(). This will be "" (the empty string) for non-spatial simulations (the default), or "x", "xy", or "xyz", for simulations using those spatial dimensions respectively.

genomicElementTypes

A property of type GenomicElementType object. This property is a constant, so it is not modifiable. Property Description: The GenomicElementType objects being used in the species.

id

A property of type integer. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The identifier for this species. Species identifiers are determined by their declaration order in the script; the first declared species is given an id of 0, the second is given an id of 1, and so forth.

mutationTypes

A property of type MutationType object. This property is a constant, so it is not modifiable. Property Description: The MutationType objects being used in the species.

mutations

A property of type Mutation object. This property is a constant, so it is not modifiable. Property Description: The Mutation objects that are currently active in the species.

name

A property of type string. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: A human-readable string name for the subpopulation. This is always the declared name of the species, as given in the explicit species declaration in script, and cannot be changed. The name of a species may appear as a label in SLiMgui, and it can be useful in generating output, debugging, and other purposes. See also the description property, which can be changed by the user and used for any purpose.

nucleotideBased

A property of type logical. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: If T, the model for this species is nucleotide-based; if F, it is not. See the discussion of the nucleotideBased parameter to initializeSLiMOptions() for discussion.

periodicity

A property of type string. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: The spatial periodicity of the simulation for this species, as specified in initializeSLiMOptions(). This will be "" (the empty string) for non-spatial simulations and simulations with no periodic spatial dimensions (the default). Otherwise, it will be a string representing the subset of spatial dimensions that have been declared to be periodic, as specified to initializeSLiMOptions().

scriptBlocks

A property of type SLiMEidosBlock object. This property is a constant, so it is not modifiable. Property Description: All registered SLiMEidosBlock objects in the simulation that have been declared with this species as their species specifier (not ticks specifier). These will always be callback blocks; callbacks are species-specific, while other types of blocks are not.

sexEnabled

A property of type logical. It is of length one (a singleton). This property is a constant, so it is not modifiable. Property Description: If T, sex is enabled for this species; if F, individuals are hermaphroditic.

subpopulations

A property of type Subpopulation object. This property is a constant, so it is not modifiable. Property Description: The Subpopulation instances currently defined in the species.

substitutions

A property of type Substitution object. This property is a constant, so it is not modifiable. Property Description: A vector of Substitution objects, representing all mutations that have been fixed in this species.

tag

A property of type integer. It is of length one (a singleton). This property is a variable, so it is modifiable. Property Description: A user-defined integer value. The value of tag is initially undefined, and it is an error to try to read it; if you wish it to have a defined value, you must arrange that yourself by explicitly setting its value prior to using it elsewhere in your code. The value of tag is not used by SLiM; it is free for you to use. See also the getValue() and setValue() methods (provided by the Dictionary class; see the Eidos manual), for another way of attaching state to the simulation.