Open salvadord opened 5 years ago
Would you mind showing the 'expected' bmtk traces in the same plots ?
trying to find where differences coming from
I did fix an issue that was preventing v_init from being set, but the results were similar as above.
9_cell network just with IClamps -- seems like issue must be in reading cell params
Checked:
Would be good to have a SONATA example with simpler cells (eg. just soma or soma+dend) to check the morphology+biophysics more in detail.
Could you change the y-scale of the plots a bit, so that we can see the voltage before the stimulus ?
There is already a soma-only cell in here: https://github.com/AllenInstitute/sonata/pull/64 (the run bmtk with this example, this first has to be solved https://github.com/AllenInstitute/bmtk/issues/50)
Updated y-scale:
Did you check the temperature of the simulation ?
Yes: In [6]: h.celsius Out[6]: 34.0
Maybe reversal of sodium / potassium ?
The last thing I can think of atm are the calcium dynamics. (e.g. the calcium concentration at the beginning of the simulation)
@kaeldai - any update converting the cell biophys params from json to neuroml?
Also in bmtk how would I access the h.Section() objects? I wanna try to inspect them manually (from python terminal) using the new sec.psection() command which gives you detailed info, and compare to the sections in netpyne.
thanks
@salvadord - I just did a merge so that the 5_cell_iclamp example uses NeuroML files instead of json. Now every example should use NeuroML.
By default the bmtk (calls the function NMLLoad)[https://github.com/AllenInstitute/bmtk/blob/develop/bmtk/simulator/bionet/default_setters/cell_models.py#L401)] for every cell. Probably the best way to inspect it is to iterate through all the hobj sections before the function returns
for sec in hobj.all:
# check sec properties here
One thing I noticed is that if I don't cut the axon, ie call aibs_periosomatic, it looks like the bmtk traces match closer to your results (at least gid 6 now has 2 spikes at the end). I want to investigate this further, could you attach (or email me) your voltage traces? If we can get them to line up I think it should be fine to ignore axon-cutting in this example.
@kaeldai just sent you the netpyne traces by email.
Is there any way in bmtk to access the NEURON Section() of a particular cell instead of iterating over all? Or some way to related the hobj to the cell's gid and connections? eg. similar to netpyne's sim.net.cells[0].secs['soma_0']['hObj']
and sim.net.cells[0].conns
thanks
@kaeldai can you also post here or upload the bmtk traces without cutting the axon? In theory I'm also cutting the axon in my netpyne code, but I will compare with your results too. thx
@kaeldai - ok nevermind, just figured out that hobj
is inside each cell: e.g. net._rank_node_gids[0]._hobj.all
@pgleeson - I identified at least one of the issues. The following nml line is not being read by the neuroml.loaders.read_neuroml2_file
function: https://github.com/AllenInstitute/sonata/blob/master/examples/shared_components/biophysical_neuron_templates/nml/Cell_472363762.cell.nml#L2
Or at least I cannot find them inside the structure returned (nml_doc.cells[0]
).
This results in several of the CaDynamics
mech params not being set, eg. decay
, gamma
, etc.
Any suggestions? Otherwise I'll try to use the same code that BMTK uses to read nml files. thx
@salvadord The root cause of this is that the concentrationModel with attributes gamma and depth is not valid NeuroML2. It's a custom ComponentType (see type="CaDynamics") that's defined in a new ComponentType in LEMS for use in the NeuroML file. See here for the definition of the type and examples of Components using it: https://github.com/OpenSourceBrain/BlueBrainProjectShowcase/blob/master/NMC/NeuroML2/CaDynamics_E2_NML2.nml
That file (CaDynamics_E2_NML2.nml) is not technically valid NeuroML, but can of course be included in other NeuroML files, meaning the cell files which use this are valid (the <species concentrationModel="CaDynamics"
in the NML chunk used by Sonata is also valid). jNeuroML can load in such valid cell files (e.g. this), interpreting them as LEMS and translate them to Neuron mod & hoc files.
One option might be to try to load the file with PyLEMS (examples: https://github.com/LEMS/pylems/tree/master/examples; though you might have some issue if the root element is <neuroml>
not <Lems>
) and then you can get the Component CaDynamics and ask what it's Parameters are...
Adapted the bmtk code to read NeuroML and got a closer match!
Will keep checking to see what's missing now.
I see there is a difference at t=0. Could it be that the value of v_init (initial voltage) is set differently ?
Got perfect match for the 9_cells_iclamp and 9_cells example.
The last issue fixed was in the v_init, which was being set correctly globally, but netpyne was incorrectly importing v_init=-65 for each section. I also fixed some discrepancies in the morphologies, although still some differences. They actually didn't affect these sim results, but could be causing the differences in the 300 example.
9_cells_iclamp:
9_cells:
Great !
Raster plot generated by netpyne for the 9_cells SONATA example
Soma voltage traces generated by netpyne for the 9_cells SONATA example
Simulation run output log: Running simulation for 3000.0 ms... Done; run time = 3.03 s; real-time ratio: 0.99.
Gathering data... Done; gather time = 0.17 s.
Analyzing... Cells: 29 Connections: 180 (6.21 per cell) Synaptic contacts: 755 (26.03 per cell) Spikes: 735 (8.45 Hz) Simulated time: 3.0 s; 1 workers Run time: 3.03 s