You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<pclass="p2">Typically, a simulation sets up a recombination map at the beginning of the run with <spanclass="s1">initializeRecombinationRate()</span>, and that map is used for the duration of the run.<spanclass="Apple-converted-space"></span>Less commonly, the recombination map is changed dynamically from tick to tick, with <spanclass="s1">Chromosome</span>’s method <spanclass="s1">setRecombinationRate()</span>; but still, a single recombination map applies for all individuals of a species in a given tick.<spanclass="Apple-converted-space"></span>However, in unusual circumstances a simulation may need to modify the way that recombination works on an individual basis; for this, the <spanclass="s1">recombination()</span> callback mechanism is provided.<spanclass="Apple-converted-space"></span>This can be useful for models involving chromosomal inversions that prevent recombination within a region for some individuals, for example, or for models of the evolution of recombination.</p>
191
191
<pclass="p2">A <spanclass="s1">recombination()</span> callback is defined with a syntax much like that of other callbacks:</p>
<pclass="p2">The <spanclass="s1">recombination()</span> callback will be called during the generation of every gamete during the tick(s) in which it is active.<spanclass="Apple-converted-space"></span>It may optionally be restricted to apply only to gametes generated by parents in a specified subpopulation, using the <spanclass="s1"><subpop-id></span> specifier.<spanclass="Apple-converted-space"></span>(In multispecies models, the definition must be preceded by a <spanclass="s1">species</span> specification as usual.)</p>
<pclass="p2">The <spanclass="s1">recombination()</span> callback will be called during the generation of every gamete during the tick(s) in which it is active.<spanclass="Apple-converted-space"></span>It may optionally be restricted to apply only to gametes generated by parents in a specified subpopulation, using the <spanclass="s1"><subpop-id></span> specifier.<spanclass="Apple-converted-space"></span>In addition, in multi-chromosome models it may optionally be restricted to apply only to a specified chromosome, using the <spanclass="s1"><chromosome-id></span> specifier, which may be either the <spanclass="s1">id</span> or the <spanclass="s1">symbol</span> of a chromosome defined in the species.<spanclass="Apple-converted-space"></span>(In multispecies models, the definition must be preceded by a <spanclass="s1">species</span> specification as usual.)</p>
194
194
<pclass="p2">When a <spanclass="s1">recombination()</span> callback is called, a parent has already been chosen to generate a gamete, and candidate recombination breakpoints for use in recombining the parental haplosomes have been drawn.<spanclass="Apple-converted-space"></span>The relevant haplosomes of the focal parent are provided to the callback, as is the focal parent itself (as an <spanclass="s1">Individual</span> object) and the subpopulation in which it resides.<spanclass="Apple-converted-space"></span>Furthermore, the proposed breakpoints are provided to the callback.<spanclass="Apple-converted-space"></span>The callback may modify these breakpoints in order to change the breakpoints used, in which case it must return <spanclass="s1">T</span> to indicate that changes were made, or it may leave the proposed breakpoints unmodified, in which case it must return <spanclass="s1">F</span>.<spanclass="Apple-converted-space"></span>(The behavior of SLiM is undefined if the callback returns the wrong <spanclass="s1">logical</span> value.)</p>
195
195
<pclass="p2">In addition to the standard SLiM globals, then, a <spanclass="s1">recombination()</span> callback is supplied with additional information passed through “pseudo-parameters”:</p>
196
196
<pclass="p9"><spanclass="s1">individual</span><spanclass="Apple-tab-span"></span>The focal parent that is generating a gamete</p>
\f2\fs22 callback will be called during the generation of every gamete during the tick(s) in which it is active. It may optionally be restricted to apply only to gametes generated by parents in a specified subpopulation, using the
931
931
\f3\fs18 <subpop-id>
932
-
\f2\fs22 specifier. (In multispecies models, the definition must be preceded by a
932
+
\f2\fs22 specifier. In addition, in multi-chromosome models it may optionally be restricted to apply only to a specified chromosome, using the
933
+
\f3\fs18 <chromosome-id>
934
+
\f2\fs22 specifier, which may be either the
935
+
\f3\fs18 id
936
+
\f2\fs22 or the
937
+
\f3\fs18 symbol
938
+
\f2\fs22 of a chromosome defined in the species. (In multispecies models, the definition must be preceded by a
Copy file name to clipboardExpand all lines: VERSIONS
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -107,6 +107,8 @@ development head (in the master branch):
107
107
update calcHeterozygosity() for multi-chromosome support (but it assesses heterozygosity for only a single chromosome, for now)
108
108
new PAR (pseudo-autosomal region) recipe for section 15.23, replacing the old recipe in section 14.5 (which will be moved to SLiM-Extras for posterity)
109
109
new recipe 9.11 (Ne estimation) with a new multichrom-aware version of function estimateNe_Heterozygosity() that requires the chromosome to be supplied
110
+
recombination() callbacks can now be optionally declared with a chromosome specifier (id or symbol), to apply to just one chromosome
111
+
registerRecombinationCallback() now takes an optional chromosome parameter to specify that focal chromosome
EIDOS_TERMINATION << "ERROR (Community::AddScriptBlock): (internal error) script block for a non-callback or initialize() callback has subpopulation_id_ set." << EidosTerminate(p_error_token);
1034
1043
1044
+
if (p_script_block->chromosome_id_ != -1)
1045
+
EIDOS_TERMINATION << "ERROR (Community::AddScriptBlock): (internal error) script block for a non-callback or initialize() callback has chromosome_id_ set." << EidosTerminate(p_error_token);
1046
+
1035
1047
if (p_script_block->interaction_type_id_ != -1)
1036
1048
EIDOS_TERMINATION << "ERROR (Community::AddScriptBlock): (internal error) script block for a non-callback or initialize() callback has interaction_type_id_ set." << EidosTerminate(p_error_token);
0 commit comments