Skip to content

Commit

Permalink
Better way to handle soma
Browse files Browse the repository at this point in the history
  • Loading branch information
pgleeson committed Jul 21, 2022
1 parent ef0c097 commit af1a0ba
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CellTypesDatabase/models/NeuroML2/Cell_472450023.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -6834,7 +6834,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="dend_11"/>
<include segmentGroup="dend_10"/>
</segmentGroup>
<segmentGroup id="soma">
<segmentGroup id="ModelViewParmSubset_1">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="dend">
Expand Down Expand Up @@ -6876,7 +6876,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="axon_0"/>
<include segmentGroup="axon_1"/>
</segmentGroup>
<segmentGroup id="OneSecGrp_SectionRef_1">
<segmentGroup id="soma">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="soma_group">
Expand Down
4 changes: 2 additions & 2 deletions CellTypesDatabase/models/NeuroML2/Cell_483108201.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -24388,7 +24388,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="apic_11"/>
<include segmentGroup="apic_10"/>
</segmentGroup>
<segmentGroup id="soma">
<segmentGroup id="ModelViewParmSubset_9">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="ModelViewParmSubset_10">
Expand Down Expand Up @@ -24626,7 +24626,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="apic_11"/>
<include segmentGroup="apic_10"/>
</segmentGroup>
<segmentGroup id="OneSecGrp_SectionRef_289">
<segmentGroup id="soma">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="soma_group">
Expand Down
4 changes: 2 additions & 2 deletions CellTypesDatabase/models/NeuroML2/Cell_486556811.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -21025,7 +21025,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="apic_38"/>
<include segmentGroup="apic_37"/>
</segmentGroup>
<segmentGroup id="soma">
<segmentGroup id="ModelViewParmSubset_23">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="ModelViewParmSubset_24">
Expand Down Expand Up @@ -21265,7 +21265,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="axon_0"/>
<include segmentGroup="axon_1"/>
</segmentGroup>
<segmentGroup id="OneSecGrp_SectionRef_1193">
<segmentGroup id="soma">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="soma_group">
Expand Down
2 changes: 1 addition & 1 deletion CellTypesDatabase/models/NeuroML2/Cell_497233223.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -6914,7 +6914,7 @@ Electrophysiology on which this model is based: http://celltypes.brain-map.org/m
<include segmentGroup="axon_0"/>
<include segmentGroup="axon_1"/>
</segmentGroup>
<segmentGroup id="OneSecGrp_SectionRef_1">
<segmentGroup id="soma">
<include segmentGroup="soma_0"/>
</segmentGroup>
<segmentGroup id="soma_group">
Expand Down
11 changes: 9 additions & 2 deletions CellTypesDatabase/models/ParseAll.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
print("PA >> Found group: %s"%sg.id)
if (sg.id.startswith('ModelViewParm')) and len(sg.members)==0:
replace = {}
replace['soma_'] = 'soma'
#replace['soma_'] = 'soma'
replace['axon_'] = 'axon'
replace['apic_'] = 'apic'
replace['dend_'] = 'dend'
Expand All @@ -157,9 +157,16 @@
#print inc
all_match = all_match and inc.segment_groups.startswith(prefix)
if all_match:
print("Replacing group named %s with %s"%(sg.id,replace[prefix]))
print("PA >> 1) Replacing group named %s with %s"%(sg.id,replace[prefix]))
sg.id = replace[prefix]

if (sg.id.startswith('OneSecGrp')) and len(sg.includes)==1:
if sg.includes[0].segment_groups == "soma_0":
rep = 'soma'
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")]))
Expand Down

0 comments on commit af1a0ba

Please sign in to comment.