OpenSourceBrain / MiglioreEtAl14_OlfactoryBulb3D

3D model of the olfactory bulb (Migliore et al. 2014)
http://www.opensourcebrain.org/projects/miglioreetal14_olfactorybulb3d
Other
2 stars 1 forks source link

Add test script for creating and running one Mitral cell in NEURON #4

Closed pgleeson closed 6 years ago

pgleeson commented 9 years ago

Reuse existing scripts to load & create a single mitral cell & test with current clamp stimulation.

JustasB commented 8 years ago

@pgleeson Any more details on what kind of current protocol you want? Ie. stim soma with some pA current after 50ms delay for 1000 ms? Any other stim locations? Do you want me to make up a range of current values that show subthresh and spiking behavior? Also, do you only want plots of soma voltage or axon as well?

JustasB commented 8 years ago

Let me know if this is what you're looking for

screen shot 2015-12-12 at 6 44 02 pm

JustasB commented 8 years ago

Code for above screenshot can be seen here: https://github.com/JustasB/MiglioreEtAl14_OlfactoryBulb3D/blob/singleMitralCellTest/NEURON/mitralTest.py

pgleeson commented 8 years ago

Yes, that's certainly what should be tested. Can you try making a LEMS file that uses the same cell in nml2 and applies similar currents and runs with 'jnml LEMS_TestMitral.xml -neuron'?

JustasB commented 8 years ago

@pgleeson I get the following error

No such children list for type: (property) in segmentGroup

When the following line(s) are included in the Mitral Cell .nml files that get generated by the python script:

<property tag="numberInternalDivisions" value="23"/>

The bigger tag looks like this:

          <segmentGroup neuroLexId="sao864921383" id="priden">
                <notes>This group contains an unbranched set of segments, and all of the segmentGroups marked with
             neuroLexId = sao864921383 form a non-overlapping set of all of the segments.
             These segmentGroups correspond to the 'cables' of NeuroML v1.8.1, and map to/from NEURON sections.</notes>
                <property tag="numberInternalDivisions" value="23"/>
                <annotation/>
                <member segment="21"/>
            </segmentGroup>

I'm removing them now to keep going, but what are these and what should be done with them?

JustasB commented 8 years ago

@pgleeson One more, when I include the mitral cell in the network, jnml gives me the following error:

Level of support for MULTICOMPARTMENTAL_CELL_MODEL in LEMS is insufficient: NONE

Any tips on what to do here? In the PinskyRinsel, I created a new component with the two compartments. What's your suggestion for this case?

pgleeson commented 8 years ago

Are you trying to run it in jnml or generate neuron code? The former won't work as it's a multicomp cell.

pgleeson commented 8 years ago

@JustasB see script at https://github.com/OpenSourceBrain/MiglioreEtAl14_OlfactoryBulb3D/blob/master/NeuroML2/TestStimCells.py for generating LEMS: https://github.com/OpenSourceBrain/MiglioreEtAl14_OlfactoryBulb3D/blob/master/NeuroML2/LEMS_TestStimCells.xml (update pyNeuroML...)

Looking pretty close: selection_014

There are still some issues plotting the segments, e.g. 682 which is supposed to be init seg...

JustasB commented 8 years ago

Great. I'll pull down the latest version

JustasB commented 8 years ago

@pgleeson I've updated to latest version of pyNeuroML and libNeuroML, but I get the following when I run the TestStimCells.py

MacBook-Air-4:NeuroML2 gazelle$ python TestStimCells.py 
{'Mitral_0_0': ['Pop_Mitral_0_0/0/Mitral_0_0/0/v', 'Pop_Mitral_0_0/0/Mitral_0_0/43/v']}
{}
Traceback (most recent call last):
  File "TestStimCells.py", line 66, in <module>
    copy_neuroml=False)
TypeError: generate_lems_file_for_neuroml() got an unexpected keyword argument 'gen_plots_for_quantities'

Tips?

JustasB commented 8 years ago

Ok, I saw you added a parameter to the function. Apparently the 'update' didn't really update the pyneuroml.lems library. I reinstalled it -- the script is working.

JustasB commented 8 years ago

@pgleeson There is something suspect with the way non-contiguous segment IDs are handled when jnml converts LEMS file to NEURON.

To make the initialseg work, I renamed it's id from 682 to 1. Here's why:

  1. If left at 682, jnml -neuron throws an out of range error saying that 682 is not part of the segment array
  2. Looking at all the IDs in the cell, there are in fact 682 ids.
  3. Index 681 correctly refers to segment with ID 681
  4. Segment ids are not contiguous, they go 0, 2, 3, 4... 682. I.E. seg 1 is not named.
  5. If I just change the LEMS file to look at v of seg 1, jnml complains that there is no segment with id 1
  6. If I change the initialseg id from 682 to 1 in the cell file, then jnml and neuron correctly show initialseg voltage.

Seems like jnml should handle non-contiguous segment ids. Bug in jnml?

Furthermore, do segment id's have to be integers? If they were allowed to be strings, the paths in LEMS files would become less confusing, as right now it's not clear that 682 refers to anything meaningful.

JustasB commented 8 years ago

LEMS based sim with the current injections here: https://github.com/OpenSourceBrain/MiglioreEtAl14_OlfactoryBulb3D/pull/10

pgleeson commented 8 years ago

Thanks for that. Have merged the PR & removed one extra file.

I need to look into this issue in the exporter, it may be related to a bigger issue re segment ids: for each subsequent cell exported after 0, the seg id value doesn't reset. Will investigate next week.

No reason in theory seg ids can't be non-contiguous, but they have to be integers.. name attributes can be used for human readable identifier.

JustasB commented 6 years ago

This has been implemented here: https://github.com/OpenSourceBrain/MiglioreEtAl14_OlfactoryBulb3D/pull/25