Skip to content

Commit

Permalink
Some minimal documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jun 6, 2024
1 parent af12b7e commit cf47415
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 24 deletions.
Binary file added NeuroML2/AWC_RMD_NeuroML.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 8 additions & 8 deletions NeuroML2/Fig4C_AWCon.net.nml
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
Generated network: Fig4C_AWCon
Generation seed: 1234</notes>
<include href="AWCon.cell.nml"/>
<pulseGenerator id="iclamp_stim_min4" delay="200ms" duration="500ms" amplitude="-4pA"/>
<pulseGenerator id="iclamp_stim_0" delay="200ms" duration="500ms" amplitude="0pA"/>
<pulseGenerator id="iclamp_stim_4" delay="200ms" duration="500ms" amplitude="4pA"/>
<pulseGenerator id="iclamp_stim_8" delay="200ms" duration="500ms" amplitude="8pA"/>
<pulseGenerator id="iclamp_stim_12" delay="200ms" duration="500ms" amplitude="12pA"/>
<pulseGenerator id="iclamp_stim_16" delay="200ms" duration="500ms" amplitude="16pA"/>
<pulseGenerator id="iclamp_stim_20" delay="200ms" duration="500ms" amplitude="20pA"/>
<pulseGenerator id="iclamp_stim_min4" delay="100ms" duration="500ms" amplitude="-4pA"/>
<pulseGenerator id="iclamp_stim_0" delay="100ms" duration="500ms" amplitude="0pA"/>
<pulseGenerator id="iclamp_stim_4" delay="100ms" duration="500ms" amplitude="4pA"/>
<pulseGenerator id="iclamp_stim_8" delay="100ms" duration="500ms" amplitude="8pA"/>
<pulseGenerator id="iclamp_stim_12" delay="100ms" duration="500ms" amplitude="12pA"/>
<pulseGenerator id="iclamp_stim_16" delay="100ms" duration="500ms" amplitude="16pA"/>
<pulseGenerator id="iclamp_stim_20" delay="100ms" duration="500ms" amplitude="20pA"/>
<network id="Fig4C_AWCon" type="networkWithTemperature" temperature="34.0degC">
<notes>A network model: Fig4C_AWCon</notes>
<property tag="recommended_dt_ms" value="0.025"/>
<property tag="recommended_duration_ms" value="800.0"/>
<property tag="recommended_duration_ms" value="700.0"/>
<population id="pop_AWCon" component="AWCon" size="7" type="populationList">
<property tag="color" value="0.8 0 0"/>
<property tag="region" value="Worm"/>
Expand Down
12 changes: 6 additions & 6 deletions NeuroML2/Fig7B_RMD.net.nml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
Generated network: Fig7B_RMD
Generation seed: 1234</notes>
<include href="RMD.cell.nml"/>
<pulseGenerator id="iclamp_stim_min2" delay="110ms" duration="50ms" amplitude="-2pA"/>
<pulseGenerator id="iclamp_stim_2" delay="110ms" duration="50ms" amplitude="2pA"/>
<pulseGenerator id="iclamp_stim_6" delay="110ms" duration="50ms" amplitude="6pA"/>
<pulseGenerator id="iclamp_stim_10" delay="110ms" duration="50ms" amplitude="10pA"/>
<pulseGenerator id="iclamp_hyp" delay="210ms" duration="20ms" amplitude="-15pA"/>
<pulseGenerator id="iclamp_stim_min2" delay="10ms" duration="50ms" amplitude="-2pA"/>
<pulseGenerator id="iclamp_stim_2" delay="10ms" duration="50ms" amplitude="2pA"/>
<pulseGenerator id="iclamp_stim_6" delay="10ms" duration="50ms" amplitude="6pA"/>
<pulseGenerator id="iclamp_stim_10" delay="10ms" duration="50ms" amplitude="10pA"/>
<pulseGenerator id="iclamp_hyp" delay="110ms" duration="20ms" amplitude="-15pA"/>
<network id="Fig7B_RMD" type="networkWithTemperature" temperature="34.0degC">
<notes>A network model: Fig7B_RMD</notes>
<property tag="recommended_dt_ms" value="0.025"/>
<property tag="recommended_duration_ms" value="250.0"/>
<property tag="recommended_duration_ms" value="150.0"/>
<population id="pop_RMD" component="RMD" size="4" type="populationList">
<property tag="color" value="0.8 0 0"/>
<property tag="region" value="Worm"/>
Expand Down
4 changes: 2 additions & 2 deletions NeuroML2/GenerateExamples.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ def generate(cell, config, parameters=None):
stim_delay = 100
stim_dur = 500
post_stim = 100
extra_init = 100
extra_init = 0

