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
Copy file name to clipboardExpand all lines: julia-docs/dev/docstrings/medyan.def_link_type--339fe050fe131631.html
+18-13Lines changed: 18 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -244,7 +244,8 @@ <h1>Keyword Arguments</h1>
244
244
<li><code>base_rate::Float64 = 1.0</code>: Rate constant multiplier. Units depend on <code>invvolumepower</code>: 1/s for unimolecular (<code>invvolumepower=0</code>), nm³/s for bimolecular (<code>invvolumepower=1</code>). For example, a diffusion-limited on-rate k_D = 4πDR ≈ 1.57×10⁹ nm³/s for D=25 μm²/s, R=5 nm. Separating large rate constants from small integer multipliers in <code>rate</code> avoids overflow.</li>
245
245
<li><code>invvolumepower::Int64 = 0</code>: Volume scaling. Set to 1 for bimolecular (nm³/s), 0 for unimolecular (1/s).</li>
246
246
<li><code>reactants_extra::String = ""</code>: Additional reactant species whose counts multiply the propensity (e.g., <code>"diffusing.ARP23"</code>). Uses the same <code>"+"</code>-separated format as <ahref="../docstrings/medyan.def_reaction--60ae13f69a537c68.html"><code>def_reaction!</code></a> (e.g., <code>"diffusing.A + diffusing.B"</code>).</li>
247
-
<li><code>fila_cutoff::Tuple{Symbol, Float64} = nothing</code>: If set, e.g., <code>(:actin, 50.0)</code>, the propensity is multiplied by the number of nearby filament monomers of that type within the cutoff distance (nm). When the reaction fires, <code>affect!</code> receives one such monomer as <code>place::FilaMonoIdx</code>. <strong>Some monomers are invisible to this search until after a mechanics cycle</strong> — see “Monomer count caching and mechanics” below.</li>
247
+
<li><code>fila_cutoff::Tuple{Symbol, Float64} = nothing</code>: If set, e.g., <code>(:actin, 50.0)</code>, the propensity is multiplied by the number of nearby filament monomers of that type within the cutoff distance (nm). When the reaction fires, <code>affect!</code> receives one such monomer as <code>place::FilaMonoIdx</code>. <strong>Some monomers are invisible to this search until after a mechanics cycle</strong> — see “Nearby count caching and mechanics” below.</li>
248
+
<li><code>fila_tip_cutoff::Tuple{Symbol, Bool, Float64} = nothing</code>: If set, e.g., <code>(:actin, true, 50.0)</code>, the propensity is multiplied by the number of nearby filament tips of that type within the cutoff distance (nm). The <code>Bool</code> is <code>is_minus_end</code>: <code>true</code> for minus-end tips, <code>false</code> for plus-end tips. When the reaction fires, <code>affect!</code> receives one such tip as <code>place::FilaTipIdx</code>. Mutually exclusive with <code>fila_cutoff</code>. <strong>Some tips are invisible to this search until after a mechanics cycle</strong> — see “Nearby count caching and mechanics” below.</li>
248
249
<li><code>enabled::Bool = true</code>: Whether reaction is active by default.</li>
249
250
</ul></li>
250
251
</ul></li>
@@ -273,19 +274,23 @@ <h1>When rates are reevaluated</h1>
273
274
</ul>
274
275
<p><strong>Workaround — rejection sampling</strong>: If a reaction rate genuinely depends on state that <code>rate</code> cannot track (e.g., the state of a nearby monomer not attached to this link), have <code>rate</code> return an <strong>upper bound</strong> of the true rate. Then in <code>affect!</code>, read the current state and accept the reaction with probability <code>true_rate / upper_bound</code> (rejecting by returning <code>0</code> otherwise). This preserves correct stochastic kinetics despite the stale cache.</p>
<h1>Monomer count caching and mechanics (<code>fila_cutoff</code> reactions)</h1>
278
-
<p>When a reaction has <code>fila_cutoff</code> set, its total propensity is <code>base_rate × rate(...) × nearby_monomer_count × ...</code>. The nearby monomer count is <strong>cached</strong> alongside the rate factor and has its own important update semantics:</p>
<h2class="anchored" data-anchor-id="minimized-positions-for-monomer-counting">Minimized positions for monomer counting</h2>
281
-
<divclass="code-copy-outer-scaffold"><divclass="sourceCode" id="cb2"><preclass="sourceCode julia code-with-copy"><codeclass="sourceCode julia"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="fl">1</span>. After each mechanics cycle, monomer positions are snapshotted. These</span>
282
-
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a><spanclass="cf">do</span> not change during chemistry.</span>
283
-
<spanid="cb2-3"><ahref="#cb2-3" aria-hidden="true" tabindex="-1"></a><spanclass="fl">2</span>. The nearby monomer count is computed <spanclass="im">using</span><spanclass="bu">the</span> place's **current** position</span>
284
-
<spanid="cb2-4"><ahref="#cb2-4" aria-hidden="true" tabindex="-1"></a> (<spanclass="ss">`get_position`</span>) against the snapshotted monomer positions. The count is</span>
285
-
<spanid="cb2-5"><ahref="#cb2-5" aria-hidden="true" tabindex="-1"></a>recomputed whenever a place moves or a <spanclass="kw">new</span> link is created (not only at the</span>
286
-
<spanid="cb2-6"><ahref="#cb2-6" aria-hidden="true" tabindex="-1"></a>batch rebuild after mechanics).</span>
<h1>Nearby count caching and mechanics (<code>fila_cutoff</code> / <code>fila_tip_cutoff</code> reactions)</h1>
279
+
<p>When a reaction has <code>fila_cutoff</code> set, its total propensity is <code>base_rate × rate(...) × nearby_monomer_count × [reactants_extra counts] / V^invvolumepower</code>. When a reaction has <code>fila_tip_cutoff</code> set, the propensity is the same but with <code>nearby_tip_count</code> in place of <code>nearby_monomer_count</code>. These counts are <strong>cached</strong> alongside the rate factor and have important update semantics:</p>
<divclass="code-copy-outer-scaffold"><divclass="sourceCode" id="cb2"><preclass="sourceCode julia code-with-copy"><codeclass="sourceCode julia"><spanid="cb2-1"><ahref="#cb2-1" aria-hidden="true" tabindex="-1"></a><spanclass="fl">1</span>. After each mechanics cycle, monomer and tip positions are snapshotted.</span>
283
+
<spanid="cb2-2"><ahref="#cb2-2" aria-hidden="true" tabindex="-1"></a>These snapshotted positions <spanclass="cf">do</span> not change during chemistry.</span>
284
+
<spanid="cb2-3"><ahref="#cb2-3" aria-hidden="true" tabindex="-1"></a><spanclass="fl">2</span>. The nearby count is computed <spanclass="im">using</span><spanclass="bu">the</span> link place's **current** position</span>
285
+
<spanid="cb2-4"><ahref="#cb2-4" aria-hidden="true" tabindex="-1"></a> (i.<spanclass="cn">e</span>. the <spanclass="ss">`Anchor`</span>, <spanclass="ss">`FilaMonoIdx`</span>, etc. whose reaction has the cutoff)</span>
286
+
<spanid="cb2-5"><ahref="#cb2-5" aria-hidden="true" tabindex="-1"></a>against the snapshotted positions. The count is recomputed whenever the</span>
287
+
<spanid="cb2-6"><ahref="#cb2-6" aria-hidden="true" tabindex="-1"></a>link place moves or a <spanclass="kw">new</span> link is created.</span>
287
288
<spanid="cb2-7"><ahref="#cb2-7" aria-hidden="true" tabindex="-1"></a><spanclass="fl">3</span>. Monomers that have not yet been through a mechanics cycle (from</span>
288
-
<spanid="cb2-8"><ahref="#cb2-8" aria-hidden="true" tabindex="-1"></a> polymerization, filament creation, or severing) are not <spanclass="kw">in</span> the snapshot.</span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
289
+
<spanid="cb2-8"><ahref="#cb2-8" aria-hidden="true" tabindex="-1"></a> polymerization, filament creation, or severing) are not <spanclass="kw">in</span> the snapshot.</span>
290
+
<spanid="cb2-9"><ahref="#cb2-9" aria-hidden="true" tabindex="-1"></a><spanclass="fl">4</span>. Similarly, a tip is visible only <spanclass="cf">if</span> it existed at the last mechanics</span>
291
+
<spanid="cb2-10"><ahref="#cb2-10" aria-hidden="true" tabindex="-1"></a> snapshot. Polymerization and depolymerization move an existing tip</span>
292
+
<spanid="cb2-11"><ahref="#cb2-11" aria-hidden="true" tabindex="-1"></a> but <spanclass="cf">do</span> not create a <spanclass="kw">new</span> one, so the tip stays visible at its</span>
293
+
<spanid="cb2-12"><ahref="#cb2-12" aria-hidden="true" tabindex="-1"></a> snapshotted position.</span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
0 commit comments