Skip to content

Commit

Permalink
Merge pull request #65 from openworm/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
pgleeson authored Feb 15, 2024
2 parents f1bfd22 + cd80249 commit 5ee13fb
Show file tree
Hide file tree
Showing 28 changed files with 167 additions and 118 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/non_omv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,18 @@ jobs:
- name: Install c302
run: |
pip install .
pip install WormNeuroAtlas
pip list
- name: Test OpenWormReader with owmeta
run: |
owm bundle remote --user add ow 'https://raw.githubusercontent.com/openworm/owmeta-bundles/master/index.json'
python -m c302.OpenWormReader
- name: Test WormNeuroAtlasReader
run: |
python -m c302.WormNeuroAtlasReader
- name: Run some examples
run: |
cd c302
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,4 @@ arm64
/.ipynb_checkpoints
/c302/.ipynb_checkpoints
.ipynb_checkpoints
/c302/data/~$*.xlsx
8 changes: 5 additions & 3 deletions c302/SpreadsheetDataReader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# A simple script to read the values in CElegansNeuronTables.xls.

# This is on of a number of interchangeable "Readers" which can
# This is one of a number of interchangeable "Readers" which can
# be used to get connection data for c302

############################################################
Expand All @@ -20,11 +20,13 @@

from c302 import print_

READER_DESCRIPTION = """Data extracted from CElegansNeuronTables.xls for neuronal connectivity"""

def read_data(include_nonconnected_cells=False, neuron_connect=False):



# reading the NeuronConnect.xls file if neuron_connect = True
# reading the NeuronConnectFormatted.xls file if neuron_connect = True
if neuron_connect:
conns = []
cells = []
Expand Down Expand Up @@ -53,7 +55,7 @@ def read_data(include_nonconnected_cells=False, neuron_connect=False):
filename = "%sCElegansNeuronTables.xls"%spreadsheet_location
rb = open_workbook(filename)

print_("Opened Excel file..: " + filename)
print_("Opened Excel file: " + filename)

