@@ -165,7 +165,10 @@ def __init__(self, verbose=False):
165
165
self .verbose = verbose
166
166
self .doc = None
167
167
self .filename = None
168
- self .nml_to_moose = {} # NeuroML object to MOOSE object
168
+ self .nml_cells_to_moose = {} # NeuroML object to MOOSE object
169
+ self .nml_segs_to_moose = {} # NeuroML object to MOOSE object
170
+ self .nml_chans_to_moose = {} # NeuroML object to MOOSE object
171
+ self .nml_conc_to_moose = {} # NeuroML object to MOOSE object
169
172
self .moose_to_nml = {} # Moose object to NeuroML object
170
173
self .proto_cells = {} # map id to prototype cell in moose
171
174
self .proto_chans = {} # map id to prototype channels in moose
@@ -252,7 +255,7 @@ def createCellPrototype(self, cell, symmetric=True):
252
255
"""To be completed - create the morphology, channels in prototype"""
253
256
nrn = moose .Neuron ('%s/%s' % (self .lib .path , cell .id ))
254
257
self .proto_cells [cell .id ] = nrn
255
- self .nml_to_moose [cell ] = nrn
258
+ self .nml_cells_to_moose [cell . id ] = nrn
256
259
self .moose_to_nml [nrn ] = cell
257
260
self .createMorphology (cell , nrn , symmetric = symmetric )
258
261
self .importBiophysics (cell , nrn )
@@ -297,7 +300,7 @@ def createMorphology(self, nmlcell, moosecell, symmetric=True):
297
300
except AttributeError :
298
301
parent = None
299
302
self .moose_to_nml [comp ] = segment
300
- self .nml_to_moose [segment ] = comp
303
+ self .nml_segs_to_moose [segment . id ] = comp
301
304
p0 = segment .proximal
302
305
if p0 is None :
303
306
if parent :
@@ -356,15 +359,15 @@ def importCapacitances(self, nmlcell, moosecell, specificCapacitances):
356
359
for specific_cm in specificCapacitances :
357
360
cm = SI (specific_cm .value )
358
361
for seg in sg_to_segments [specific_cm .segment_groups ]:
359
- comp = self .nml_to_moose [seg ]
362
+ comp = self .nml_segs_to_moose [seg . id ]
360
363
comp .Cm = sarea (comp ) * cm
361
364
362
365
def importInitMembPotential (self , nmlcell , moosecell , membraneProperties ):
363
366
sg_to_segments = self ._cell_to_sg [nmlcell ]
364
367
for imp in membraneProperties .init_memb_potentials :
365
368
initv = SI (imp .value )
366
369
for seg in sg_to_segments [imp .segment_groups ]:
367
- comp = self .nml_to_moose [seg ]
370
+ comp = self .nml_segs_to_moose [seg . id ]
368
371
comp .initVm = initv
369
372
370
373
def importIntracellularProperties (self , nmlcell , moosecell , properties ):
@@ -379,7 +382,7 @@ def importSpecies(self, nmlcell, properties):
379
382
continue
380
383
segments = getSegments (nmlcell , species , sg_to_segments )
381
384
for seg in segments :
382
- comp = self .nml_to_moose [seg ]
385
+ comp = self .nml_segs_to_moose [seg . id ]
383
386
self .copySpecies (species , comp )
384
387
385
388
def copySpecies (self , species , compartment ):
@@ -405,7 +408,7 @@ def importAxialResistance(self, nmlcell, intracellularProperties):
405
408
for r in intracellularProperties .resistivities :
406
409
segments = getSegments (nmlcell , r , sg_to_segments )
407
410
for seg in segments :
408
- comp = self .nml_to_moose [seg ]
411
+ comp = self .nml_segs_to_moose [seg . id ]
409
412
setRa (comp , SI (r .value ))
410
413
411
414
def isPassiveChan (self ,chan ):
@@ -461,14 +464,14 @@ def importChannelsToCell(self, nmlcell, moosecell, membrane_properties):
461
464
462
465
if self .isPassiveChan (ionChannel ):
463
466
for seg in segments :
464
- comp = self .nml_to_moose [seg ]
465
- setRm (self . nml_to_moose [ seg ] , condDensity )
466
- setEk (self . nml_to_moose [ seg ] , erev )
467
+ comp = self .nml_segs_to_moose [seg . id ]
468
+ setRm (comp , condDensity )
469
+ setEk (comp , erev )
467
470
else :
468
471
for seg in segments :
469
- self .copyChannel (chdens , self .nml_to_moose [seg ], condDensity , erev )
470
- '''moose.le(self.nml_to_moose [seg])
471
- moose.showfield(self.nml_to_moose [seg], field="*", showtype=True)'''
472
+ self .copyChannel (chdens , self .nml_segs_to_moose [seg . id ], condDensity , erev )
473
+ '''moose.le(self.nml_segs_to_moose [seg.id ])
474
+ moose.showfield(self.nml_segs_to_moose [seg.id ], field="*", showtype=True)'''
472
475
473
476
def copyChannel (self , chdens , comp , condDensity , erev ):
474
477
"""Copy moose prototype for `chdens` condutcance density to `comp`
@@ -633,7 +636,7 @@ def importIonChannels(self, doc, vmin=-150e-3, vmax=100e-3, vdivs=5000):
633
636
mchan = self .createHHChannel (chan )
634
637
635
638
self .id_to_ionChannel [chan .id ] = chan
636
- self .nml_to_moose [chan ] = mchan
639
+ self .nml_chans_to_moose [chan . id ] = mchan
637
640
self .proto_chans [chan .id ] = mchan
638
641
if self .verbose :
639
642
print (self .filename , 'Created ion channel' , mchan .path , 'for' , chan .type , chan .id )
@@ -658,7 +661,7 @@ def createDecayingPoolConcentrationModel(self, concModel):
658
661
ca .thick = SI (concModel .shellThickness )
659
662
ca .B = 5.2e-6 # B = 5.2e-6/(Ad) where A is the area of the shell and d is thickness - must divide by shell volume when copying
660
663
self .proto_pools [concModel .id ] = ca
661
- self .nml_to_moose [concModel .id ] = ca
664
+ self .nml_concs_to_moose [concModel .id ] = ca
662
665
self .moose_to_nml [ca ] = concModel
663
666
logger .debug ('Created moose element: %s for nml conc %s' % (ca .path , concModel .id ))
664
667
0 commit comments