if cell == "RMD":
amps = [-2, 2, 6, 10]
stim_delay = 10
stim_dur = 50
post_stim = 90
extra_init = 100
extra_init = 0

sim, net = create_new_model(
reference,
Expand Down
4 changes: 2 additions & 2 deletions NeuroML2/LEMS_Sim_Fig4C_AWCon.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<Include file="Fig4C_AWCon.net.nml"/>
<Include file="AWCon.cell.nml"/>

<Simulation id="Sim_Fig4C_AWCon" length="800.0ms" step="0.025ms" target="Fig4C_AWCon" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="pop_AWCon_v" title="Plots of pop_AWCon_v" timeScale="1ms" xmin="-80.0" xmax="880.0000000000001" ymin="-80" ymax="40">
<Simulation id="Sim_Fig4C_AWCon" length="700.0ms" step="0.025ms" target="Fig4C_AWCon" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="pop_AWCon_v" title="Plots of pop_AWCon_v" timeScale="1ms" xmin="-70.0" xmax="770.0000000000001" ymin="-80" ymax="40">
<Line id="pop_AWCon_0_AWCon_v" quantity="pop_AWCon/0/AWCon/v" scale="1mV" color="#d54f33" timeScale="1ms"/>
<Line id="pop_AWCon_1_AWCon_v" quantity="pop_AWCon/1/AWCon/v" scale="1mV" color="#0534e4" timeScale="1ms"/>
<Line id="pop_AWCon_2_AWCon_v" quantity="pop_AWCon/2/AWCon/v" scale="1mV" color="#98e752" timeScale="1ms"/>
Expand Down
4 changes: 2 additions & 2 deletions NeuroML2/LEMS_Sim_Fig7B_RMD.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
<Include file="Fig7B_RMD.net.nml"/>
<Include file="RMD.cell.nml"/>

<Simulation id="Sim_Fig7B_RMD" length="250.0ms" step="0.025ms" target="Fig7B_RMD" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="pop_RMD_v" title="Plots of pop_RMD_v" timeScale="1ms" xmin="-25.0" xmax="275.0" ymin="-80" ymax="40">
<Simulation id="Sim_Fig7B_RMD" length="150.0ms" step="0.025ms" target="Fig7B_RMD" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="pop_RMD_v" title="Plots of pop_RMD_v" timeScale="1ms" xmin="-15.0" xmax="165.0" ymin="-80" ymax="40">
<Line id="pop_RMD_0_RMD_v" quantity="pop_RMD/0/RMD/v" scale="1mV" color="#d54f33" timeScale="1ms"/>
<Line id="pop_RMD_1_RMD_v" quantity="pop_RMD/1/RMD/v" scale="1mV" color="#0534e4" timeScale="1ms"/>
<Line id="pop_RMD_2_RMD_v" quantity="pop_RMD/2/RMD/v" scale="1mV" color="#98e752" timeScale="1ms"/>
Expand Down
12 changes: 10 additions & 2 deletions NeuroML2/regenerateAndTest.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
#!/bin/bash
set -ex

# Format the code
black *.py

# This script loads in the XPP using the parser in pyNeuroML, and converts the channels to NeuroML
# It will also run a test simulation of the cells and save the results
# NOTE: make sure to update to a recent version of pyNeuroML!
python GenerateNeuroML.py -jnml

python TestXPP.py

# This will use the generated NeuroML cells and create networks with a number of (unconnected cells) and
# inject current steps into them to replicate the currnt clamp protocols in Figs 4C and 7B in the paper
python GenerateExamples.py -jnml

# This will load the original XPP using pyNeuroML, run it, save the results and plot them against the
# results generated by the NeuroML in GenerateNeuroML.py
python TestXPP.py

omv all -V

16 changes: 14 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,17 @@ The XPP files for the 2 cells are:

[NeuroML](http://www.neuroml.org) compliant versions of the cells and all the ion channels can be found in [this folder](NeuroML2):

- [RMD.cell.nml](RMD.cell.nml)
- [AWCon.cell.nml](AWC.cell.nml)
- [RMD.cell.nml](NeuroML2/RMD.cell.nml)
- [AWCon.cell.nml](NeuroML2/AWC.cell.nml)

These cell models can be run with [pyNeuroML](https://docs.neuroml.org/Userdocs/Software/pyNeuroML.html):
```
pynml LEMS_Sim_Fig4C_AWCon.xml
pynml Fig7B_RMD.net.nml
```
and will produce the following:

![](NeuroML2/AWC_RMD_NeuroML.png)

These cells have been tested against the original XPP versions, see [regenerateAndTest.sh](NeuroML2/regenerateAndTest.sh).

0 comments on commit cf47415

Please sign in to comment.