This callback specifies that a code block is providing logic to modify an offspring that has been produced
during a SLiM simulation, and is called for every offspring produced. The code should modify the pseudo-variables
associated with the child (see details) child
, childGenome1
, and childGenome2
. It should also
return a single logical T
or F
. If F
, the offspring will be discarded and the callback called again.
Make sure there is a non-zero probability of returning T
, or the simulation could hang indefinitely.
see SLiM Manual: page 601
modifyChild(subpop_id)
The id(s) of the subpopulation(s) to which this callback should apply. Can be an integer 1, 2, etc., or character "p1", "p2", etc.
None
Global variables available in reproduction callbacks:
The generated child (an object of class Individual)
One genome of the generated child
The other genome of the generated child
T if the child will be female, F if male (defined only if sex is enabled)
The first parent (an object of class Individual)
One genome of the first parent
The other genome of the first parent
T if the child is the result of cloning
T if the child is the result of selfing
The second parent (an object of class Individual)
One genome of the second parent
The other genome of the second parent
The subpopulation in which the child will live
The subpopulation of the parents (==subpop if not a migration mating)
This is documentation for a function in the SLiM software, and has been modified from the official manual, which can be found here: http://benhaller.com/slim/SLiM_Manual.pdf. This documentation is Copyright © 2016-2020 Philipp Messer. All rights reserved. More information about SLiM can be found on the official website: https://messerlab.org/slim/
Other callbacks:
early()
,
first()
,
fitnessEffect()
,
fitness()
,
initialize()
,
interaction()
,
late()
,
mateChoice()
,
mutationEffect()
,
mutation()
,
recombination()
,
reproduction()
,
slim_callbacks()
,
survival()
slim_block(modifyChild(), {
# prevent hermaphroditic selfing
if(parent1 == parent2) {
return(F)
}
return(T)
})
#> A slimr_block:
#> <slimr_script[1]>
#> block_1:1:1 modifyChild() {
#> if (parent1 == parent2) {
#> return(F);
#> }
#> return(T);
#> }