Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetPyNE simulation results for 9 biophys cell network #63

Open
salvadord opened this issue Nov 19, 2018 · 23 comments
Open

NetPyNE simulation results for 9 biophys cell network #63

salvadord opened this issue Nov 19, 2018 · 23 comments
Assignees

Comments

@salvadord
Copy link

  • Raster plot generated by netpyne for the 9_cells SONATA example
    model_output_raster_axonv2_dl_9cells

  • Soma voltage traces generated by netpyne for the 9_cells SONATA example
    model_output_traces_axonv2_dl_9cells

  • 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

@wvangeit
Copy link
Collaborator

Would you mind showing the 'expected' bmtk traces in the same plots ?

@salvadord
Copy link
Author

salvadord commented Dec 1, 2018

comparison

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.

@salvadord
Copy link
Author

9_cell network just with IClamps -- seems like issue must be in reading cell params

comparison

@salvadord
Copy link
Author

Checked:

  • cell biophysics -- netpyne matches neuroml file description; need to compare directly with BioNet network params
  • num secs and nseg per sec -- matches BioNet
  • axon -- matches BioNet (biophys + geom; order of secs different but shouldn't affect ICLamp)
  • v_init -- matches BioNet
  • ICLamp params -- match BioNet

@salvadord
Copy link
Author

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.

@wvangeit
Copy link
Collaborator

wvangeit commented Dec 3, 2018

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:
#64
(the run bmtk with this example, this first has to be solved AllenInstitute/bmtk#50)

@salvadord
Copy link
Author

salvadord commented Dec 3, 2018

Updated y-scale:
comparison

@wvangeit
Copy link
Collaborator

wvangeit commented Dec 3, 2018

Did you check the temperature of the simulation ?

@salvadord
Copy link
Author

Yes:
In [6]: h.celsius
Out[6]: 34.0

@wvangeit
Copy link
Collaborator

wvangeit commented Dec 3, 2018

Maybe reversal of sodium / potassium ?

@salvadord
Copy link
Author

they match the .nml values:

In [12]: sim.net.cells[0].secs['soma_0']'hObj'.ena
Out[12]: 53.0

In [13]: sim.net.cells[0].secs['soma_0']'hObj'.ek
Out[13]: -107.0

@wvangeit
Copy link
Collaborator

wvangeit commented Dec 3, 2018

The last thing I can think of atm are the calcium dynamics. (e.g. the calcium concentration at the beginning of the simulation)

@salvadord
Copy link
Author

@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

@kaeldai
Copy link
Collaborator

kaeldai commented Jan 30, 2019

@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.

@salvadord
Copy link
Author

@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

@salvadord
Copy link
Author

@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

@salvadord
Copy link
Author

@kaeldai - ok nevermind, just figured out that hobj is inside each cell: e.g. net._rank_node_gids[0]._hobj.all

@salvadord
Copy link
Author

@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

@pgleeson
Copy link
Contributor

@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...

@salvadord
Copy link
Author

Adapted the bmtk code to read NeuroML and got a closer match!
comparison_v3

Will keep checking to see what's missing now.

@wvangeit
Copy link
Collaborator

I see there is a difference at t=0. Could it be that the value of v_init (initial voltage) is set differently ?

@salvadord
Copy link
Author

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:
comparison_v4

9_cells:
comparison_v4

@wvangeit
Copy link
Collaborator

Great !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants