diff --git a/.gitignore b/.gitignore index 4b9ffc3..f8c232d 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,15 @@ OpenWormMuscleModel.egg-info /NeuroML2/*_main.json arm64 /NeuroML2/LEMS_NeuronMuscle_eden.py +/NeuroML2/nmllite/CaPool.nml +/NeuroML2/nmllite/IClamp_SingleCompMuscle.gv.png +/NeuroML2/nmllite/IClamp_SingleCompMuscle.net.png +/NeuroML2/nmllite/LEMS_Sim_IClamp_SingleCompMuscle.png +/NeuroML2/nmllite/LEMS_Sim_IClamp_SingleCompMuscle.xml +/NeuroML2/nmllite/Leak.channel.nml +/NeuroML2/nmllite/*dat +/NeuroML2/nmllite/SingleCompMuscle.cell.nml +/NeuroML2/nmllite/ca_boyle.channel.nml +/NeuroML2/nmllite/k_fast.channel.nml +/NeuroML2/nmllite/k_slow.channel.nml +/NeuroML2/nmllite/report.Sim_IClamp_SingleCompMuscle.txt diff --git a/NeuroML2/nmllite/GenerateExamples.py b/NeuroML2/nmllite/GenerateExamples.py new file mode 100644 index 0000000..1c7f61b --- /dev/null +++ b/NeuroML2/nmllite/GenerateExamples.py @@ -0,0 +1,74 @@ +from neuromllite import * +from neuromllite.NetworkGenerator import * +from neuromllite.utils import create_new_model +import sys + +sys.path.append("..") + + +def generate(cell, duration=45, config='IClamp',parameters = None): + + reference = "%s_%s"%(config, cell) + + cell_id = '%sCell'%cell + cell_nmll = Cell(id=cell_id, neuroml2_source_file='../%s.cell.nml'%(cell)) + + ################################################################################ + ### Add some inputs + + if 'IClamp' in config: + + if not parameters: + parameters = {} + parameters['stim_amp'] = '700pA' + parameters['offset_stim_amp'] = '-120 pA' + + input_source0 = InputSource(id='iclamp_stim', + neuroml2_input='PulseGenerator', + parameters={'amplitude':'stim_amp', 'delay':'5ms', 'duration':'20ms'}) + + input_source1 = InputSource(id='iclamp_offset', + neuroml2_input='PulseGenerator', + parameters={'amplitude':'offset_stim_amp', 'delay':'0ms', 'duration':'10000ms'}) + + + else: + + if not parameters: + parameters = {} + parameters['average_rate'] = '100 Hz' + parameters['number_per_cell'] = '10' + + input_source0 = InputSource(id='pfs0', + neuroml2_input='PoissonFiringSynapse', + parameters={'average_rate':'average_rate', + 'synapse':syn_exc.id, + 'spike_target':"./%s"%syn_exc.id}) + + sim, net = create_new_model(reference, + duration, + dt=0.025, # ms + temperature=34, # degC + default_region='Worm', + parameters = parameters, + cell_for_default_population=cell_nmll, + input_for_default_population=input_source0) + + net.input_sources.append(input_source1) + net.inputs.append(Input(id='input_offset', + input_source=input_source1.id, + population=net.populations[0].id, + percentage=100)) + net.to_json_file() + + return sim, net + + + +if __name__ == "__main__": + + sim, net = generate('SingleCompMuscle', 45, config="IClamp") + + + check_to_generate_or_run(sys.argv, sim) + diff --git a/NeuroML2/nmllite/IClamp_SingleCompMuscle.json b/NeuroML2/nmllite/IClamp_SingleCompMuscle.json new file mode 100644 index 0000000..922a02d --- /dev/null +++ b/NeuroML2/nmllite/IClamp_SingleCompMuscle.json @@ -0,0 +1,68 @@ +{ + "IClamp_SingleCompMuscle": { + "version": "NeuroMLlite v0.5.9", + "notes": "A network model: IClamp_SingleCompMuscle", + "parameters": { + "stim_amp": "700pA", + "offset_stim_amp": "-120 pA" + }, + "cells": { + "SingleCompMuscleCell": { + "neuroml2_source_file": "../SingleCompMuscle.cell.nml" + } + }, + "input_sources": { + "iclamp_stim": { + "parameters": { + "amplitude": "stim_amp", + "delay": "5ms", + "duration": "20ms" + }, + "neuroml2_input": "PulseGenerator" + }, + "iclamp_offset": { + "parameters": { + "amplitude": "offset_stim_amp", + "delay": "0ms", + "duration": "10000ms" + }, + "neuroml2_input": "PulseGenerator" + } + }, + "regions": { + "Worm": { + "x": 0.0, + "y": 0.0, + "z": 0.0, + "width": 1000.0, + "height": 100.0, + "depth": 1000.0 + } + }, + "populations": { + "pop_SingleCompMuscleCell": { + "size": 1, + "component": "SingleCompMuscleCell", + "properties": { + "color": "0.8 0 0" + }, + "random_layout": { + "region": "Worm" + } + } + }, + "inputs": { + "Stim_iclamp_stim": { + "input_source": "iclamp_stim", + "population": "pop_SingleCompMuscleCell", + "percentage": 100 + }, + "input_offset": { + "input_source": "iclamp_offset", + "population": "pop_SingleCompMuscleCell", + "percentage": 100 + } + }, + "temperature": 34.0 + } +} \ No newline at end of file diff --git a/NeuroML2/nmllite/IClamp_SingleCompMuscle.net.nml b/NeuroML2/nmllite/IClamp_SingleCompMuscle.net.nml new file mode 100644 index 0000000..27b632a --- /dev/null +++ b/NeuroML2/nmllite/IClamp_SingleCompMuscle.net.nml @@ -0,0 +1,29 @@ + + Generated by NeuroMLlite v0.5.9 + Generated network: IClamp_SingleCompMuscle + Generation seed: 1234 + NeuroMLlite parameters: + offset_stim_amp = -120 pA + stim_amp = 700pA + + + + + A network model: IClamp_SingleCompMuscle + + + + + + + + + + + + + + + + + diff --git a/NeuroML2/nmllite/Sim_IClamp_SingleCompMuscle.json b/NeuroML2/nmllite/Sim_IClamp_SingleCompMuscle.json new file mode 100644 index 0000000..eb69405 --- /dev/null +++ b/NeuroML2/nmllite/Sim_IClamp_SingleCompMuscle.json @@ -0,0 +1,12 @@ +{ + "Sim_IClamp_SingleCompMuscle": { + "version": "NeuroMLlite v0.5.9", + "network": "IClamp_SingleCompMuscle.json", + "duration": 45.0, + "dt": 0.025, + "seed": 12345, + "record_traces": { + "all": "*" + } + } +} \ No newline at end of file