model¶
Cell morphology and recipe definitions for toric spine models.
toric_spines_sim.model
¶
Cell morphology and recipe definitions for toric spine models.
TSModel(swc_path, synapses, gap_junctions, record_points, parameters)
dataclass
¶
Morphology specification for toric spine models.
Attributes:
| Name | Type | Description |
|---|---|---|
swc_path |
Path
|
Path to the base SWC morphology for the toric spine. |
synapses |
dict[str, SynapsePoint]
|
Dictionary of synapse labels to instances of |
gap_junctions |
dict[str, GapJunctionPoint]
|
Dictionary of gap junction labels to instances of |
record_points |
dict[str, Tuple[float, float, float]]
|
Dictionary of record site labels to 3D points (x,y,z). |
parameters |
ParameterSet
|
Sampled simulation parameters (from |
build_cell()
¶
Construct an Arbor cable cell from the SWC and explicit placements.
Returns:
| Type | Description |
|---|---|
dict
|
Intermediate objects keyed by:
|
Examples:
Source code in toric_spines_sim/model/model.py
127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 | |
TSRecipe(cell, synapses, gap_junctions, record_points, events=None, parameters=None, custom_catalogue=None)
¶
Bases: recipe
Arbor recipe for a single toric-spine cell with per-synapse events.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cell
|
cable_cell
|
Cell from |
required |
synapses
|
dict[str, SynapsePoint]
|
Synapse labels used as Arbor place tags (typically |
required |
gap_junctions
|
dict[str, GapJunctionPoint]
|
Gap junctions for CYCLE_BREAK / MULTI_NECK reconnects. |
required |
record_points
|
dict[str, tuple]
|
Voltage probe labels and XYZ positions. |
required |
events
|
TsGroup or dict[str, list[float]]
|
Event times in milliseconds. A TsGroup is mapped by index to
|
None
|
parameters
|
ParameterSet
|
Required sampled bank (ions, leak, temperature, …). |
None
|
custom_catalogue
|
catalogue
|
Extra NMODL mechanisms (ampa, nmda, hhnotemp, …). |
None
|
Source code in toric_spines_sim/model/recipe.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
GapJunctionPoint(index_pair, location, weight, location_b=None)
dataclass
¶
One electrical reconnect between two SWC samples.
Attributes:
| Name | Type | Description |
|---|---|---|
index_pair |
Tuple[int, int]
|
SWC node IDs |
location |
Tuple[float, float, float]
|
XYZ of node |
weight |
float
|
Arbor gap-junction weight (dimensionless conductance scale). |
location_b |
Optional[Tuple[float, float, float]]
|
XYZ of node |
SynapsePoint(location, model, mechanism, synapse_params, mechanism_params)
dataclass
¶
One placed synapse: XYZ, mechanism name, and parameter dicts.
synapse_params uses human-readable keys (gmax_uS, tau_ms, …).
mechanism_params is the same values renamed for Arbor (gmax,
tau, …). TSModel applies mechanism_params.
Attributes:
| Name | Type | Description |
|---|---|---|
location |
tuple of float
|
XYZ in the same units as the SWC. |
model |
str
|
Registry key ( |
mechanism |
str
|
NMODL mechanism name (e.g. |
synapse_params, mechanism_params |
dict
|
Conductance/time-constant values; see above. |
Examples:
>>> synapse_population = SynapsePopulation.from_file("TS1_synpts.txt", "ampa", params)
>>> synapse_population.synapses["syn_0"].mechanism_params["gmax"]
SynapsePopulation(model, locations, global_parameters, parameter_override=None, label_prefix='syn')
¶
A homogeneous population of synapses sharing one model type.
Each synapse is assigned parameters by sampling an internal ParameterBank
built from global_parameters. By default all parameters have
is_sampled=False, so each synapse receives the same values.
Examples:
>>> synapse_population = SynapsePopulation.from_file("TS1_synpts.txt", "ampa", params)
>>> synapse_population.synapses["syn_0"].mechanism
'ampasyn'
Source code in toric_spines_sim/model/synapse.py
from_file(points_file, model, global_parameters, parameter_override=None, label_prefix='syn')
classmethod
¶
Load XYZ locations from a file and build a synapse population.
Source code in toric_spines_sim/model/synapse.py
merge(*populations)
staticmethod
¶
Combine multiple populations into one label -> SynapsePoint dict.
Source code in toric_spines_sim/model/synapse.py
check_catalogue(path=None)
¶
Load the custom NMODL catalogue, or raise if it is missing or unusable.
Checks that custom-catalogue.so exists, that Arbor can load it, and
that every mechanism in mechanisms/my_catalogue/*.mod is present.
Rebuild after changing .mod files, upgrading Arbor, or changing
OS/compiler; do not copy a .so between machines.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Catalogue file. Default: |
None
|
Returns:
| Type | Description |
|---|---|
catalogue
|
|
Source code in toric_spines_sim/model/model.py
prepare_gap_junctions(swc_file, parameters)
¶
Build gap junctions from CYCLE_BREAK and MULTI_NECK reconnect headers.
Returns:
| Type | Description |
|---|---|
dict[str, GapJunctionPoint]
|
Labels |
Examples: