This callback specifies that a code block is providing logic to determine the breakpoints in the genome for recombination. It is called during the generation of gametes for each gamete in the generations it is active. This is achieved by setting breakpoints into the pseudo-variable breakpoints, replacing the default (as integer positions). If breakpoints is modified the callback must return T. If return(F) is used, SLiM will use the original breakpoints. see SLiM Manual: page 604

recombination(subpop_id)

Arguments

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.

Value

None

Details

Global variables available in reproduction callbacks:

individual

The focal parent that is generating a gamete

genome1

One genome of the focal parent; this is the initial copy strand

genome2

The other genome of the focal parent

subpop

The subpopulation to which the focal parent belongs

breakpoints

An integer vector of crossover breakpoints

Author

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

Examples

slim_block(recombination(), {
  if (genome1.containsMarkerMutation(m2, 25000) ==
      genome2.containsMarkerMutation(m2, 25000)) {

    return(F)

  }

  inInv = (breakpoints > 25000) & (breakpoints < 75000)
  if (!any(inInv)) {
    return(F)
  }

  breakpoints = breakpoints[!inInv]
  return(T)

})
#> A slimr_block:
#> <slimr_script[1]>
#> block_1:1:1 recombination() {
#>     if (genome1.containsMarkerMutation(m2, 25000) == genome2.containsMarkerMutation(m2, 25000)) {
#>         return(F);
#>     }
#>     inInv = (breakpoints > 25000) & (breakpoints < 75000);
#>     if (!any(inInv)) {
#>         return(F);
#>     }
#>     breakpoints = breakpoints[!inInv];
#>     return(T);
#> }