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
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -236,7 +236,7 @@ <h1>Keyword Arguments</h1>
236
236
<li><p>Required fields:</p>
237
237
<ul>
238
238
<li><code>name::Symbol</code>: Unique identifier for this reaction within the place.</li>
239
-
<li><code>affect!</code>: Callback that executes the reaction. Signature: <code>(c::Context; link::Link, chem_voxel::Int, reaction_id, place_idx, kwargs...) -> Int</code>. <code>link</code> is a handle identifying the specific link instance — pass it to <ahref="../docstrings/medyan.get_state-e99d22cacff37374.html"><code>get_state</code></a>, <ahref="../docstrings/medyan.update_link--67d413cca6fe82eb.html"><code>update_link!</code></a>, <ahref="../docstrings/medyan.link2tags-645330bedbf54254.html"><code>link2tags</code></a>, etc. Return a status code for debugging purposes. For <code>fila_cutoff</code> reactions, also receives <code>place::FilaMonoIdx</code> (a randomly chosen nearby filament monomer within the cutoff distance).</li>
239
+
<li><code>affect!</code>: Callback that executes the reaction. Signature: <code>(c::Context; link::Link, chem_voxel::Int, reaction_id, place_idx, kwargs...) -> Int</code>. <code>link</code> is a handle identifying the specific link instance — pass it to <ahref="../docstrings/medyan.get_state-e99d22cacff37374.html"><code>get_state</code></a>, <ahref="../docstrings/medyan.update_link--67d413cca6fe82eb.html"><code>update_link!</code></a>, <ahref="../docstrings/medyan.link2tags-645330bedbf54254.html"><code>link2tags</code></a>, etc. Return a status code for debugging purposes. For <code>fila_cutoff</code> reactions, also receives <code>place::FilaMonoIdx</code> (a randomly chosen nearby filament monomer within the cutoff distance). For <code>ball_cutoff</code> reactions, also receives <code>place::BallIdx</code> (a randomly chosen nearby ball within the cutoff distance).</li>
240
240
</ul></li>
241
241
<li><p>Optional fields:</p>
242
242
<ul>
@@ -245,7 +245,8 @@ <h1>Keyword Arguments</h1>
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
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
+
<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> and <code>ball_cutoff</code>. <strong>Some tips are invisible to this search until after a mechanics cycle</strong> — see “Nearby count caching and mechanics” below.</li>
249
+
<li><code>ball_cutoff::Float64 = nothing</code>: If set, e.g., <code>50.0</code>, the propensity is multiplied by the number of nearby balls whose centers are within the cutoff distance (nm). When the reaction fires, <code>affect!</code> receives one such ball as <code>place::BallIdx</code>. Only balls that have been through a mechanics cycle (<code>is_minimized</code>) are visible to this search. Mutually exclusive with <code>fila_cutoff</code> and <code>fila_tip_cutoff</code>.</li>
249
250
<li><code>enabled::Bool = true</code>: Whether reaction is active by default.</li>
250
251
</ul></li>
251
252
</ul></li>
@@ -274,9 +275,9 @@ <h1>When rates are reevaluated</h1>
274
275
</ul>
275
276
<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>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>
<h1>Nearby count caching and mechanics (<code>fila_cutoff</code> / <code>fila_tip_cutoff</code>/ <code>ball_cutoff</code>reactions)</h1>
280
+
<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>. When a reaction has <code>ball_cutoff</code> set, the propensity is the same but with <code>nearby_ball_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>
@@ -290,7 +291,10 @@ <h2 class="anchored" data-anchor-id="snapshotted-positions">Snapshotted position
290
291
<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
292
<spanid="cb2-10"><ahref="#cb2-10" aria-hidden="true" tabindex="-1"></a> snapshot. Polymerization and depolymerization move an existing tip</span>
292
293
<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>
<spanid="cb2-13"><ahref="#cb2-13" aria-hidden="true" tabindex="-1"></a><spanclass="fl">5</span>. A ball is visible to <spanclass="ss">`ball_cutoff`</span> only when</span>
296
+
<spanid="cb2-14"><ahref="#cb2-14" aria-hidden="true" tabindex="-1"></a> [<spanclass="ss">`is_minimized`</span>](<spanclass="pp">@ref</span>) is <spanclass="ss">`true`</span>. Changing <spanclass="ss">`position`</span> or <spanclass="ss">`radius`</span></span>
297
+
<spanid="cb2-15"><ahref="#cb2-15" aria-hidden="true" tabindex="-1"></a> via [<spanclass="ss">`update_ball!`</span>](<spanclass="pp">@ref</span>) resets <spanclass="ss">`is_minimized`</span> to <spanclass="ss">`false`</span>.</span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
Copy file name to clipboardExpand all lines: julia-docs/dev/docstrings/src/sys_def.html
+10-6Lines changed: 10 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -477,7 +477,7 @@ <h1>Keyword Arguments</h1>
477
477
<li><p>Required fields:</p>
478
478
<ul>
479
479
<li><code>name::Symbol</code>: Unique identifier for this reaction within the place.</li>
480
-
<li><code>affect!</code>: Callback that executes the reaction. Signature: <code>(c::Context; link::Link, chem_voxel::Int, reaction_id, place_idx, kwargs...) -> Int</code>. <code>link</code> is a handle identifying the specific link instance — pass it to <ahref="../../docstrings/medyan.get_state-e99d22cacff37374.html"><code>get_state</code></a>, <ahref="../../docstrings/medyan.update_link--67d413cca6fe82eb.html"><code>update_link!</code></a>, <ahref="../../docstrings/medyan.link2tags-645330bedbf54254.html"><code>link2tags</code></a>, etc. Return a status code for debugging purposes. For <code>fila_cutoff</code> reactions, also receives <code>place::FilaMonoIdx</code> (a randomly chosen nearby filament monomer within the cutoff distance).</li>
480
+
<li><code>affect!</code>: Callback that executes the reaction. Signature: <code>(c::Context; link::Link, chem_voxel::Int, reaction_id, place_idx, kwargs...) -> Int</code>. <code>link</code> is a handle identifying the specific link instance — pass it to <ahref="../../docstrings/medyan.get_state-e99d22cacff37374.html"><code>get_state</code></a>, <ahref="../../docstrings/medyan.update_link--67d413cca6fe82eb.html"><code>update_link!</code></a>, <ahref="../../docstrings/medyan.link2tags-645330bedbf54254.html"><code>link2tags</code></a>, etc. Return a status code for debugging purposes. For <code>fila_cutoff</code> reactions, also receives <code>place::FilaMonoIdx</code> (a randomly chosen nearby filament monomer within the cutoff distance). For <code>ball_cutoff</code> reactions, also receives <code>place::BallIdx</code> (a randomly chosen nearby ball within the cutoff distance).</li>
481
481
</ul></li>
482
482
<li><p>Optional fields:</p>
483
483
<ul>
@@ -486,7 +486,8 @@ <h1>Keyword Arguments</h1>
486
486
<li><code>invvolumepower::Int64 = 0</code>: Volume scaling. Set to 1 for bimolecular (nm³/s), 0 for unimolecular (1/s).</li>
487
487
<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>
488
488
<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>
489
-
<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>
489
+
<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> and <code>ball_cutoff</code>. <strong>Some tips are invisible to this search until after a mechanics cycle</strong> — see “Nearby count caching and mechanics” below.</li>
490
+
<li><code>ball_cutoff::Float64 = nothing</code>: If set, e.g., <code>50.0</code>, the propensity is multiplied by the number of nearby balls whose centers are within the cutoff distance (nm). When the reaction fires, <code>affect!</code> receives one such ball as <code>place::BallIdx</code>. Only balls that have been through a mechanics cycle (<code>is_minimized</code>) are visible to this search. Mutually exclusive with <code>fila_cutoff</code> and <code>fila_tip_cutoff</code>.</li>
490
491
<li><code>enabled::Bool = true</code>: Whether reaction is active by default.</li>
491
492
</ul></li>
492
493
</ul></li>
@@ -515,9 +516,9 @@ <h1>When rates are reevaluated</h1>
515
516
</ul>
516
517
<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>Nearby count caching and mechanics (<code>fila_cutoff</code> / <code>fila_tip_cutoff</code> reactions)</h1>
520
-
<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>
<h1>Nearby count caching and mechanics (<code>fila_cutoff</code> / <code>fila_tip_cutoff</code>/ <code>ball_cutoff</code>reactions)</h1>
521
+
<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>. When a reaction has <code>ball_cutoff</code> set, the propensity is the same but with <code>nearby_ball_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="cb12"><preclass="sourceCode julia code-with-copy"><codeclass="sourceCode julia"><spanid="cb12-1"><ahref="#cb12-1" aria-hidden="true" tabindex="-1"></a><spanclass="fl">1</span>. After each mechanics cycle, monomer and tip positions are snapshotted.</span>
@@ -531,7 +532,10 @@ <h2 class="anchored" data-anchor-id="snapshotted-positions">Snapshotted position
531
532
<spanid="cb12-9"><ahref="#cb12-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>
532
533
<spanid="cb12-10"><ahref="#cb12-10" aria-hidden="true" tabindex="-1"></a> snapshot. Polymerization and depolymerization move an existing tip</span>
533
534
<spanid="cb12-11"><ahref="#cb12-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>
534
-
<spanid="cb12-12"><ahref="#cb12-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>
<spanid="cb12-13"><ahref="#cb12-13" aria-hidden="true" tabindex="-1"></a><spanclass="fl">5</span>. A ball is visible to <spanclass="ss">`ball_cutoff`</span> only when</span>
537
+
<spanid="cb12-14"><ahref="#cb12-14" aria-hidden="true" tabindex="-1"></a> [<spanclass="ss">`is_minimized`</span>](<spanclass="pp">@ref</span>) is <spanclass="ss">`true`</span>. Changing <spanclass="ss">`position`</span> or <spanclass="ss">`radius`</span></span>
538
+
<spanid="cb12-15"><ahref="#cb12-15" aria-hidden="true" tabindex="-1"></a> via [<spanclass="ss">`update_ball!`</span>](<spanclass="pp">@ref</span>) resets <spanclass="ss">`is_minimized`</span> to <spanclass="ss">`false`</span>.</span></code></pre></div><buttontitle="Copy to Clipboard" class="code-copy-button"><iclass="bi"></i></button></div>
0 commit comments