Skip to content

Commit

Permalink
Merge pull request #58 from OpenSourceBrain/feat/api-issue-57
Browse files Browse the repository at this point in the history
feat: ensure that apical segments are also included in the default de…
  • Loading branch information
sanjayankur31 authored Apr 23, 2024
2 parents 4cf57e7 + dadfad2 commit c82b79e
Show file tree
Hide file tree
Showing 16 changed files with 1,460 additions and 1,435 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/non-omv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
python-version: [ 3.8, 3.9, "3.10" ]

steps:
- uses: actions/checkout@v3
Expand Down
4 changes: 2 additions & 2 deletions CellTypesDatabase/models/NeuroML2/497232312.net.nml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<neuroml xmlns="http://www.neuroml.org/schema/neuroml2"
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_v2beta4.xsd"
xsi:schemaLocation="http://www.neuroml.org/schema/neuroml2 https://raw.github.com/NeuroML/NeuroML2/development/Schemas/NeuroML2/NeuroML_v2.3.xsd"
id = "NeuroML2_file_exported_from_NEURON">

<notes> NeuroML 2 file generated from ModelView by: NEURON -- VERSION 8.1.0 HEAD (047dd824) 2022-03-25
<notes> NeuroML 2 file generated from ModelView by: NEURON -- VERSION 8.2.4 HEAD (1d87d5d39) 2024-02-09
Authors: Michael Hines, Sushil Kambampati and Padraig Gleeson,
Yale University and UCL
</notes>
Expand Down
211 changes: 107 additions & 104 deletions CellTypesDatabase/models/NeuroML2/Cell_472450023.cell.nml

Large diffs are not rendered by default.

864 changes: 434 additions & 430 deletions CellTypesDatabase/models/NeuroML2/Cell_483108201.cell.nml

Large diffs are not rendered by default.

814 changes: 409 additions & 405 deletions CellTypesDatabase/models/NeuroML2/Cell_486556811.cell.nml

Large diffs are not rendered by default.

874 changes: 439 additions & 435 deletions CellTypesDatabase/models/NeuroML2/Cell_497232312.cell.nml

Large diffs are not rendered by default.

19 changes: 9 additions & 10 deletions CellTypesDatabase/models/NeuroML2/LEMS_472450023.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Lems>

<!--
This LEMS file has been automatically generated using PyNeuroML v0.7.1 (libNeuroML v0.4.0)
This LEMS file has been automatically generated using PyNeuroML v1.2.11 (libNeuroML v0.5.8)
-->

<!-- Specify which component to run -->
<Target component="472450023"/>

<!-- Include core NeuroML2 ComponentType definitions -->
<Include file="Cells.xml"/>
<Include file="Networks.xml"/>
<Include file="Simulation.xml"/>

<Include file="Network_472450023.net.nml"/>
<Include file="Cell_472450023.cell.nml"/>
<Include file="Im.channel.nml"/>
Expand All @@ -29,17 +29,16 @@
<Include file="Ca_LVA.channel.nml"/>
<Include file="CaDynamics_all.nml"/>
<Include file="CaDynamics.nml"/>

<Simulation id="472450023" length="2500ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->


<Simulation id="472450023" length="2500.0ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="DispPop__Pop_Cell_472450023" title="Membrane potentials of cells in Pop_Cell_472450023" timeScale="1ms" xmin="-250.0" xmax="2750.0" ymin="-90" ymax="50">
<Line id="Pop_Cell_472450023[0]: v" quantity="Pop_Cell_472450023/0/Cell_472450023/v" scale="1mV" color="#e1a7b4" timeScale="1ms"/>
</Display>

<OutputFile id="Volts_file__Pop_Cell_472450023" fileName="472450023.Pop_Cell_472450023.v.dat">
<OutputColumn id="v_Pop_Cell_472450023_0_Cell_472450023_v" quantity="Pop_Cell_472450023/0/Cell_472450023/v"/>
<OutputColumn id="v_Pop_Cell_472450023_0_Cell_472450023_v" quantity="Pop_Cell_472450023/0/Cell_472450023/v"/>
</OutputFile>

</Simulation>

</Lems>
19 changes: 9 additions & 10 deletions CellTypesDatabase/models/NeuroML2/LEMS_483108201.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Lems>

<!--
This LEMS file has been automatically generated using PyNeuroML v0.7.1 (libNeuroML v0.4.0)
This LEMS file has been automatically generated using PyNeuroML v1.2.11 (libNeuroML v0.5.8)
-->

<!-- Specify which component to run -->
<Target component="483108201"/>

<!-- Include core NeuroML2 ComponentType definitions -->
<Include file="Cells.xml"/>
<Include file="Networks.xml"/>
<Include file="Simulation.xml"/>

<Include file="Network_483108201.net.nml"/>
<Include file="Cell_483108201.cell.nml"/>
<Include file="Im.channel.nml"/>
Expand All @@ -29,17 +29,16 @@
<Include file="Ca_LVA.channel.nml"/>
<Include file="CaDynamics_all.nml"/>
<Include file="CaDynamics.nml"/>

