Skip to content

Commit

Permalink
Merge pull request #430 from Hjorthmedh/dev
Browse files Browse the repository at this point in the history
Updated Neuromodulation code, using RxD
  • Loading branch information
Hjorthmedh authored Sep 30, 2024
2 parents 8d3141c + 252e983 commit 25c9fd0
Show file tree
Hide file tree
Showing 208 changed files with 220,490 additions and 1,896 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ There are a number of examples for how to create and run networks on github whic

https://github.com/Hjorthmedh/Snudda/tree/master/examples/notebooks

## Command line examle
## Command line example

Once installed Snudda can also be run from the command line, using the snudda command. Below is a small list of the relevant commands that can be used.

Expand Down
13,689 changes: 13,627 additions & 62 deletions examples/notebooks/Parkinson/GenerateParkinsonNetwork-example-10k.ipynb

Large diffs are not rendered by default.

340 changes: 184 additions & 156 deletions examples/notebooks/ProjectionExample/composite_axon_projections.ipynb

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions examples/notebooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Here is a collection of Jupyter Notebooks, some of the workflows are split over
* [simple_network_parallel](simple_network_parallel.ipynb) how to use ipyparallel when running Snudda
* [custom_slice_example](custom_slice_example.ipynb) shows how to create custom slice and define your own connectivity rules for neuron types.
* [population_unit_network](population_unit_network.ipynb) how to define population units.
* [population_unit_mesh](population_unit_mesh.ipynb) how to define population units specified by volume meshes.
* [example_of_density_function](example_of_density_function.ipynb) how to specify density variations using a function of (x,y,z) in a volume.
* [example_of_neuron_rotations](example_of_neuron_rotations.ipynb) shows how to rotate neurons based on position.
* [bend_morphologies](bend_morphologies.ipynb) shows how to make the neurons bend the axons and dendrites at the edge of the mesh, to keep them constrained to the volume.
Expand Down Expand Up @@ -42,3 +43,5 @@ Here is a collection of Jupyter Notebooks, some of the workflows are split over
## Additional notebooks
* [Paired current injection](validation/synapses/network_pair_pulse_simulation.ipynb) in a simulated network
* [Neuromodulation examples](https://github.com/jofrony/Neuromodulation-software/tree/main/examples) in a network
* [Minimal current injection example](neuron_with_current_injection.ipynb)

269 changes: 134 additions & 135 deletions examples/notebooks/VirtualNeurons/VirtualNeurons.ipynb

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions examples/notebooks/neuromodulation/REAME.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# TODO -- Neuromdulation

- Run short simulation of each neuron, without dopamine, then turn on dopamine.
- dSPN should increase frequency, iSPN should decrease frequency

- Add dopamine cascade for iSPN, how do we model D1 and D2 receptors?
- How do we treat diffusion of dopamine? (it should be external, axial diffusion)
- Does cAMP diffuse internally?

- Direct stimulation of dopamine, can we use a dopamine axon?
- Volymetric transmission, where two cells might read the same spatial concentration.

(- Tripartite synapse)
10 changes: 10 additions & 0 deletions examples/notebooks/neuromodulation/bath_current_injection.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"0": {
"time": [0, 0.5, 1, 10],
"current": [0, 600e-12, 0, 0]
},
"1": {
"time": [0, 0.5, 1, 10],
"current": [0, 500e-12, 0, 0]
}
}
33 changes: 33 additions & 0 deletions examples/notebooks/neuromodulation/config/mesh/cube-mesh-5e-05.obj
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Generated by create_cube_mesh.py
# Striatum cube mesh, centre: [0.00475 0.004 0.00775], side: 5e-05

g cube

v 4725.000000 3975.000000 7725.000000
v 4725.000000 3975.000000 7775.000000
v 4725.000000 4025.000000 7725.000000
v 4725.000000 4025.000000 7775.000000
v 4775.000000 3975.000000 7725.000000
v 4775.000000 3975.000000 7775.000000
v 4775.000000 4025.000000 7725.000000
v 4775.000000 4025.000000 7775.000000

vn 0.0 0.0 1.0
vn 0.0 0.0 -1.0
vn 0.0 1.0 0.0
vn 0.0 -1.0 0.0
vn 1.0 0.0 0.0
vn -1.0 0.0 0.0

