Problems recording injected current

2 views
Skip to first unread message

Cristian Guerrero

unread,
Nov 4, 2025, 1:48:30 PMNov 4
to NetPyNE Q&A forum

Hello,

I'm implementing a motoneuron model using NetPyne, and I need to apply a current profile to characterize the motor pool. However, I'm having trouble recording the traces—specifically, the current injected into the model from NetPyne.

Could someone please give me a hand? I’m not sure if I’m doing something wrong.
Below, I’m including part of my code showing how I apply the current and how I try to record the profile.

Thanks in advance!

Code to apply current

for cell in range(numCells):
        stimLabel = 'Inoise'+str(cell)
        netParams.stimSourceParams[stimLabel] = {
                                                'type': 'IClamp',
                                                'dur': sim_duration,
                                                'del': 0,
                                                'amp': f'abs(normal(0,{stdDevNoise}))'
                                                }
        netParams.stimTargetParams[stimLabel+'->MotorNucleus'] = {
                                                'source': stimLabel,
                                                'sec': 'dend',
                                                'loc': 0.5,
                                                'conds': {'pop': 'MotorNucleus',
                                                          'cellList': [cell]}}

Code to record the current
simConfig.recordTraces = {
           'v_soma': {'sec': 'soma', 'loc': 0.5, 'var': 'v'},
           'i_syn': {'sec': 'dend', 'loc': 0.5, 'var': 'i', 'synMech': 'exc'},
           'I_inj': {'sec': 'dend', 'loc': 0.5, 'var': 'i_save', 'stim': 'Inoise0'}
       }

Valery Bragin

unread,
Nov 14, 2025, 3:04:18 PM (11 days ago) Nov 14
to NetPyNE Q&A forum
Hello,

The issue is that you need to specify the label of stimTarget, not stimSource as `stim` in `recordTraces` . This is because each stimulus is ultimately identified by its target params. 
Also, make sure that i_save is a valid variable name in your IClamp model. 
Hope that helps!

Best regards,
Valery
Reply all
Reply to author
Forward
0 new messages