Skip to content

Commit

Permalink
added additional analysis plots to cfg.py
Browse files Browse the repository at this point in the history
  • Loading branch information
salvadord committed Jan 20, 2020
1 parent a845266 commit 3c278a2
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
24 changes: 19 additions & 5 deletions cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,12 @@
cfg.printRunTime = 1

### Options to save memory in large-scale ismulations
cfg.gatherOnlySimData = False #Original
cfg.saveCellSecs=False
cfg.saveCellConns=False
cfg.createPyStruct = False # save memory by not saving py data structure for connections
cfg.gatherOnlySimData = False #Original

# set the following 3 options to False when running large-scale versions of the model (>50% scale) to save memory
cfg.saveCellSecs = True
cfg.saveCellConns = True
cfg.createPyStruct = True


###########################################################
Expand All @@ -46,7 +48,7 @@
# DC=False ; TH=True; Balanced=True => Figure 10A. But I want a partial reproduce so I guess Figure 10C is not necessary

# Size of Network. Adjust this constants, please!
cfg.ScaleFactor = 0.05 # 1.0 = 80.000
cfg.ScaleFactor = 0.10 # 1.0 = 80.000

# External input DC or Poisson
cfg.DC = False #True = DC // False = Poisson
Expand Down Expand Up @@ -80,9 +82,21 @@
cfg.analysis['plotSpikeStats'] = {'include' : [], 'stats' : ['rate'], 'legendLabels':cfg.recordCellsSpikes,
'timeRange' : [100,600], 'fontSize': 16, 'figSize': (6,9),'showFig':False, 'saveFig': True}

## Additional NetPyNE analysis
# plot traces
#cfg.recordTraces = {'m': {'var': 'm', 'conds':{'pop': ['L2e', 'L2i']}}}
#cfg.analysis['plotTraces'] = {'include':[('L2e', [0, 1, 2, 3]),('L2i', [0, 1])], 'timeRange': [0,100],'overlay': True,'oneFigPer': 'trace', 'showFig':False, 'saveFig': 'traceEscala3'+str(ScaleFactor)+'.png'}

# plot 2D net structure
# cfg.analysis['plot2Dnet'] = {'include': cfg.recordCellsSpikes, 'saveFig': True, 'figSize': (10,15)}

# plot convergence connectivity as 2D
# cfg.analysis['plotConn'] = {'includePre': cfg.recordCellsSpikes, 'includePost': cfg.recordCellsSpikes, 'feature': 'convergence', \
# 'synOrConn': 'conn', 'graphType': 'bar', 'saveFig': True, 'figSize': (15, 9)}

# plot firing rate spectrogram (run for 4 sec)
# cfg.analysis['plotRateSpectrogram'] = {'include': ['allCells'], 'saveFig': True, 'figSize': (15, 7)}

# plot granger causality (run for 4 sec)
# cfg.analysis.granger = {'cells1': ['L2i'], 'cells2': ['L4e'], 'label1': 'L2i', 'label2': 'L4e', 'timeRange': [500,4000], 'saveFig': True, 'binSize': 4}

1 change: 0 additions & 1 deletion init.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,3 @@
sim.saveData() # save params, cell info and sim output to file (pickle,mat,txt,etc)#
sim.analysis.plotData() # plot spike raster etc


17 changes: 13 additions & 4 deletions netParams.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ def Reescale(ScaleFactor, C, N_Full, w_p, f_ext, tau_syn, Inp, InpDC):
if cfg.Balanced == False:
InpUnb=np.array([2000, 1850, 2000, 1850, 2000, 1850, 2000, 1850])


###########################################################
# Reescaling calculation
###########################################################
Expand Down Expand Up @@ -135,8 +134,18 @@ def Reescale(ScaleFactor, C, N_Full, w_p, f_ext, tau_syn, Inp, InpDC):
# Populations parameters
############################################################

# population locations
# from Schmidt et al 2018, PLoS Comp Bio, Macaque V1
netParams.sizeX = 300 # x-dimension (horizontal length) size in um
netParams.sizeY = 1470 # y-dimension (vertical height or cortical depth) size in um
netParams.sizeZ = 300 # z-dimension (horizontal depth) size in um
netParams.shape = 'cylinder' # cylindrical (column-like) volume

popDepths = [[0.08, 0.27], [0.08, 0.27], [0.27, 0.58], [0.27, 0.58], [0.58, 0.73], [0.58, 0.73], [0.73, 1.0], [0.73, 1.0]]

# create populations
for i in range(0,8):
netParams.popParams[L[i]] = {'cellType': str(L[i]), 'numCells': int(N_[i]), 'cellModel': 'IntFire_PD', 'm':0, 'Iext':float(InpDC[i])}
netParams.popParams[L[i]] = {'cellType': str(L[i]), 'numCells': int(N_[i]), 'cellModel': 'IntFire_PD', 'm':0, 'Iext':float(InpDC[i]), 'ynormRange': popDepths[i] }

# To atualization of Point Neurons
netParams.popParams['bkg_IF'] = {'numCells': 1, 'cellModel': 'NetStim','rate': 40000, 'start':0.0, 'noise': 0.0, 'delay':0}
Expand Down Expand Up @@ -235,6 +244,6 @@ def Reescale(ScaleFactor, C, N_Full, w_p, f_ext, tau_syn, Inp, InpDC):
scale = 10 #max(1,int(sum(N_[:8])/1000))
include = [(pop, range(0, netParams.popParams[pop]['numCells'], scale)) for pop in L]
cfg.analysis['plotSpikeStats']['include'] = include
cfg.analysis['plotSpikeStats']['include'].reverse()
cfg.analysis['plotSpikeStats']['legendLabels'].reverse()
#cfg.analysis['plotSpikeStats']['include'].reverse()
#cfg.analysis['plotSpikeStats']['legendLabels'].reverse()

0 comments on commit 3c278a2

Please sign in to comment.