f 1//2 7//2 5//2
f 1//2 3//2 7//2
f 1//6 4//6 3//6
f 1//6 2//6 4//6
f 3//3 8//3 7//3
f 3//3 4//3 8//3
f 5//5 7//5 8//5
f 5//5 8//5 6//5
f 1//4 5//4 6//4
f 1//4 6//4 2//4
f 2//1 6//1 8//1
f 2//1 8//1 4//1
12 changes: 12 additions & 0 deletions examples/notebooks/neuromodulation/config/network.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"network_path": "my_network",
"snudda_data": "/home/hjorth/HBP/BasalGangliaData/data",

"random_seed": {
"master_seed": 1234
},

"regions": {
"Striatum" : "striatum.json"
}
}
18 changes: 18 additions & 0 deletions examples/notebooks/neuromodulation/config/neurons/chin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"ChIN": {
"neuron_path": {
"ChIN_0": "$SNUDDA_DATA/neurons/striatum/chin/str-chin-e170614_cell6-m17JUL301751_170614_no6_MD_cell_1_x63-v20190710"
},

"neuron_type": "neuron",
"rotation_mode": "random",
"volume_id": "Striatum",
"stay_inside_mesh": false,
"fraction": 0.011,
"axon_density": [
"r",
"5000*1e12/3*exp(-r/120e-6)",
0.00035
]
}
}
17 changes: 17 additions & 0 deletions examples/notebooks/neuromodulation/config/neurons/dspn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"dSPN": {
"neuron_path": {
"dSPN_0": "$SNUDDA_DATA/neurons/striatum/dspn/str-dspn-e150602_c1_D1-mWT-0728MSN01-v20211026",
"dSPN_1": "$SNUDDA_DATA/neurons/striatum/dspn/str-dspn-e150917_c10_D1-mWT-P270-20-v20211026",
"dSPN_2": "$SNUDDA_DATA/neurons/striatum/dspn/str-dspn-e150917_c6_D1-m21-6-DE-v20211028",
"dSPN_3": "$SNUDDA_DATA/neurons/striatum/dspn/str-dspn-e150917_c9_D1-mWT-1215MSN03-v20211026"
},

"neuron_type": "neuron",
"rotation_mode": "random",
"volume_id": "Striatum",
"stay_inside_mesh": false,
"fraction": 0.475
}

}
16 changes: 16 additions & 0 deletions examples/notebooks/neuromodulation/config/neurons/fs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"FS": {
"neuron_path": {
"FS_0": "$SNUDDA_DATA/neurons/striatum/fs/str-fs-e160628_FS2-mMTC180800A-IDB-v20210210",
"FS_1": "$SNUDDA_DATA/neurons/striatum/fs/str-fs-e161024_FS16-mDR-rat-Mar-13-08-1-536-R-v20210210",
"FS_2": "$SNUDDA_DATA/neurons/striatum/fs/str-fs-e161205_FS1-mBE104E-v20210209",
"FS_3": "$SNUDDA_DATA/neurons/striatum/fs/str-fs-e161205_FS1-mMTC180800A-IDB-v20210210"
},

"neuron_type": "neuron",
"rotation_mode": "random",
"volume_id": "Striatum",
"stay_inside_mesh": false,
"fraction": 0.013
}
}
16 changes: 16 additions & 0 deletions examples/notebooks/neuromodulation/config/neurons/ispn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"iSPN": {
"neuron_path": {
"iSPN_0": "$SNUDDA_DATA/neurons/striatum/ispn/str-ispn-e150908_c4_D2-m51-5-DE-v20211026",
"iSPN_1": "$SNUDDA_DATA/neurons/striatum/ispn/str-ispn-e150917_c11_D2-mWT-MSN1-v20211026",
"iSPN_2": "$SNUDDA_DATA/neurons/striatum/ispn/str-ispn-e151123_c1_D2-mWT-P270-09-v20211026",
"iSPN_3": "$SNUDDA_DATA/neurons/striatum/ispn/str-ispn-e160118_c10_D2-m46-3-DE-v20211026"
},

"neuron_type": "neuron",
"rotation_mode": "random",
"volume_id": "Striatum",
"stay_inside_mesh": false,
"fraction": 0.475
}
}
27 changes: 27 additions & 0 deletions examples/notebooks/neuromodulation/config/neurons/lts.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"LTS": {
"neuron_path" : {
"LTS_0" : "$SNUDDA_DATA/neurons/striatum/lts/LTS_180118_morp_9862_updated_20210301",
"LTS_1" : "$SNUDDA_DATA/neurons/striatum/lts/LTS_180118_morp_9862_updated_April2022"
},

"neuron_type": "neuron",
"rotation_mode": "random",
"volume_id": "Striatum",
"stay_inside_mesh": false,
"fraction": 0.007,
"axon_density": [
"xyz",
"12*3000*1e12*( 0.25*exp(-(((x-200e-6)/100e-6)**2 + ((y-0)/50e-6)**2 + ((z-0)/30e-6)**2)) + 1*exp(-(((x-300e-6)/300e-6)**2 + ((y-0)/15e-6)**2 + ((z-0)/10e-6)**2)) + 1*exp(-(((x-700e-6)/100e-6)**2 + ((y-0)/15e-6)**2 + ((z-0)/15e-6)**2)) )",
[
-0.0002,
0.0009,
-0.0001,
0.0001,
-3e-05,
3e-05
]
]
}
}

