recording synaptic conductance

82 views
Skip to first unread message

alex

unread,
Mar 5, 2020, 4:11:35 AM3/5/20
to NetPyNE Q&A forum
Hi,
Sorry if this has been asked previously. I'm wondering if there any way to record synaptic conductance onto a given neuron during a simulation? E.g. for instance if a neuron with 10 Exp2Syn synapses within a network, is it possible to record the 'g' variable from the point processes? 
I have been playing around with simConfig record traces, and plot traces, but can only get cell variables like 'v' to work. 
Thanks in advance!

Joe Graham

unread,
Mar 5, 2020, 1:55:07 PM3/5/20
to NetPyNE Q&A forum
Hi Alex,

You can definitely record synaptic variables.  If you set up your synaptic mechanism like this:

netParams.synMechParams['mySynMech'] = {'mod': 'Exp2Syn'}

and attached the synapse to the 'soma' section at location 0.5, then you can record the conductance like this:

simConfig.recordTraces['myTraceName'] = {'sec':'soma', 'loc':0.5, 'synMech': 'mySynMech', 'var': 'g'}

Thanks for your question, I've added an issue to the NetPyNE GitHub repo requesting documentation on this topic:


alex

unread,
Mar 5, 2020, 5:16:54 PM3/5/20
to NetPyNE Q&A forum
Thanks Joe, that's a great help. I probably should have figured that out but was missing the synMech key.
Thanks again, Alex


zhao.z...@gmail.com

unread,
Jul 24, 2020, 10:36:33 AM7/24/20
to NetPyNE Q&A forum
Hi Alex, 

Did you see a summation of conductance (E.g. 10 Exp2Syn synapses on one neuron) when you record the 'g' variable on that neuron? I have tried the method above but I did not observe that. The 'g' plot is the same regardless of the number of Exp2Syn synapses that are on the neuron.

Thanks,

Zhihe

skai...@gmail.com

unread,
Jul 26, 2020, 9:54:19 PM7/26/20
to NetPyNE Q&A forum
Apologies for reviving this, but a related question. How are variables with several identical tags prioritized by recordTraces? For example, if I create a single synaptic mechanism 'exc' and use it to connect both a NetStim and Cell 0 to Cell 1, then why does feeding this dictionary

{'sec':'soma','loc':.5,'synMech':'exc','var':'i'}

to recordTraces record the 0->1 synaptic current but not the NetStim->1 synaptic current? If I want to record NetStim -> 1 in addition, how can I do this? (From some experimenting, it looks like {'conn':'synMech', 'synMech': 'exc', 'var': 'i'} does the trick, but then this begs the question of why the latter dictionary constitutes a reference to NetStim->1 and not 0->1). Clarification on this point would be very helpful!

Joe Graham

unread,
Jul 31, 2020, 5:39:05 PM7/31/20
to NetPyNE Q&A forum
Thanks for your question,

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!).  

Best wishes,
Joe


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)

Maliha A

unread,
Jul 24, 2024, 1:40:26 PM (3 days ago) Jul 24
to NetPyNE Q&A forum
Hi Joe, 
I've got a similar concern and I'm wondering if the following implementation makes sense. I'll use and modify the above example to illustrate what I mean (I've added comments to make a note of the modifications):

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": 2
}

# I HAVE TWO CELLS OF POPULATION0 

netParams.popParams['Population1'] = {
    "cellModel": "",
    "cellType": "CellType1",
    "numCells": 1
}

# I HAVE ONE CELL OF POPULATION1

netParams.synMechParams['exc_P0toP0'] = {
    "mod": "Exp2Syn",
    "tau1": 0.1,
    "tau2": 1,
    "e": 0,
}

netParams.synMechParams['exc_P1toP0'] = {
    "mod": "Exp2Syn",
    "tau1": 0.1,
    "tau2": 1,
    "e": 0,
}

# INSTEAD OF USING A COMMON SYNMECH DECLARATION, I'LL DEFINE TWO SEPARATE ONES FOR EACH POPULATION CONNECTING TO P0

netParams.connParams['0->0'] = {
    "preConds": {"pop": "Population0"},
    "postConds": {"pop": "Population0"},
    "synMech": "exc_P0toP0",
    "connList": [1,0],
    "probability": 1.0,
    "delay": 0, 
    "weight": 1.0,
}

netParams.connParams['1->0'] = {
    "preConds": {"pop": "Population1"},
    "postConds": {"pop": "Population0"},
    "synMech": "exc_P1toP0",
    "connList": [0,0],
    "probability": 1.0,
    "delay": 0, 
    "weight": 1.0,
}

# 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_P0toP0"] = {"sec": "soma", "loc": 0.5, "synMech": "exc_P0toP0", "var": "i"}
simConfig.recordTraces["i_exc_P1toP0"] = {"sec": "soma", "loc": 0.5, "synMech": "exc_P1toP0", "var": "i"}

# Run the simulation
sim.createSimulateAnalyze(netParams=netParams, simConfig=simConfig)



# THE TOTAL POSTSYNAPTIC CURRENT MEASURED FROM THE FIRST CELL IN POPULATION 0 WOULD THEREFORE BE THE SUM OF THESE INDIVIDUALLY RECORDED CURRENTS

Does this seem like a reasonable implementation? 

Thanks!
Maliha
Reply all
Reply to author
Forward
0 new messages