brainx-skill 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/adapters/gemini.js +7 -0
- package/adapters/opencode.js +7 -0
- package/adapters/windsurf.js +7 -0
- package/installation/lib/installer.js +4 -1
- package/manifest.json +5 -1
- package/package.json +7 -2
- package/skills/braincell/SKILL.md +182 -0
- package/skills/braincell/references/area-scaled-hh-pattern.md +54 -0
- package/skills/braincell/references/braincell-custom-ion-channel-authoring.md +210 -0
- package/skills/braincell/references/channel-library.md +170 -0
- package/skills/braincell/references/ion-library.md +154 -0
- package/skills/braincell/references/mixions-for-adaptation.md +81 -0
- package/skills/braincell/references/multicompartment/braincell-manual-morphology-construction.md +180 -0
- package/skills/braincell/references/multicompartment/cv-policy-reference.md +133 -0
- package/skills/braincell/references/multicompartment/filter-function-library.md +162 -0
- package/skills/braincell/references/multicompartment/morphology-io-loading-validation.md +135 -0
- package/skills/braincell/references/multicompartment/multicompartment-cell-workflow.md +391 -0
- package/skills/braincell/references/multicompartment/probe-reference.md +128 -0
- package/skills/braincell/references/multicompartment/topology-building-and-visualization.md +121 -0
- package/skills/braincell/references/scripts/calcium_channel_gating.py +66 -0
- package/skills/braincell/references/scripts/cell_multicompartment_reference.py +221 -0
- package/skills/braincell/references/scripts/channel_ablation.py +61 -0
- package/skills/braincell/references/scripts/fi_curve.py +68 -0
- package/skills/braincell/references/scripts/hh_neuron_basics.py +59 -0
- package/skills/braincell/references/scripts/spike_frequency_adaptation.py +75 -0
- package/skills/braincell/references/scripts/t_current_rebound.py +72 -0
- package/skills/braincell/references/scripts/thalamic_neurons.py +228 -0
- package/skills/braincell/references/solver-library-with-effects.md +188 -0
- package/skills/brainevent/SKILL.md +268 -0
- package/skills/brainevent/references/connectivity-variants.md +312 -0
- package/skills/brainevent/references/custom-operators-cpu.md +304 -0
- package/skills/brainevent/references/custom-operators-gpu.md +468 -0
- package/skills/brainevent/references/scripts/102_EI_net_1996.py +107 -0
- package/skills/brainevent/references/scripts/204_joglekar_2018_propagation.py +168 -0
- package/skills/brainevent/references/scripts/coba_ei_teaching.py +356 -0
- package/skills/brainevent/references/sparse-formats.md +182 -0
- package/skills/brainevent/references/synaptic-plasticity.md +285 -0
- package/skills/brainpy-state/SKILL.md +232 -0
- package/skills/brainpy-state/references/array-creation.md +158 -0
- package/skills/brainpy-state/references/brain-dynamics-delay-protocol.md +96 -0
- package/skills/brainpy-state/references/braintools/brainstate-control-flow-patterns.md +334 -0
- package/skills/brainpy-state/references/braintools/data-preprocessing.md +79 -0
- package/skills/brainpy-state/references/braintools/metric.md +152 -0
- package/skills/brainpy-state/references/braintools/optimizer.md +179 -0
- package/skills/brainpy-state/references/braintools/parameter-initializer.md +183 -0
- package/skills/brainpy-state/references/braintools/surrogate.md +147 -0
- package/skills/brainpy-state/references/component-selection.md +273 -0
- package/skills/brainpy-state/references/nest-compatible/devices.md +157 -0
- package/skills/brainpy-state/references/nest-compatible/divergence-and-parity.md +114 -0
- package/skills/brainpy-state/references/nest-compatible/integration-categories.md +41 -0
- package/skills/brainpy-state/references/nest-compatible/model-library.md +200 -0
- package/skills/brainpy-state/references/nest-compatible/nest-workflow.md +156 -0
- package/skills/brainpy-state/references/nest-compatible/network-building.md +264 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/brette_et_al_2007.py +320 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/brunel_alpha.py +108 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/brunel_delta.py +93 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/clopath_synapse_spike_pairing.py +171 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/evaluate_tsodyks2_synapse.py +147 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/spatial_gaussex.py +112 -0
- package/skills/brainpy-state/references/nest-compatible/scripts/synapsecollection.py +198 -0
- package/skills/brainpy-state/references/nest-compatible/synapse-and-connectivity.md +153 -0
- package/skills/brainpy-state/references/projection-patterns.md +125 -0
- package/skills/brainpy-state/references/scripts/103_COBA_2005.py +86 -0
- package/skills/brainpy-state/references/scripts/106_COBA_HH_2007.py +181 -0
- package/skills/brainpy-state/references/scripts/107_gamma_oscillation_1996.py +156 -0
- package/skills/brainpy-state/references/scripts/109_fast_global_oscillation.py +111 -0
- package/skills/brainpy-state/references/scripts/201_surrogate_grad_lif_fashion_mnist.py +221 -0
- package/skills/brainpy-state/references/scripts/training-snn.py +119 -0
- package/skills/brainstate/SKILL.md +1 -1
- package/skills/brainstate/references/brainstate/brainstate-control-flow-patterns.md +250 -399
- package/skills/brainstate/references/brainstate/brainstate-transformed-diagnostics.md +6 -2
- package/skills/brainstate/references/brainstate/parameter-constraints-regularization.md +16 -2
- package/skills/brainstate/references/brainstate/parameter-transforms-regularizers-catalog.md +8 -3
- package/skills/brainstate/references/brainstate/randomness-and-reproducibility.md +64 -143
- package/skills/brainstate/references/brainstate/transformation-grad-expansion.md +13 -1
- package/skills/brainstate/references/brainstate/transformation-jit-expansion.md +11 -1
- package/skills/brainstate/references/brainstate/transformation-vmap-expansion.md +35 -7
- package/skills/brainstate/references/collective_model_operations.md +9 -9
- package/skills/brainstate/references/extension_mechanisms.md +12 -1
- package/skills/brainstate/references/libraries/prebuilt-activation-library.md +106 -97
- package/skills/brainstate/references/libraries/prebuilt-layer-library.md +102 -176
- package/skills/brainstate/references/model-interop-and-migration.md +11 -1
- package/skills/brainstate/references/size-inference-variations.md +11 -0
- package/skills/brainstate/references/state-graph-operations.md +13 -15
- package/skills/brainstate/references/state_collections_and_utilities.md +12 -1
- package/skills/brainx-general-guard/SKILL.md +153 -0
- package/skills/brainx-general-guard/references/brainstate-randomness-reproducibility/advanced-randomness.md +303 -0
- package/skills/brainx-general-guard/references/brainstate-randomness-reproducibility/randomness-and-reproducibility.md +62 -0
- package/skills/brainstate/references/braintools-optimizer-reference.md +0 -133
- package/skills/brainstate/references/libraries/solver-library-with-effects.md +0 -85
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
# BrainCell channel library
|
|
2
|
+
|
|
3
|
+
Use this reference when selecting a built-in membrane channel, matching it to its ion owner, or designing a controlled channel comparison. Author a custom channel only after the built-in library and literature-derived templates have been checked.
|
|
4
|
+
|
|
5
|
+
## Mental model
|
|
6
|
+
|
|
7
|
+
A channel computes membrane current from voltage, its internal gating state, and the `IonInfo` supplied by its `root_type`.
|
|
8
|
+
|
|
9
|
+
Built-in names usually follow `<current>_<source><year>`, so a similar current name does not imply interchangeable kinetics. Match the requested model, paper, temperature convention, reversal-potential treatment, and ion dependency before tuning `g_max`.
|
|
10
|
+
|
|
11
|
+
## Choose a channel family
|
|
12
|
+
|
|
13
|
+
### Sodium channels
|
|
14
|
+
|
|
15
|
+
Use sodium channels for inward current that initiates or sustains depolarization.
|
|
16
|
+
|
|
17
|
+
| API | Description |
|
|
18
|
+
|---|---|
|
|
19
|
+
| `braincell.channel.Na_HH1952(size, ...)` | Use for the classical Hodgkin-Huxley 1952 sodium current. |
|
|
20
|
+
| `braincell.channel.Na_TM1991(size, ...)` | Use when reproducing the Traub-Miles 1991 sodium formulation. |
|
|
21
|
+
| `braincell.channel.Na_Ba2002(size, ...)` | Use for models based on the Bazhenov 2002 sodium current. |
|
|
22
|
+
| `braincell.channel.NaF_SU2015_DCN(size, ...)` | Use when the requested model requires the fast sodium current from the Sudhakar 2015 DCN template family. |
|
|
23
|
+
| `braincell.channel.NaP_SU2015_DCN(size, ...)` | Use when the requested model requires the persistent sodium current from the same template family. |
|
|
24
|
+
|
|
25
|
+
Attach these channels to a sodium ion. Do not select among them by maximal conductance alone; their gating equations and source-model conventions differ.
|
|
26
|
+
|
|
27
|
+
### Potassium channels
|
|
28
|
+
|
|
29
|
+
Use potassium channels for repolarization, resting conductance, delayed rectification, transient A-current, M-current, or inward rectification.
|
|
30
|
+
|
|
31
|
+
| API | Description |
|
|
32
|
+
|---|---|
|
|
33
|
+
| `braincell.channel.K_HH1952(size, ...)` | Use for the classical Hodgkin-Huxley 1952 delayed-rectifier potassium current. |
|
|
34
|
+
| `braincell.channel.K_TM1991(size, ...)` | Use when reproducing the Traub-Miles 1991 potassium formulation. |
|
|
35
|
+
| `braincell.channel.K_Leak(size, ...)` | Use for an ion-specific potassium leak current owned by a potassium ion. |
|
|
36
|
+
| `braincell.channel.KDR_Ba2002(size, ...)` | Use for the Bazhenov 2002 delayed-rectifier potassium current. |
|
|
37
|
+
| `braincell.channel.KA1_HM1992(size, ...)` | Use for the Huguenard-McCormick 1992 `IA1` transient potassium current. |
|
|
38
|
+
| `braincell.channel.KA2_HM1992(size, ...)` | Use for the Huguenard-McCormick 1992 `IA2` transient potassium current. |
|
|
39
|
+
|
|
40
|
+
The API also exposes `KM_*`, `Kv*`, and `Kir*` template families. Use the exact literature-derived class when the user names a model or source paper; consult the installed API for the complete list.
|
|
41
|
+
|
|
42
|
+
### Calcium channels
|
|
43
|
+
|
|
44
|
+
Use calcium channels for calcium entry, low- or high-threshold activation, rebound behavior, or calcium-dependent downstream mechanisms.
|
|
45
|
+
|
|
46
|
+
| API | Description |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `braincell.channel.CaL_IS2008(size, ...)` | Use for the Inoue-Strowbridge 2008 L-type calcium current. |
|
|
49
|
+
| `braincell.channel.CaN_IS2008(size, ...)` | Use for the Inoue-Strowbridge 2008 calcium-activated non-selective cation current. |
|
|
50
|
+
| `braincell.channel.CaT_HM1992(size, ...)` | Use for the Huguenard-McCormick 1992 low-threshold T-type calcium current. |
|
|
51
|
+
| `braincell.channel.CaT_HP1992(size, ...)` | Use for the Huguenard-Prince 1992 T-type current for reticular-nucleus models. |
|
|
52
|
+
| `braincell.channel.CaHT_HM1992(size, ...)` | Use for the Huguenard-McCormick 1992 high-threshold calcium current. |
|
|
53
|
+
|
|
54
|
+
Attach calcium channels to a calcium ion. Use a dynamic calcium ion when accumulated calcium must affect reversal potential or calcium-dependent channels; otherwise a fixed calcium ion may be sufficient.
|
|
55
|
+
|
|
56
|
+
### Mixed-ion, HCN, and leak channels
|
|
57
|
+
|
|
58
|
+
| API | Description |
|
|
59
|
+
|---|---|
|
|
60
|
+
| `braincell.channel.AHP_De1994(size, ...)` | Use for a calcium-activated potassium AHP current; attach it to `MixIons(k, ca)` in that order. |
|
|
61
|
+
| `braincell.channel.HCN_HM1992(size, E=..., ...)` | Use for the Huguenard-McCormick 1992 hyperpolarization-activated current and related sag or rebound behavior. |
|
|
62
|
+
| `braincell.channel.IL(size, E=..., g_max=...)` | Use for a root-cell leakage current with its own reversal potential; attach it directly to the cell. |
|
|
63
|
+
| `braincell.channel.LeakageChannel` | Use as the base class when implementing leakage-channel dynamics, not as the normal concrete leak mechanism. |
|
|
64
|
+
|
|
65
|
+
The `Kca*`, `HCN*`, and template-import families contain model-specific alternatives. Prefer the exact source match over a name that merely has the same broad current type.
|
|
66
|
+
|
|
67
|
+
## Attach built-in channels
|
|
68
|
+
|
|
69
|
+
`root_type` determines which object supplies a channel's ion information and where the channel may be attached.
|
|
70
|
+
|
|
71
|
+
| API | Description |
|
|
72
|
+
|---|---|
|
|
73
|
+
| `channel.root_type` | Inspect before attachment; it identifies a sodium, potassium, calcium, ordered multi-ion, or root-cell dependency. |
|
|
74
|
+
| `ion.add(name=channel)` | Use for a single-ion channel in a `SingleCompartment`; it validates the channel against the ion owner. |
|
|
75
|
+
| `mixed.add(name=channel)` | Use for a channel whose `root_type` is an ordered multi-ion dependency. |
|
|
76
|
+
| `braincell.mech.Channel(name_or_class, **parameters)` | Use inside `Cell.paint()` for a multicompartment density-channel declaration; string names resolve through the channel registry. |
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import braincell
|
|
80
|
+
import brainunit as u
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
class HH(braincell.SingleCompartment):
|
|
84
|
+
def __init__(self, size, solver="exp_euler"):
|
|
85
|
+
super().__init__(size, V_th=20.0 * u.mV, solver=solver)
|
|
86
|
+
|
|
87
|
+
self.na = braincell.ion.SodiumFixed(size, E=50.0 * u.mV)
|
|
88
|
+
self.na.add(INa=braincell.channel.Na_HH1952(size))
|
|
89
|
+
|
|
90
|
+
self.k = braincell.ion.PotassiumFixed(size, E=-77.0 * u.mV)
|
|
91
|
+
self.k.add(IK=braincell.channel.K_HH1952(size))
|
|
92
|
+
|
|
93
|
+
self.IL = braincell.channel.IL(
|
|
94
|
+
size,
|
|
95
|
+
E=-54.387 * u.mV,
|
|
96
|
+
g_max=0.03 * u.mS / u.cm**2,
|
|
97
|
+
)
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
This pattern keeps ion-specific channels under their matching ion and the root-cell leak on the cell. Adding `K_HH1952` to `SodiumFixed`, for example, raises a type error instead of silently using the wrong reversal potential.
|
|
101
|
+
|
|
102
|
+
Open `references/ion-library.md` when choosing fixed, Nernst-initialized, or dynamic ion behavior. Open `references/mixions-for-adaptation.md` when a mixed potassium-calcium channel participates in adaptation or rebound.
|
|
103
|
+
|
|
104
|
+
## Isolate a channel effect
|
|
105
|
+
|
|
106
|
+
Expose the target channel's parameter while holding the cell declaration, initial state, input, solver, `dt`, and recording path constant.
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
class AblationHH(braincell.SingleCompartment):
|
|
110
|
+
def __init__(
|
|
111
|
+
self,
|
|
112
|
+
size,
|
|
113
|
+
gK=36.0 * u.mS / u.cm**2,
|
|
114
|
+
solver="exp_euler",
|
|
115
|
+
):
|
|
116
|
+
super().__init__(size, V_th=20.0 * u.mV, solver=solver)
|
|
117
|
+
|
|
118
|
+
self.na = braincell.ion.SodiumFixed(size, E=50.0 * u.mV)
|
|
119
|
+
self.na.add(INa=braincell.channel.Na_HH1952(size))
|
|
120
|
+
|
|
121
|
+
self.k = braincell.ion.PotassiumFixed(size, E=-77.0 * u.mV)
|
|
122
|
+
self.k.add(
|
|
123
|
+
IK=braincell.channel.K_HH1952(size, g_max=gK)
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
self.IL = braincell.channel.IL(
|
|
127
|
+
size,
|
|
128
|
+
E=-54.387 * u.mV,
|
|
129
|
+
g_max=0.03 * u.mS / u.cm**2,
|
|
130
|
+
)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
intact = AblationHH(size=1)
|
|
134
|
+
ablated = AblationHH(
|
|
135
|
+
size=1,
|
|
136
|
+
gK=0.0 * u.mS / u.cm**2,
|
|
137
|
+
)
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
The official potassium-ablation example uses `gK = 0` to remove delayed-rectifier current while preserving the rest of the model. Initialize both cells identically and drive them with the same current before attributing a trace difference to the ablated channel.
|
|
141
|
+
|
|
142
|
+
Do not interpret a waveform difference as a channel effect until it persists under an appropriate time-step refinement. Open `references/solver-library-with-effects.md` when the result may be solver-dependent.
|
|
143
|
+
|
|
144
|
+
## Route custom authoring
|
|
145
|
+
|
|
146
|
+
Open `references/braincell-custom-ion-channel-authoring.md` only when:
|
|
147
|
+
|
|
148
|
+
- no built-in or literature-derived class implements the required kinetics;
|
|
149
|
+
- the requested ion dependency can be stated as a correct `root_type`;
|
|
150
|
+
- the governing equations, units, initialization rule, and validation target are known.
|
|
151
|
+
|
|
152
|
+
For a multicompartment task, establish the `Morphology -> Cell -> paint/place -> init_state` workflow in `references/multicompartment/multicompartment-cell-workflow.md` before reusing the custom-authoring route.
|
|
153
|
+
|
|
154
|
+
## Common failures
|
|
155
|
+
|
|
156
|
+
- Writing a custom channel first: search `braincell.channel` and the source-model templates before authoring.
|
|
157
|
+
- Attaching a channel to the wrong owner: inspect `root_type`; use the matching ion, ordered `MixIons`, or root cell.
|
|
158
|
+
- Treating `IL` and `K_Leak` as interchangeable: `IL` is a root-cell leak with its own `E`; `K_Leak` is potassium-specific.
|
|
159
|
+
- Comparing source models by `g_max` alone: preserve their gating, temperature, shift, and reversal-potential conventions.
|
|
160
|
+
- Using a fixed calcium ion in a calcium-feedback experiment: select dynamic calcium before adding the dependent current.
|
|
161
|
+
- Removing a channel while changing input or numerics: hold all non-ablated conditions constant.
|
|
162
|
+
- Passing a bare maximal conductance: use the density or total-conductance unit expected by the surrounding cell convention.
|
|
163
|
+
|
|
164
|
+
## Sources
|
|
165
|
+
|
|
166
|
+
- Ions & Channels: https://brainx.chaobrain.com/braincell/concepts/ions_channels.html
|
|
167
|
+
- Channels tutorial: https://brainx.chaobrain.com/braincell/tutorials/channel.html
|
|
168
|
+
- `braincell.channel` API: https://brainx.chaobrain.com/braincell/apis/braincell.channel.html
|
|
169
|
+
- Channel ablation: https://brainx.chaobrain.com/braincell/examples/channel_ablation.html
|
|
170
|
+
- Spike-frequency adaptation: https://brainx.chaobrain.com/braincell/examples/spike_frequency_adaptation.html
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# BrainCell ion library
|
|
2
|
+
|
|
3
|
+
Use this reference when choosing a fixed, Nernst-initialized, or dynamic BrainCell ion, or when a channel depends on more than one ion species. Use the built-in ion classes before authoring a custom ion.
|
|
4
|
+
|
|
5
|
+
## Mental model
|
|
6
|
+
|
|
7
|
+
An `Ion` owns one species' `Ci`, `Co`, `E`, and `valence`, packages them as `IonInfo`, and supplies that information to the channels whose currents it aggregates.
|
|
8
|
+
|
|
9
|
+
- A fixed ion keeps its concentrations and reversal potential constant.
|
|
10
|
+
- An initialized-Nernst ion keeps its concentrations fixed but computes `E` from them during initialization and reset.
|
|
11
|
+
- A dynamic-Nernst ion stores `Ci` as `DiffEqState`, derives `E` from the current `Ci`, and lets a concrete ion define `dCi/dt`.
|
|
12
|
+
|
|
13
|
+
Channels carry current; ions organize the shared electrochemical state that drives those currents. Do not put a shared reversal potential independently on every ion-specific channel.
|
|
14
|
+
|
|
15
|
+
## Choose an ion
|
|
16
|
+
|
|
17
|
+
| API | Use when | Important behavior |
|
|
18
|
+
|---|---|---|
|
|
19
|
+
| `braincell.ion.SodiumFixed(size, E=...)` | Use for classical sodium currents with a prescribed reversal potential. | It keeps sodium electrochemical values fixed and accepts channels whose `root_type` is `Sodium`. |
|
|
20
|
+
| `braincell.ion.SodiumInitNernst(size, ...)` | Use when fixed sodium concentrations should determine the initial reversal potential. | It recomputes `E` from the Nernst equation during initialization and reset; it does not integrate concentration. |
|
|
21
|
+
| `braincell.ion.PotassiumFixed(size, E=...)` | Use for classical potassium currents with a prescribed reversal potential. | It keeps potassium electrochemical values fixed and accepts channels whose `root_type` is `Potassium`. |
|
|
22
|
+
| `braincell.ion.PotassiumInitNernst(size, ...)` | Use when fixed potassium concentrations should determine the initial reversal potential. | It recomputes `E` from the Nernst equation during initialization and reset; it does not integrate concentration. |
|
|
23
|
+
| `braincell.ion.CalciumFixed(size, E=..., ...)` | Use when calcium current matters but intracellular calcium feedback does not. | It keeps calcium concentration and reversal potential fixed. |
|
|
24
|
+
| `braincell.ion.CalciumInitNernst(size, ...)` | Use when fixed calcium concentrations should initialize `E`. | It derives `E` from fixed `Ci`, `Co`, temperature, and valence during initialization and reset. |
|
|
25
|
+
| `braincell.ion.CalciumDetailed(size, C_rest=..., tau=..., d=...)` | Use when calcium influx must change intracellular calcium and its Nernst reversal potential. | It integrates `Ci`, receives total current from its calcium channels, and derives `E` live from the current concentration. |
|
|
26
|
+
| `braincell.ion.CalciumFirstOrder(size, ...)` | Use when simplified first-order calcium concentration dynamics are sufficient. | It replaces the detailed calcium-removal model with a lower-complexity concentration ODE. |
|
|
27
|
+
|
|
28
|
+
The ion API also exposes literature-derived calcium-dynamics templates such as `CdpHVA_SU2015_DCN`, `CdpLVA_SU2015_DCN`, and `CdpStC_MA2020_GoC`. Select one only when the requested model or source paper matches it; use the official `braincell.ion` API for the complete installed list.
|
|
29
|
+
|
|
30
|
+
## Attach fixed ions and channels
|
|
31
|
+
|
|
32
|
+
Construct the ion first, then add only channels whose `root_type` matches that ion.
|
|
33
|
+
|
|
34
|
+
| API | Description |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `ion.add(name=channel)` | Use after constructing a single-compartment ion; it registers the channel under that ion and raises a type error when the channel's `root_type` does not match. |
|
|
37
|
+
| `ion.pack_info()` | Use when testing a channel directly; it returns the ion's `IonInfo(Ci, Co, E, valence)`. |
|
|
38
|
+
| `channel.root_type` | Inspect before attachment when the required ion owner is uncertain. |
|
|
39
|
+
|
|
40
|
+
```python
|
|
41
|
+
import braincell
|
|
42
|
+
import brainunit as u
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
na = braincell.ion.SodiumFixed(size=1, E=50.0 * u.mV)
|
|
46
|
+
na.add(INa=braincell.channel.Na_HH1952(size=1))
|
|
47
|
+
|
|
48
|
+
k = braincell.ion.PotassiumFixed(size=1, E=-77.0 * u.mV)
|
|
49
|
+
k.add(IK=braincell.channel.K_HH1952(size=1))
|
|
50
|
+
|
|
51
|
+
assert braincell.channel.Na_HH1952.root_type is braincell.ion.Sodium
|
|
52
|
+
assert braincell.channel.K_HH1952.root_type is braincell.ion.Potassium
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Attach root-cell channels such as `IL` directly to the cell. They do not belong under a sodium, potassium, or calcium ion.
|
|
56
|
+
|
|
57
|
+
## Use dynamic calcium
|
|
58
|
+
|
|
59
|
+
`CalciumDetailed` couples the summed calcium current to intracellular concentration, then feeds the resulting Nernst potential back to calcium channels.
|
|
60
|
+
|
|
61
|
+
| API | Description |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `braincell.ion.CalciumDetailed(...)` | Use for calcium-dependent adaptation, rebound, signaling, or another workflow in which `Ci` changes during integration. |
|
|
64
|
+
| `ca.Ci.value` | Read the current intracellular concentration after initialization; it is the value carried by the ion's `DiffEqState`. |
|
|
65
|
+
| `ca.E` | Read the current Nernst reversal potential; it is derived from the current `Ci`, not a fixed cache. |
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
ca = braincell.ion.CalciumDetailed(
|
|
69
|
+
size=1,
|
|
70
|
+
C_rest=5.0e-5 * u.mM,
|
|
71
|
+
tau=10.0 * u.ms,
|
|
72
|
+
d=0.5 * u.um,
|
|
73
|
+
)
|
|
74
|
+
ca.add(
|
|
75
|
+
ICaT=braincell.channel.CaT_HM1992(
|
|
76
|
+
size=1,
|
|
77
|
+
g_max=2.1 * u.mS / u.cm**2,
|
|
78
|
+
)
|
|
79
|
+
)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The concentration ODE receives the total current from all channels owned by this calcium ion. Do not update `Ci` manually inside the cell loop or compute a second independent reversal potential in the channel.
|
|
83
|
+
|
|
84
|
+
Open `references/mixions-for-adaptation.md` when dynamic calcium participates in an AHP/KCa adaptation or rebound workflow.
|
|
85
|
+
|
|
86
|
+
## Combine ion dependencies
|
|
87
|
+
|
|
88
|
+
Use `MixIons` only when one channel's `root_type` requires several ion species.
|
|
89
|
+
|
|
90
|
+
| API | Description |
|
|
91
|
+
|---|---|
|
|
92
|
+
| `braincell.MixIons(*ions)` | Use to create a multi-ion owner in the exact order declared by the target channel's `root_type`. |
|
|
93
|
+
| `braincell.mix_ions(*ions)` | Use as the convenience function for the same combination. |
|
|
94
|
+
| `mixed.add(name=channel)` | Use to attach a channel after the ordered ion tuple has been constructed. |
|
|
95
|
+
|
|
96
|
+
```python
|
|
97
|
+
kca = braincell.MixIons(k, ca)
|
|
98
|
+
kca.add(
|
|
99
|
+
IAHP=braincell.channel.AHP_De1994(
|
|
100
|
+
size=1,
|
|
101
|
+
g_max=0.3 * u.mS / u.cm**2,
|
|
102
|
+
)
|
|
103
|
+
)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For `AHP_De1994`, the required order is potassium followed by calcium. Match `root_type` exactly; `(ca, k)` is not interchangeable with `(k, ca)`.
|
|
107
|
+
|
|
108
|
+
## Declare ions on a multicompartment cell
|
|
109
|
+
|
|
110
|
+
`braincell.mech.Ion` and `braincell.mech.Channel` are declarations; `Cell.init_state()` lowers them into runtime ion and channel objects over the selected control volumes.
|
|
111
|
+
|
|
112
|
+
```python
|
|
113
|
+
import braincell.mech as mech
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
cell.paint(
|
|
117
|
+
region,
|
|
118
|
+
mech.Ion(
|
|
119
|
+
"CalciumDetailed",
|
|
120
|
+
name="ca_dyn",
|
|
121
|
+
d=0.5 * u.um,
|
|
122
|
+
tau=10.0 * u.ms,
|
|
123
|
+
C_rest=5.0e-5 * u.mM,
|
|
124
|
+
Ci_initializer=2.4e-4 * u.mM,
|
|
125
|
+
),
|
|
126
|
+
)
|
|
127
|
+
cell.paint(
|
|
128
|
+
region,
|
|
129
|
+
mech.Channel(
|
|
130
|
+
"CaT_HM1992",
|
|
131
|
+
ion_name="ca_dyn",
|
|
132
|
+
g_max=2.0 * u.mS / u.cm**2,
|
|
133
|
+
),
|
|
134
|
+
)
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Use an explicit ion `name` when a channel must bind to a particular runtime ion owner. Open `references/multicompartment/multicompartment-cell-workflow.md` before applying this fragment to a `Cell`; that workflow owns morphology, regions, CV policies, initialization, and runtime inspection.
|
|
138
|
+
|
|
139
|
+
## Common failures
|
|
140
|
+
|
|
141
|
+
- Adding a channel to the wrong ion: inspect `root_type`, then attach it to the matching ion or ordered `MixIons`.
|
|
142
|
+
- Treating an ion as the current-producing mechanism: attach channels; the ion aggregates their current and owns shared electrochemical information.
|
|
143
|
+
- Using fixed calcium when the result depends on calcium accumulation: use `CalciumDetailed`, `CalciumFirstOrder`, or a matching documented template.
|
|
144
|
+
- Expecting `InitNernstIon` concentration to evolve: choose a dynamic ion when `Ci` must be integrated.
|
|
145
|
+
- Passing bare concentrations, voltages, time constants, temperature, or shell depth: use BrainUnit quantities.
|
|
146
|
+
- Authoring a new ion before checking `braincell.ion`: inspect the installed API and literature-derived templates first.
|
|
147
|
+
|
|
148
|
+
Open `references/braincell-custom-ion-channel-authoring.md` only when the required ion species or concentration dynamics remain unavailable after that inspection.
|
|
149
|
+
|
|
150
|
+
## Sources
|
|
151
|
+
|
|
152
|
+
- Ions & Channels: https://brainx.chaobrain.com/braincell/concepts/ions_channels.html
|
|
153
|
+
- Ions tutorial: https://brainx.chaobrain.com/braincell/tutorials/ion.html
|
|
154
|
+
- `braincell.ion` API: https://brainx.chaobrain.com/braincell/apis/braincell.ion.html
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
# MixIons for adaptation
|
|
2
|
+
|
|
3
|
+
Use this reference when adding a calcium-activated potassium current, calcium-dependent afterhyperpolarization, spike-frequency adaptation, or a thalamic/rebound variant that needs dynamic calcium plus a K/Ca mixed current.
|
|
4
|
+
|
|
5
|
+
In single-compartment models, use the class pattern below directly. In multicompartment `Cell` work, use this reference for ion/channel composition choices, but keep morphology, targeting, `paint`, `place`, CV policy, clamps, and probes in `references/multicompartment/multicompartment-cell-workflow.md`.
|
|
6
|
+
|
|
7
|
+
## Rule
|
|
8
|
+
|
|
9
|
+
Use `braincell.MixIons(k, ca)` only when a channel depends on multiple ions. For calcium-activated potassium currents, potassium supplies the reversal potential and calcium supplies intracellular concentration dynamics. Keep ion order consistent with the channel's `root_type`.
|
|
10
|
+
|
|
11
|
+
## Pattern
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
import braincell
|
|
15
|
+
import braintools
|
|
16
|
+
import brainunit as u
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class AdaptingCell(braincell.SingleCompartment):
|
|
20
|
+
def __init__(self, size, solver="ind_exp_euler"):
|
|
21
|
+
super().__init__(
|
|
22
|
+
size,
|
|
23
|
+
V_initializer=braintools.init.Constant(-65. * u.mV),
|
|
24
|
+
V_th=20. * u.mV,
|
|
25
|
+
solver=solver,
|
|
26
|
+
)
|
|
27
|
+
|
|
28
|
+
self.na = braincell.ion.SodiumFixed(size, E=50. * u.mV)
|
|
29
|
+
self.na.add(INa=braincell.channel.Na_Ba2002(size, V_sh=-30. * u.mV))
|
|
30
|
+
|
|
31
|
+
self.k = braincell.ion.PotassiumFixed(size, E=-90. * u.mV)
|
|
32
|
+
self.k.add(IKL=braincell.channel.K_Leak(size, g_max=0.01 * (u.mS / u.cm ** 2)))
|
|
33
|
+
self.k.add(
|
|
34
|
+
IDR=braincell.channel.KDR_Ba2002(
|
|
35
|
+
size,
|
|
36
|
+
V_sh=-30. * u.mV,
|
|
37
|
+
q10=2.0,
|
|
38
|
+
temp=u.celsius2kelvin(16.),
|
|
39
|
+
)
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
self.ca = braincell.ion.CalciumDetailed(
|
|
43
|
+
size,
|
|
44
|
+
C_rest=5e-5 * u.mM,
|
|
45
|
+
tau=10. * u.ms,
|
|
46
|
+
d=0.5 * u.um,
|
|
47
|
+
)
|
|
48
|
+
self.ca.add(ICaL=braincell.channel.CaL_IS2008(size, g_max=0.5 * (u.mS / u.cm ** 2)))
|
|
49
|
+
self.ca.add(ICaN=braincell.channel.CaN_IS2008(size, g_max=0.5 * (u.mS / u.cm ** 2)))
|
|
50
|
+
self.ca.add(ICaT=braincell.channel.CaT_HM1992(size, g_max=2.1 * (u.mS / u.cm ** 2)))
|
|
51
|
+
self.ca.add(ICaHT=braincell.channel.CaHT_HM1992(size, g_max=3.0 * (u.mS / u.cm ** 2)))
|
|
52
|
+
|
|
53
|
+
self.kca = braincell.MixIons(self.k, self.ca)
|
|
54
|
+
self.kca.add(IAHP=braincell.channel.AHP_De1994(size, g_max=0.3 * (u.mS / u.cm ** 2)))
|
|
55
|
+
|
|
56
|
+
self.IL = braincell.channel.IL(
|
|
57
|
+
size,
|
|
58
|
+
E=-70. * u.mV,
|
|
59
|
+
g_max=0.0075 * (u.mS / u.cm ** 2),
|
|
60
|
+
)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Rebound Input Variant
|
|
64
|
+
|
|
65
|
+
For post-inhibitory rebound, add or retain a low-threshold T-type calcium current such as `CaT_HM1992` and drive a time-dependent hyperpolarizing input.
|
|
66
|
+
|
|
67
|
+
```python
|
|
68
|
+
def I_of_t(t):
|
|
69
|
+
return u.math.where(
|
|
70
|
+
t < 200. * u.ms,
|
|
71
|
+
-2. * u.uA / u.cm ** 2,
|
|
72
|
+
0. * u.uA / u.cm ** 2,
|
|
73
|
+
)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Checks
|
|
77
|
+
|
|
78
|
+
- Add AHP/KCa channels to the `MixIons` owner, not directly to `self.k` or `self.ca`.
|
|
79
|
+
- Use dynamic calcium such as `CalciumDetailed` when intracellular calcium should feed back into adaptation.
|
|
80
|
+
- Preserve a potassium ion container even when the adaptation current is calcium-dependent; the K reversal potential still matters.
|
|
81
|
+
- Inspect `channel.root_type` before changing ion order.
|
package/skills/braincell/references/multicompartment/braincell-manual-morphology-construction.md
ADDED
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
# BrainCell manual morphology construction
|
|
2
|
+
|
|
3
|
+
Use this reference after opening `references/multicompartment/multicompartment-cell-workflow.md` when no existing reconstruction should be loaded and the task requires explicit branch geometry, anatomical types, or parent-child topology. Return to the workflow before choosing CVs, mechanisms, probes, or a solver.
|
|
4
|
+
|
|
5
|
+
## Mental model
|
|
6
|
+
|
|
7
|
+
A `Branch` is one immutable, unbranched cable geometry; a `Morphology` is the mutable tree that names and attaches those branches. Neither object is a list of simulation compartments.
|
|
8
|
+
|
|
9
|
+
Typed branch constructors preserve anatomical meaning for later region selectors. `Cell` creates control volumes only after the morphology is complete.
|
|
10
|
+
|
|
11
|
+
## Workflow
|
|
12
|
+
|
|
13
|
+
| Step | Action | Important result |
|
|
14
|
+
|---|---|---|
|
|
15
|
+
| Choose geometry form | Use segment lengths when coordinates are unavailable; use 3-D points when physical coordinates matter. | One unit-aware immutable branch per unbranched cable. |
|
|
16
|
+
| Type branches | Construct soma, dendrite, and axon branches with typed classes. | Later selectors can target anatomical `type` reliably. |
|
|
17
|
+
| Build the tree | Create one root and attach every child with explicit names and endpoints. | One connected, acyclic morphology with reviewable topology. |
|
|
18
|
+
| Inspect | Check topology, branch order, metrics, coordinates, radii, and types. | Geometry errors are found before discretization and mechanism placement. |
|
|
19
|
+
| Return to the parent | Pass the trusted `Morphology` into the multicompartment workflow. | CV policy, `Cell`, `paint()`, `place()`, and simulation remain outside this leaf. |
|
|
20
|
+
|
|
21
|
+
## Construct branches
|
|
22
|
+
|
|
23
|
+
Choose one geometric representation per branch.
|
|
24
|
+
|
|
25
|
+
| API | Description |
|
|
26
|
+
|---|---|
|
|
27
|
+
| `braincell.Branch.from_lengths(lengths=..., radii=..., type=...)` | Use when segment lengths and shared boundary radii are known but 3-D coordinates are not; `radii` has one more value than `lengths`. |
|
|
28
|
+
| `braincell.Branch.from_lengths(lengths=..., radii_proximal=..., radii_distal=..., type=...)` | Use when every segment needs an explicit proximal/distal radius pair, including a radius jump. |
|
|
29
|
+
| `braincell.Branch.from_points(points=..., radii=..., type=...)` | Use when ordered 3-D coordinates are known; it computes lengths from consecutive points and requires one shared radius per point. |
|
|
30
|
+
| `braincell.Soma.from_points(...)` | Use for a point-defined soma without passing `type`; the typed constructor assigns `soma`. |
|
|
31
|
+
| `braincell.BasalDendrite.from_points(...)` | Use for a point-defined basal dendrite without passing `type`. |
|
|
32
|
+
| `braincell.ApicalDendrite.from_points(...)` | Use for a point-defined apical dendrite without passing `type`. |
|
|
33
|
+
| `braincell.Axon.from_points(...)` | Use for a point-defined axon without passing `type`. |
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
import brainunit as u
|
|
37
|
+
from braincell import Branch
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
schematic_dendrite = Branch.from_lengths(
|
|
41
|
+
lengths=[12.0, 18.0, 10.0] * u.um,
|
|
42
|
+
radii=[3.0, 2.4, 1.8, 1.2] * u.um,
|
|
43
|
+
type="dendrite",
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
point_dendrite = Branch.from_points(
|
|
47
|
+
points=[
|
|
48
|
+
(0.0, 0.0, 0.0),
|
|
49
|
+
(12.0, 0.0, 0.0),
|
|
50
|
+
(12.0, 18.0, 0.0),
|
|
51
|
+
(16.0, 34.0, 6.0),
|
|
52
|
+
] * u.um,
|
|
53
|
+
radii=[3.0, 2.4, 1.8, 1.2] * u.um,
|
|
54
|
+
type="dendrite",
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
assert schematic_dendrite.n_segments == 3
|
|
58
|
+
assert point_dendrite.points.shape == (4, 3)
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
All geometry must carry BrainUnit length units. Constructors reject bare values, inconsistent shapes, missing radii, invalid branch types, and zero total length. Consecutive equal points produce a zero-length-segment warning.
|
|
62
|
+
|
|
63
|
+
Use `from_lengths()` for schematic cable and `from_points()` when projected views, Euclidean measurements, or 3-D rendering matter. Do not invent coordinates only to satisfy `from_points()`.
|
|
64
|
+
|
|
65
|
+
## Build a typed tree
|
|
66
|
+
|
|
67
|
+
Create one root with `Morphology.from_root()`, then attach each branch exactly once.
|
|
68
|
+
|
|
69
|
+
| API | Description |
|
|
70
|
+
|---|---|
|
|
71
|
+
| `braincell.Morphology.from_root(branch, name=...)` | Use to create a mutable tree around the root branch; prefer an explicit, selector-safe root name such as `soma`. |
|
|
72
|
+
| `morphology.attach(parent=..., child_branch=..., child_name=..., parent_x=..., child_x=...)` | Use for explicit attachment; it returns the newly attached `MorphoBranch` and raises for an unknown parent or invalid endpoint. |
|
|
73
|
+
| `morphology.soma.dendrite = branch` | Use only as concise syntax when the parent and default endpoints are obvious. |
|
|
74
|
+
| `morphology.soma[parent_x, child_x].axon = branch` | Use as concise syntax when the attachment endpoints must remain visible. |
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
import brainunit as u
|
|
78
|
+
from braincell import Axon, BasalDendrite, Morphology, Soma
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
soma = Soma.from_points(
|
|
82
|
+
points=[(0.0, 0.0, 0.0), (12.0, 0.0, 0.0)] * u.um,
|
|
83
|
+
radii=[6.0, 6.0] * u.um,
|
|
84
|
+
)
|
|
85
|
+
basal = BasalDendrite.from_points(
|
|
86
|
+
points=[
|
|
87
|
+
(12.0, 0.0, 0.0),
|
|
88
|
+
(26.0, 8.0, 0.0),
|
|
89
|
+
(40.0, 14.0, 0.0),
|
|
90
|
+
] * u.um,
|
|
91
|
+
radii=[2.6, 2.0, 1.4] * u.um,
|
|
92
|
+
)
|
|
93
|
+
axon = Axon.from_points(
|
|
94
|
+
points=[
|
|
95
|
+
(0.0, 0.0, 0.0),
|
|
96
|
+
(-12.0, -6.0, 0.0),
|
|
97
|
+
(-26.0, -14.0, -2.0),
|
|
98
|
+
] * u.um,
|
|
99
|
+
radii=[1.0, 0.8, 0.6] * u.um,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
morphology = Morphology.from_root(soma, name="soma")
|
|
103
|
+
morphology.attach(
|
|
104
|
+
parent="soma",
|
|
105
|
+
child_branch=basal,
|
|
106
|
+
child_name="basal",
|
|
107
|
+
parent_x=1.0,
|
|
108
|
+
child_x=0.0,
|
|
109
|
+
)
|
|
110
|
+
morphology.attach(
|
|
111
|
+
parent="soma",
|
|
112
|
+
child_branch=axon,
|
|
113
|
+
child_name="axon",
|
|
114
|
+
parent_x=0.0,
|
|
115
|
+
child_x=0.0,
|
|
116
|
+
)
|
|
117
|
+
|
|
118
|
+
assert morphology.n_branches == 3
|
|
119
|
+
assert morphology.has_full_point_geometry
|
|
120
|
+
print(morphology.topo())
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`parent_x` may be `0`, `0.5`, or `1`; midpoint attachment is allowed only on a soma. `child_x` may currently be `0` or `1`. Keep branch names valid Python identifiers and avoid names reserved by morphology methods or metrics.
|
|
124
|
+
|
|
125
|
+
Coordinates at an attachment should describe the intended physical junction. The topology API records which endpoints connect, but it does not make inconsistent point coordinates scientifically valid.
|
|
126
|
+
|
|
127
|
+
## Inspect before simulation
|
|
128
|
+
|
|
129
|
+
Construction checks structural input constraints; inspection establishes that the resulting tree represents the intended neuron.
|
|
130
|
+
|
|
131
|
+
| API | Description |
|
|
132
|
+
|---|---|
|
|
133
|
+
| `morphology.topo()` | Use to review the named parent-child tree. |
|
|
134
|
+
| `morphology.branches` | Use to inspect every branch in default node order. |
|
|
135
|
+
| `morphology.branch(name=...)` | Use to inspect one named branch and its type. |
|
|
136
|
+
| `morphology.branch_by_order(order=...)` | Use to compare default, type, or depth ordering. |
|
|
137
|
+
| `morphology.metric` | Use to inspect branch counts, stems, bifurcations, path length, area, volume, and coordinate-dependent metrics. |
|
|
138
|
+
| `morphology.has_full_point_geometry` | Use before coordinate-dependent analysis or 3-D rendering. |
|
|
139
|
+
| `morphology.vis2d(...)` | Use for a topology or projected-geometry check without constructing a `Cell`. |
|
|
140
|
+
| `morphology.vis3d(...)` | Use only when every branch has complete 3-D point geometry. |
|
|
141
|
+
|
|
142
|
+
Verify at least:
|
|
143
|
+
|
|
144
|
+
- exactly one intended root;
|
|
145
|
+
- every expected branch appears once in `topo()`;
|
|
146
|
+
- soma, dendrite, and axon types match later selectors;
|
|
147
|
+
- all lengths and radii are positive and use the intended scale;
|
|
148
|
+
- branch attachment endpoints and coordinates agree;
|
|
149
|
+
- branch counts, path distances, surface area, and volume are plausible;
|
|
150
|
+
- `has_full_point_geometry` is true before relying on Euclidean metrics or 3-D views.
|
|
151
|
+
|
|
152
|
+
Open `references/multicompartment/topology-building-and-visualization.md` when branch, CV, or runtime-node visualization is required. Return to `references/multicompartment/multicompartment-cell-workflow.md` when the failure appears only after CV construction or runtime lowering.
|
|
153
|
+
|
|
154
|
+
## Return to the multicompartment workflow
|
|
155
|
+
|
|
156
|
+
After inspection, return to `references/multicompartment/multicompartment-cell-workflow.md` and continue with:
|
|
157
|
+
|
|
158
|
+
`trusted Morphology -> CV policy -> Cell -> paint -> place -> init_state -> inspect runtime -> run -> verify`
|
|
159
|
+
|
|
160
|
+
Do not choose a CV count from the number of source points or branches. The CV policy owns simulation resolution.
|
|
161
|
+
|
|
162
|
+
## Common failures
|
|
163
|
+
|
|
164
|
+
- Passing bare coordinates, lengths, or radii: attach BrainUnit length units to every geometric value.
|
|
165
|
+
- Passing `type=` to a typed constructor: use either `Branch(..., type=...)` or a typed subclass, not both.
|
|
166
|
+
- Mixing the two radius forms: provide `radii` or the complete proximal/distal pair.
|
|
167
|
+
- Creating a disconnected or multiply attached branch: attach every non-root branch exactly once.
|
|
168
|
+
- Using an invalid midpoint attachment: reserve `parent_x=0.5` for a soma.
|
|
169
|
+
- Losing anatomical types: construct typed branches before writing type-based filters.
|
|
170
|
+
- Treating successful construction as biological validation: inspect topology and morphology metrics before building a `Cell`.
|
|
171
|
+
- Treating branches or points as compartments: select and refine a CV policy in the parent workflow.
|
|
172
|
+
- Adding mechanisms before geometry is trusted: finish morphology inspection first.
|
|
173
|
+
|
|
174
|
+
## Sources
|
|
175
|
+
|
|
176
|
+
- Morphology concept: https://brainx.chaobrain.com/braincell/concepts/morphology.html
|
|
177
|
+
- Morphology tutorial: https://brainx.chaobrain.com/braincell/tutorials/morphology.html
|
|
178
|
+
- Cell tutorial: https://brainx.chaobrain.com/braincell/tutorials/cell.html
|
|
179
|
+
- `Branch` API: https://brainx.chaobrain.com/braincell/apis/generated/braincell.Branch.html
|
|
180
|
+
- `Morphology` API: https://brainx.chaobrain.com/braincell/apis/generated/braincell.Morphology.html
|