Search found 37 matches

by vogdb
Sat Sep 21, 2019 10:02 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Filter Mechanism params by NMODL PARAMETER
Replies: 8
Views: 3724

Re: Filter Mechanism params by NMODL PARAMETER

Here is the today's solution. Thank you again! ms = h.MechanismStandard(mech_name, 1) param_name = h.ref('') param_names = [] for i in range(ms.count()): ms.name(param_name, i) param_names.append(param_name[0]) param_names = [name.split('_' + mech_name)[0] for name in param_names]
by vogdb
Fri Sep 20, 2019 3:22 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Filter Mechanism params by NMODL PARAMETER
Replies: 8
Views: 3724

Re: Filter Mechanism params by NMODL PARAMETER

Thank you so much for so many options. I will try the old way tomorrow as it looks very neat. Today I've ended up with this solution: from neuron import h from nmodl import dsl mech_type = h.MechanismType(0) mech_type.select('hh') code = mech_type.code() driver = dsl.NmodlDriver() modast = driver.pa...
by vogdb
Thu Sep 19, 2019 12:27 pm
Forum: Adding new mechanisms and functions to NEURON
Topic: Filter Mechanism params by NMODL PARAMETER
Replies: 8
Views: 3724

Re: Filter Mechanism params by NMODL PARAMETER

If to be that precise, lets take this example: soma = h.Section(name='soma') soma.insert('hh') for seg in soma: for mech in seg: if mech.name() == 'hh': filtered = [] for n in dir(mech): v = getattr(mech, n) if n.startswith('__') or n in ('next', 'name', 'is_ion', 'segment',): continue filtered.appe...
by vogdb
Thu Sep 19, 2019 7:25 am
Forum: Adding new mechanisms and functions to NEURON
Topic: Filter Mechanism params by NMODL PARAMETER
Replies: 8
Views: 3724

Filter Mechanism params by NMODL PARAMETER

Hello! I'm collecting all cell's mechanisms in Python like this: soma = h.Section(name='soma') // soma.insert( lots of mechanisms ) for seg in soma: for mech in seg: print(mech) mech contains parameters like 'gbar', 'g', 'ica' and so on. How can I filter them to get only those that are in 'PARAMETER...
by vogdb
Wed Sep 11, 2019 12:07 pm
Forum: Anatomically detailed models
Topic: Export to .hoc with CellBuilder from Python
Replies: 2
Views: 7708

Re: Export to .hoc with CellBuilder from Python

Thank you for the response.
by vogdb
Tue Sep 10, 2019 12:32 pm
Forum: Anatomically detailed models
Topic: Export to .hoc with CellBuilder from Python
Replies: 2
Views: 7708

Export to .hoc with CellBuilder from Python

Hi! I'm trying now for a week to properly export the currently loaded neuron model. There is only one loaded model in my namespace that I loaded like this. h.load_file('Cell_Scnn1a.hoc') cell_hoc = h.Cell_Scnn1a('/morphologies', 'Scnn1a_473845048_m.swc') It is absolutely properly exported to nml by ...
by vogdb
Wed Sep 04, 2019 6:42 am
Forum: Anatomically detailed models
Topic: Save model's biophysics and morphology programmatically to .hoc
Replies: 3
Views: 7507

Re: Save model's biophysics and morphology programmatically to .hoc

I've managed to export it into a single nml file. h.load_file('Cell_Scnn1a.hoc') cell_hoc = h.Cell_Scnn1a('/morphologies', 'Scnn1a_473845048_m.swc') h.load_file("mview.hoc") mv = h.ModelView(0) mv_xml = h.ModelViewXML(mv) export_filepath = os.path.join('.', 'test.nml') mv_xml.exportNeuroML...
by vogdb
Tue Sep 03, 2019 11:25 am
Forum: Anatomically detailed models
Topic: Save model's biophysics and morphology programmatically to .hoc
Replies: 3
Views: 7507

Save model's biophysics and morphology programmatically to .hoc

Hi! I couldn't find the answer in similar topics: https://www.neuron.yale.edu/phpBB/viewtopic.php?t=1855 , https://www.neuron.yale.edu/phpBB/viewtopic.php?t=364 . I have a model loaded from this kind of template: {load_file("stdrun.hoc")} {load_file("import3d.hoc")} begintemplate...
by vogdb
Thu Aug 22, 2019 3:34 am
Forum: NEURON + Python
Topic: Does Section have something like `id` attribute?
Replies: 2
Views: 4388

Re: Does Section have something like `id` attribute?

Thank you for such a thorough answer! By any chance, do you have an example of identifying sections in parallel environment?
by vogdb
Wed Aug 21, 2019 12:16 pm
Forum: NEURON + Python
Topic: Does Section have something like `id` attribute?
Replies: 2
Views: 4388

Does Section have something like `id` attribute?

Hello everyone! I'm trying to launch a Sonata network in NEURON. According to their documentation they store synapses locations as some section id. I suspect that it is a Section's index in h.allsec() collection. I've looked over Section's documentation and have some questions. 1. Am I correct that ...
by vogdb
Thu Aug 15, 2019 1:43 pm
Forum: NEURON + Python
Topic: Convert Python to Hoc
Replies: 4
Views: 2450

Re: Convert Python to Hoc

For now I couldn't do it. Currently jNeuroML does not support json files. I have to make it by hands unfortunately, can't waste time on this anymore.
by vogdb
Thu Aug 15, 2019 6:45 am
Forum: NEURON + Python
Topic: Convert Python to Hoc
Replies: 4
Views: 2450

Re: Convert Python to Hoc

Seems that https://github.com/NeuroML/jNeuroML is a way to go.
by vogdb
Wed Aug 14, 2019 2:24 pm
Forum: NEURON + Python
Topic: Convert Python to Hoc
Replies: 4
Views: 2450

Convert Python to Hoc

Hello! There is a model https://senselab.med.yale.edu/ModelDB/showmodel.cshtml?model=184187 . It exists in NeuroML2 and standalone Python versions. Is it possible to convert any of these into Hoc? What would you suggest? Would it be simpler just to recreate Hoc file from scratch? My circumstances ar...