LFP plotting size error

46 views
Skip to first unread message

Tomás Baima

unread,
Jul 7, 2023, 12:10:13 PM7/7/23
to NetPyNE Q&A forum
Hello, 

I am importing a '.swc' shape for some tests. There is a problem where I try to record and plot the LFP, and then I get this error:

Plotting LFP time series...
  There was an exception in plotLFPTimeSeries():
    list index out of range
    (<class 'IndexError'>, IndexError('list index out of range'), <traceback object at 0x000002A5F6BFAAC0>)
Plotting LFP electrode locations...
Plotting 3D cell shape ...
  There was an exception in plotShape():
    'c' argument has 45 elements, which is inconsistent with 'x' and 'y' with size 667.
    (<class 'ValueError'>, ValueError("'c' argument has 45 elements, which is inconsistent with 'x' and 'y' with size 667."),
<traceback object at 0x000002A580206D40>)
  There was an exception in plotLFPLocations():
    cannot unpack non-iterable int object
    (<class 'TypeError'>, TypeError('cannot unpack non-iterable int object'), <traceback object at 0x000002A5F6BDE440>) 


I am usin this code:

cellRule = params.importCellParams(
        label='CA1_swc',
        conds={'cellType': 'PYR', 'cellModel': 'HH3D'},
        fileName='n127.swc',
        cellName='swc_cell')

params.renameCellParamsSec('CA1_swc', 'soma_0', 'soma')  # rename imported section 'soma_0' to 'soma'

for secName in cellRule['secs']:
        cellRule['secs'][secName]['mechs']['pas'] = {'g': 0.0000357, 'e': -70}
        cellRule['secs'][secName]['geom']['cm'] = 1
        if secName.startswith('soma'):
                cellRule['secs'][secName]['mechs']['hh'] = {'gnabar': 0.12, 'gkbar': 0.036, 'gl': 0.003, 'el': -70}

params.cellParams['CA1_swc']['conds'] = {'cellType': ['PYR']}

# Populations in the network
params.popParams['pop1'] = {
    'cellType': 'PYR',        #Before stablished
    'numCells': 1,                  #Number of total cells in this pop
    'xRange': [0, params.sizeX],              #Position of this pop in the size defined in params
    'yRange': [0, params.sizeY],
    'zRange': [0, params.sizeZ]
}
cfg.recordCells = ['all']
cfg.recordLFP = [[50, y, 50] for y in range(0, int(params.sizeY), 15)]
cfg.analysis['plotLFP'] = {
    'includeAxon': False,
    'figSize': (7.5,13.5),
    'timeRange': [0,cfg.duration],
    'plots': ['timeSeries', 'locations'],
    'saveFig': True
}

I leave the two files attached (.py & .swc).
Thank you for your attention.
n127.swc
init_ANO.py

Eugenio Urdapilleta

unread,
Jul 11, 2023, 8:24:01 PM7/11/23
to NetPyNE Q&A forum
Hi Tomás,
 you should decrease the number of recording sites in LFP. For example,

cfg.recordLFP = [[50, y, 50] for y in range(0, int(params.sizeY), 2500)]

and, of course, to tune your model to get realistic spiking (and make a network beyond one cell). Best,

Eugenio 

hassan gobara

unread,
Jul 13, 2023, 3:44:01 AM7/13/23
to Eugenio Urdapilleta, NetPyNE Q&A forum
Hi Tomàs , thanks for explanation  , 
 Could you just tell me how did you make the synaptic mechs ? . Also Please note since you are using 3D for the coordination of your depth which is y   I suggest you try to normalise the synaptic connectivity with the command   .y-norm()  . That means the deeper the synaptic the stronger the connections , so your LFPs will record signal with less attenuation. 

--
You received this message because you are subscribed to the Google Groups "NetPyNE Q&A forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netpyne-foru...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netpyne-forum/744faf52-bae9-493e-9c45-fb15b6c0b1ean%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages