Documentation for SLiM function subsetMutations, which is a method of the SLiM class Species. 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.

subsetMutations(exclude, mutType, position, nucleotide, tag, id)

Arguments

exclude

An object of type null or Mutation object. Must be of length 1 (a singleton). The default value is NULL. See details for description.

mutType

An object of type null or integer or MutationType object. Must be of length 1 (a singleton). The default value is NULL. See details for description.

position

An object of type null or integer. Must be of length 1 (a singleton). The default value is NULL. See details for description.

nucleotide

An object of type null or integer or string. Must be of length 1 (a singleton). The default value is NULL. See details for description.

tag

An object of type null or integer. Must be of length 1 (a singleton). The default value is NULL. See details for description.

id

An object of type null or integer. Must be of length 1 (a singleton). The default value is NULL. See details for description.

Value

An object of type Mutation object.

Details

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

Returns a vector of mutations subset from the list of all active mutations in the species (as would be provided by the mutations property). The parameters specify constraints upon the subset of mutations that will be returned. Parameter exclude, if non-NULL, may specify a specific mutation that should not be included (typically the focal mutation in some operation). Parameter mutType, if non- NULL, may specify a mutation type for the mutations to be returned (as either a MutationType object or an integer identifier). Parameter position, if non-NULL, may specify a base position for the mutations to be returned. Parameter nucleotide, if non-NULL, may specify a nucleotide for the mutations to be returned (either as a string, "A" / "C" / "G" / "T", or as an integer, 0 / 1 / 2 / 3 respectively). Parameter tag, if non-NULL, may specify a tag value for the mutations to be returned. Parameter id, if non-NULL, may specify a required value for the id property of the mutations to be returned. This method is shorthand for getting the mutations property of the subpopulation, and then using operator [] to select only mutations with the desired properties; besides being much simpler than the equivalent Eidos code, it is also much faster. Note that if you only need to select on mutation type, the mutationsOfType() method will be even faster.

Author

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