<Simulation id="483108201" length="2500ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->


<Simulation id="483108201" length="2500.0ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="DispPop__Pop_Cell_483108201" title="Membrane potentials of cells in Pop_Cell_483108201" timeScale="1ms" xmin="-250.0" xmax="2750.0" ymin="-90" ymax="50">
<Line id="Pop_Cell_483108201[0]: v" quantity="Pop_Cell_483108201/0/Cell_483108201/v" scale="1mV" color="#e1a7b4" timeScale="1ms"/>
</Display>

<OutputFile id="Volts_file__Pop_Cell_483108201" fileName="483108201.Pop_Cell_483108201.v.dat">
<OutputColumn id="v_Pop_Cell_483108201_0_Cell_483108201_v" quantity="Pop_Cell_483108201/0/Cell_483108201/v"/>
<OutputColumn id="v_Pop_Cell_483108201_0_Cell_483108201_v" quantity="Pop_Cell_483108201/0/Cell_483108201/v"/>
</OutputFile>

</Simulation>

</Lems>
19 changes: 9 additions & 10 deletions CellTypesDatabase/models/NeuroML2/LEMS_486556811.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Lems>

<!--
This LEMS file has been automatically generated using PyNeuroML v0.7.1 (libNeuroML v0.4.0)
This LEMS file has been automatically generated using PyNeuroML v1.2.11 (libNeuroML v0.5.8)
-->

<!-- Specify which component to run -->
<Target component="486556811"/>

<!-- Include core NeuroML2 ComponentType definitions -->
<Include file="Cells.xml"/>
<Include file="Networks.xml"/>
<Include file="Simulation.xml"/>

<Include file="Network_486556811.net.nml"/>
<Include file="Cell_486556811.cell.nml"/>
<Include file="Im.channel.nml"/>
Expand All @@ -29,17 +29,16 @@
<Include file="Ca_LVA.channel.nml"/>
<Include file="CaDynamics_all.nml"/>
<Include file="CaDynamics.nml"/>

<Simulation id="486556811" length="2500ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->


<Simulation id="486556811" length="2500.0ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="DispPop__Pop_Cell_486556811" title="Membrane potentials of cells in Pop_Cell_486556811" timeScale="1ms" xmin="-250.0" xmax="2750.0" ymin="-90" ymax="50">
<Line id="Pop_Cell_486556811[0]: v" quantity="Pop_Cell_486556811/0/Cell_486556811/v" scale="1mV" color="#e1a7b4" timeScale="1ms"/>
</Display>

<OutputFile id="Volts_file__Pop_Cell_486556811" fileName="486556811.Pop_Cell_486556811.v.dat">
<OutputColumn id="v_Pop_Cell_486556811_0_Cell_486556811_v" quantity="Pop_Cell_486556811/0/Cell_486556811/v"/>
<OutputColumn id="v_Pop_Cell_486556811_0_Cell_486556811_v" quantity="Pop_Cell_486556811/0/Cell_486556811/v"/>
</OutputFile>

</Simulation>

</Lems>
19 changes: 9 additions & 10 deletions CellTypesDatabase/models/NeuroML2/LEMS_497232312.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Lems>

<!--
This LEMS file has been automatically generated using PyNeuroML v0.7.1 (libNeuroML v0.4.0)
This LEMS file has been automatically generated using PyNeuroML v1.2.11 (libNeuroML v0.5.8)
-->

<!-- Specify which component to run -->
<Target component="497232312"/>

<!-- Include core NeuroML2 ComponentType definitions -->
<Include file="Cells.xml"/>
<Include file="Networks.xml"/>
<Include file="Simulation.xml"/>

<Include file="Network_497232312.net.nml"/>
<Include file="Cell_497232312.cell.nml"/>
<Include file="pas.channel.nml"/>
Expand All @@ -29,17 +29,16 @@
<Include file="Ca_LVA.channel.nml"/>
<Include file="CaDynamics_all.nml"/>
<Include file="CaDynamics.nml"/>

<Simulation id="497232312" length="2500ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->


<Simulation id="497232312" length="2500.0ms" step="0.005ms" target="network" seed="12345"> <!-- Note seed: ensures same random numbers used every run -->
<Display id="DispPop__Pop_Cell_497232312" title="Membrane potentials of cells in Pop_Cell_497232312" timeScale="1ms" xmin="-250.0" xmax="2750.0" ymin="-90" ymax="50">
<Line id="Pop_Cell_497232312[0]: v" quantity="Pop_Cell_497232312/0/Cell_497232312/v" scale="1mV" color="#e1a7b4" timeScale="1ms"/>
</Display>