16 changes: 16 additions & 0 deletions examples/notebooks/neuromodulation/config/pop1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"populations": {
"method": "radial_density",
"centres": [[ 0.00475, 0.004, 0.00775 ],
[ 0.00475, 0.004, 0.00775 ]],
"probability_functions": [
"(d < 300e-6) * 1",
"(d < 300e-6) * 1"
],
"unit_id": [ 1, 2 ],
"neuron_types": [["dSPN", "iSPN"],
["dSPN", "iSPN"]],
"num_neurons": [ 4000, 4000 ]

}
}
29 changes: 29 additions & 0 deletions examples/notebooks/neuromodulation/config/striatum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"Striatum": {
"num_neurons": 10,
"volume": {
"mesh_file": "config/mesh/cube-mesh-5e-05.obj",
"d_min": 1.5e-5,
"num_putative_points": 1000,
"random_seed": 123456,
"!density": {
"my_neuron": {
"density_function": "abs(x)"
}
},
"!neuron_orientation": {
"my_neuron": {
"rotation_mode": "vector_field",
"rotation_field_file": "my_rotation_file.json"
}
}
},
"neurons": ["neurons/dspn.json",
"neurons/ispn.json",
"!neurons/fs.json",
"!neurons/chin.json",
"!neurons/lts.json"],
"connectivity": ["$SNUDDA_DATA/connectivity/striatum/striatum-connectivity.json"],
"!populations": "pop1.json"
}
}
38 changes: 38 additions & 0 deletions examples/notebooks/neuromodulation/data/DA-bath-experiment.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"network_file": "networks/neuromodulation_bath/network-synapses.hdf5",
"input_file": "networks/neuromodulation_bath/input-spikes.hdf5",
"output_file": "networks/neuromodulation_bath/simulation/output.hdf5",
"log_file": "networks/neuromodulation_bath/log/network-simulation-bath.txt",
"time": 4.0,
"record_all_soma": true,
"record_rxd_species_all": [0, 1],
"record_density_mechanism": {
"kir_ms.modulation_factor": {
"neuron_id": [0, 1],
"section_id": [-1, -1],
"section_x": [0.5, 0.5]
},
"naf_ms.modulation_factor": {
"neuron_id": [0, 1],
"section_id": [-1, -1],
"section_x": [0.5, 0.5]
},
"kaf_ms.modulation_factor_g": {
"neuron_id": [0, 1],
"section_id": [-1, -1],
"section_x": [0.5, 0.5]
},
"kaf_ms.modulation_factor_shift": {
"neuron_id": [0, 1],
"section_id": [-1, -1],
"section_x": [0.5, 0.5]
}
},
"rxd_enable_extracellular": false,
"bath_application": {
"DA": {
"time": [0, 1.99, 2, 4],
"concentration": [0, 0, 60e-6, 60e-6]
}
}
}
38 changes: 38 additions & 0 deletions examples/notebooks/neuromodulation/data/DASyn.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
NEURON {
POINT_PROCESS DASyn
RANGE quanta, tau, open
}
UNITS {
(mM) = (milli / liter)
}

PARAMETER {
quanta = 1e-4 (mM/ms)
tau = 10 (ms)
}

INITIAL {
open = 0
}

STATE {
open (1)
}

BREAKPOINT {SOLVE state METHOD cnexp}

DERIVATIVE state {
open' = -open/tau
}


: 33000 dopamine molecules per vesicle : Omiatek, D., Bressler, A.,
: Cans, AS. et al. The real catecholamine content of secretory vesicles
: in the CNS revealed by electrochemical cytometry. Sci Rep 3, 1447
: (2013). https://doi.org/10.1038/srep01447



NET_RECEIVE(weight) {
open = open + weight
}
Loading

0 comments on commit 25c9fd0

Please sign in to comment.