known_nonconnected_cells = ['CANL', 'CANR', 'VC6']

Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/Canonical_C.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Canonical_C": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"parameters": {
"stim_duration": "2000ms",
"stim_amp": "3.5pA",
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/Canonical_C.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Canonical_C">
<notes>Generated by NeuroMLlite v0.5.7
<notes>Generated by NeuroMLlite v0.5.9
Generated network: Canonical_C
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/Canonical_X.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Canonical_X": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"parameters": {
"stim_duration": "250ms",
"stim_amp": "1pA",
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/Canonical_X.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="Canonical_X">
<notes>Generated by NeuroMLlite v0.5.7
<notes>Generated by NeuroMLlite v0.5.9
Generated network: Canonical_X
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/IClamp_GenericMuscleCell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"IClamp_GenericMuscleCell": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"notes": "A network model: IClamp_GenericMuscleCell",
"parameters": {
"stim_amp": "4pA"
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/IClamp_GenericMuscleCell.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="IClamp_GenericMuscleCell">
<notes>Generated by NeuroMLlite v0.5.7
<notes>Generated by NeuroMLlite v0.5.9
Generated network: IClamp_GenericMuscleCell
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/IClamp_GenericNeuronCell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"IClamp_GenericNeuronCell": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"notes": "A network model: IClamp_GenericNeuronCell",
"parameters": {
"stim_amp": "4pA"
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/IClamp_GenericNeuronCell.net.nml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd" id="IClamp_GenericNeuronCell">
<notes>Generated by NeuroMLlite v0.5.7
<notes>Generated by NeuroMLlite v0.5.9
Generated network: IClamp_GenericNeuronCell
Generation seed: 1234
NeuroMLlite parameters:
Expand Down
21 changes: 21 additions & 0 deletions examples/parametersweep/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@
<img alt="?" src="mean_spike_frequency_dt_GenericNeuronCell.png" height="160"/></a>
</td>
<tr>
<tr>
<td width=30><b>GenericNeuronCellX</b></td>
<td><a href="mean_spike_frequency_GenericNeuronCellX.png">
<img alt="?" src="mean_spike_frequency_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="firing_rates_GenericNeuronCellX.png">
<img alt="?" src="firing_rates_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="heatmap_GenericNeuronCellX.png">
<img alt="?" src="heatmap_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="dt_traces_GenericNeuronCellX.png">
<img alt="?" src="dt_traces_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="heatmap_dt_GenericNeuronCellX.png">
<img alt="?" src="heatmap_dt_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="mean_spike_frequency_dt_GenericNeuronCellX.png">
<img alt="?" src="mean_spike_frequency_dt_GenericNeuronCellX.png" height="160"/></a>
</td>
<tr>
<tr>
<td width=30><b>GenericMuscleCell</b></td>
<td><a href="mean_spike_frequency_GenericMuscleCell.png">
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/SimCanonical_C.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimCanonical_C": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"network": "Canonical_C.json",
"duration": 3000.0,
"dt": 0.1,
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/SimCanonical_X.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"SimCanonical_X": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"network": "Canonical_X.json",
"duration": 3000.0,
"dt": 0.1,
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/Sim_IClamp_GenericMuscleCell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Sim_IClamp_GenericMuscleCell": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"network": "IClamp_GenericMuscleCell.json",
"duration": 3000.0,
"dt": 0.025,
Expand Down
2 changes: 1 addition & 1 deletion examples/parametersweep/Sim_IClamp_GenericNeuronCell.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Sim_IClamp_GenericNeuronCell": {
"version": "NeuroMLlite v0.5.7",
"version": "NeuroMLlite v0.5.9",
"network": "IClamp_GenericNeuronCell.json",
"duration": 3000.0,
"dt": 0.025,
Expand Down
12 changes: 6 additions & 6 deletions examples/parametersweep/Sweep.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

heatmap_lims=[-110,20]

standard_stim_amps = ['%spA'%(i/10.0) for i in xrange(-5,70,1)]
standard_stim_amps = ['%spA'%(i/10.0) for i in range(-5,70,1)]

if '-all' in sys.argv:

Expand All @@ -24,7 +24,7 @@


vary = {'stim_amp':standard_stim_amps}
#vary = {'stim_amp':['%spA'%(i/10.0) for i in xrange(-10,20,5)]}
#vary = {'stim_amp':['%spA'%(i/10.0) for i in range(-10,20,5)]}
#vary = {'stim_amp':['-100pA','0pA','100pA','200pA','300pA','400pA']}

cells = colors.keys()
Expand Down Expand Up @@ -146,9 +146,9 @@

vary = {'stim_amp':standard_stim_amps}

#vary = {'number_per_cell':[i for i in xrange(0,250,10)]}
#vary = {'number_per_cell':[i for i in range(0,250,10)]}
vary = {'stim_amp':['-1pA','0pA','1.5pA','2pA']}
vary = {'stim_amp':['%spA'%(i/10.0) for i in xrange(-20,60,5)]}
vary = {'stim_amp':['%spA'%(i/10.0) for i in range(-20,60,5)]}

type = 'GenericMuscleCell'
type = 'GenericNeuronCell'
Expand Down Expand Up @@ -197,9 +197,9 @@
vary = {'dt':[0.1,0.05,0.025,0.01,0.005,0.0025,0.001]}
vary = {'dt':[0.1,0.05,0.025,0.01,0.005]}

#vary = {'number_per_cell':[i for i in xrange(0,250,10)]}
#vary = {'number_per_cell':[i for i in range(0,250,10)]}
#vary = {'stim_amp':['1pA','1.5pA','2pA']}
vary = {'stim_amp':['%spA'%(i/10.0) for i in xrange(-3,60,1)]}
vary = {'stim_amp':['%spA'%(i/10.0) for i in range(-3,60,1)]}

type = 'GenericMuscleCell'
type = 'GenericNeuronCell'
Expand Down
Binary file modified examples/parametersweep/firing_rates_GenericMuscleCell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/parametersweep/firing_rates_GenericNeuronCell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/parametersweep/heatmap_GenericMuscleCell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified examples/parametersweep/heatmap_GenericNeuronCell.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions examples/parametersweep/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,27 @@
<img alt="?" src="mean_spike_frequency_dt_GenericNeuronCell.png" height="160"/></a>
</td>
<tr>
<tr>
<td width=30><b>GenericNeuronCellX</b></td>
<td><a href="mean_spike_frequency_GenericNeuronCellX.png">
<img alt="?" src="mean_spike_frequency_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="firing_rates_GenericNeuronCellX.png">
<img alt="?" src="firing_rates_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="heatmap_GenericNeuronCellX.png">
<img alt="?" src="heatmap_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="dt_traces_GenericNeuronCellX.png">
<img alt="?" src="dt_traces_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="heatmap_dt_GenericNeuronCellX.png">
<img alt="?" src="heatmap_dt_GenericNeuronCellX.png" height="160"/></a>
</td>
<td><a href="mean_spike_frequency_dt_GenericNeuronCellX.png">
<img alt="?" src="mean_spike_frequency_dt_GenericNeuronCellX.png" height="160"/></a>
</td>
<tr>
<tr>
<td width=30><b>GenericMuscleCell</b></td>
<td><a href="mean_spike_frequency_GenericMuscleCell.png">
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5ee13fb

Please sign in to comment.