We are working on the ability to record multiple traces of the same synMech at the same location. In the latest update to the development branch, you can specify a trace index for such cases. You can see how this works in the Python script pasted below.
Let us know if this helps and if you have any other questions (or suggestions!).
The following is a Python script demonstrating the use of 'index' in recordTraces:
"""
This simulation sets up two cells (Cell0 and Cell1) and two NetStims
(NetStim0 and NetStim1).
NetStim0 connects to Cell0 with an 'exc' synapse. Cell0 connects to Cell1
with two 'exc' synapses. NetStim0 causes Cell0 to spike at 100 ms. The
spiking of Cell0 causes Cell1 to spike at 105 ms.
NetStim1 connects to Cell1 with two 'exc' synapses. NetStim1 causes Cell1
to spike at 250 ms.
By using the 'index' option in `recordTraces`, you can disentangle all
the 'exc' currents, as demonstrated in this file.
"""
from netpyne import specs, sim
netParams = specs.NetParams()
simConfig = specs.SimConfig()
netParams.cellParams['CellType0'] = {
"secs": {
"soma": {
"geom": {"diam": 20, "L": 20, "Ra": 100.0, "cm": 1},
"mechs": {"hh": {"el": -50}}
}
}
}
netParams.cellParams['CellType1'] = {
"secs": {
"soma": {
"geom": {"diam": 20, "L": 20, "Ra": 100.0, "cm": 1},
"mechs": {"hh": {"el": -60}}
}
}
}
netParams.popParams['Population0'] = {
"cellModel": "",
"cellType": "CellType0",
"numCells": 1
}
netParams.popParams['Population1'] = {
"cellModel": "",
"cellType": "CellType1",
"numCells": 1
}
netParams.popParams['Source0'] = {
"cellModel": "NetStim",
"cellType": "source0",
"numCells": 1,
"interval": 1000,
"start": 100,
}
netParams.popParams['Source1'] = {
"cellModel": "NetStim",
"cellType": "source1",
"numCells": 1,
"interval": 1000,
"start": 250,
}
netParams.synMechParams['exc'] = {
"mod": "Exp2Syn",
"tau1": 0.1,
"tau2": 1,
"e": 0,
}
netParams.connParams['netstim1->1'] = {
"preConds": {"pop": ["Source1"]},
"postConds": {"pop": "Population1"},
"synMech": "exc",
"synsPerConn": 2,
"probability": 1.0,
"delay": 0.0,
"weight": 1.0,
"loc": [0.5, 0.5],
}
netParams.connParams['0->1'] = {
"preConds": {"pop": "Population0"},
"postConds": {"pop": "Population1"},
"synMech": "exc",
"synsPerConn": 2,
"probability": 1.0,
"delay": 5.0,
"weight": 1.0,
"loc": [0.5, 0.5]
}
netParams.connParams['netstim0->0'] = {
"preConds": {"pop": ["Source0"]},
"postConds": {"pop": "Population0"},
"synMech": "exc",
"synsPerConn": 1,
"probability": 1.0,
"delay": 0.0,
"weight": 1.0,
"loc": 0.5,
}
# Set up the sim config
simConfig.duration = 500
simConfig.recordCells = [0, 1]
simConfig.recordTraces = {"V_soma": {"sec": "soma", "loc": 0.5, "var": "v"}}
# Record the traces using the 'index' option
simConfig.recordTraces["i_exc_0"] = {"sec": "soma", "loc": 0.5, "synMech": "exc", "var": "i", "index":0}
simConfig.recordTraces["i_exc_1"] = {"sec": "soma", "loc": 0.5, "synMech": "exc", "var": "i", "index":1}
simConfig.recordTraces["i_exc_2"] = {"sec": "soma", "loc": 0.5, "synMech": "exc", "var": "i", "index":2}
simConfig.recordTraces["i_exc_3"] = {"sec": "soma", "loc": 0.5, "synMech": "exc", "var": "i", "index":3}
simConfig.recordTraces["i_exc_4"] = {"sec": "soma", "loc": 0.5, "synMech": "exc", "var": "i", "index":4}
# Run the simulation
sim.createSimulateAnalyze(netParams=netParams, simConfig=simConfig)
# Plot some results
sim.analysis.plotTraces(oneFigPer='cell', overlay=False, saveFig=True, showFig=True)