<OutputFile id="Volts_file__Pop_Cell_497232312" fileName="497232312.Pop_Cell_497232312.v.dat">
<OutputColumn id="v_Pop_Cell_497232312_0_Cell_497232312_v" quantity="Pop_Cell_497232312/0/Cell_497232312/v"/>
<OutputColumn id="v_Pop_Cell_497232312_0_Cell_497232312_v" quantity="Pop_Cell_497232312/0/Cell_497232312/v"/>
</OutputFile>

</Simulation>

</Lems>
8 changes: 4 additions & 4 deletions CellTypesDatabase/models/NeuroML2/ManyCells.net.nml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
<network id="ManyCells">
<population id="Pop_472450023" component="Cell_472450023" type="populationList">
<instance id="0">
<location x="0." y="0." z="0."/>
<location x="0.0" y="0.0" z="0.0"/>
</instance>
</population>
<population id="Pop_483108201" component="Cell_483108201" type="populationList">
<instance id="0">
<location x="300." y="0." z="0."/>
<location x="300.0" y="0.0" z="0.0"/>
</instance>
</population>
<population id="Pop_486556811" component="Cell_486556811" type="populationList">
<instance id="0">
<location x="600." y="0." z="0."/>
<location x="600.0" y="0.0" z="0.0"/>
</instance>
</population>
<population id="Pop_497232312" component="Cell_497232312" type="populationList">
<instance id="0">
<location x="900." y="0." z="0."/>
<location x="900.0" y="0.0" z="0.0"/>
</instance>
</population>
</network>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<property tag="recommended_dt_ms" value="0.005"/>
<population id="Pop_Cell_472450023" component="Cell_472450023" size="1" type="populationList">
<instance id="0">
<location x="0." y="0." z="0."/>
<location x="0.0" y="0.0" z="0.0"/>
</instance>
</population>
<inputList id="stim_input" population="Pop_Cell_472450023" component="stim">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<property tag="recommended_dt_ms" value="0.005"/>
<population id="Pop_Cell_483108201" component="Cell_483108201" size="1" type="populationList">
<instance id="0">
<location x="0." y="0." z="0."/>
<location x="0.0" y="0.0" z="0.0"/>
</instance>
</population>
<inputList id="stim_input" population="Pop_Cell_483108201" component="stim">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<property tag="recommended_dt_ms" value="0.005"/>
<population id="Pop_Cell_486556811" component="Cell_486556811" size="1" type="populationList">
<instance id="0">
<location x="0." y="0." z="0."/>
<location x="0.0" y="0.0" z="0.0"/>
</instance>
</population>
<inputList id="stim_input" population="Pop_Cell_486556811" component="stim">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<property tag="recommended_dt_ms" value="0.005"/>
<population id="Pop_Cell_497232312" component="Cell_497232312" size="1" type="populationList">
<instance id="0">
<location x="0." y="0." z="0."/>
<location x="0.0" y="0.0" z="0.0"/>
</instance>
</population>
<inputList id="stim_input" population="Pop_Cell_497232312" component="stim">
Expand Down
34 changes: 24 additions & 10 deletions CellTypesDatabase/models/ParseAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@

nml_doc = pynml.read_neuroml2_file(nml_cell_loc0)

cell = nml_doc.cells[0]
cell = nml_doc.cells[0] # type: neuroml.Cell

cell.id = "Cell_%s" % model_id

Expand Down Expand Up @@ -182,15 +182,29 @@
print("PA >> 2) Replacing group named %s with %s" % (sg.id, rep))
sg.id = rep

cell.morphology.segment_groups.append(
neuroml.SegmentGroup(id="soma_group", includes=[neuroml.Include("soma")])
)
cell.morphology.segment_groups.append(
neuroml.SegmentGroup(id="axon_group", includes=[neuroml.Include("axon")])
)
cell.morphology.segment_groups.append(
neuroml.SegmentGroup(id="dendrite_group", includes=[neuroml.Include("dend")])
)
cell.setup_nml_cell(use_convention=True, overwrite=False,
default_groups=["all", "soma_group", "dendrite_group", "axon_group"])
soma_group = cell.get_segment_group("soma_group")
soma_group.add(neuroml.Include, segment_groups="soma")

axon_group = cell.get_segment_group("axon_group")
axon_group.add(neuroml.Include, segment_groups="axon")

dendrite_group = cell.get_segment_group("dendrite_group")
dendrite_group.add(neuroml.Include, segment_groups="dend")

# If there are apical segments, add them to the default dendrite group also
# Note: apic unbranched segment groups are already being added to "all", so
# we don't need to add "apic" to it again
try:
apic_groups = cell.get_segment_groups_by_substring("apic")
if len(apic_groups.keys()) > 0:
print("PA >> 3) Apic groups found, adding to dendrite_group")
dendrite_group.add(neuroml.Include, segment_groups="apic")
except ValueError:
pass

cell.optimise_segment_groups()

with open(manifest_info["biophys"][0]["model_file"][1], "r") as json_file:
cell_info = json.load(json_file)
Expand Down

0 comments on commit c82b79e

Please sign in to comment.