I have a population model and I want to record somatic synaptic currents and somatic voltage from a given excitatory cell.
I have my GABAa mod file and GABA synapses are inserted in my excitatory cell model.
Using the code below I can successfully record the somatic voltage but not synaptic currents.
The vector recording the currents (i_vecs) is empty as it doesn't point to anything in my excitatory cell model.
Error: "_ref_i was not made to point to anything at the pyramidacell.hoc"
What is the correct syntax to record synaptic currents (particularly GABAa)? Any documentation I've read shows that "i_vec.record(target.soma(0.5)._ref_i)" should be the right syntax, but I probably need to change the pointer "..._ref_i" into something more specific. Do I need to set a pointer for this? Any help with debugging this would be greatly appreciated.
thank you,
Alex
Code: Select all
import time
h.load_file("stdrun.hoc")
def record_population_voltages(c,pop_id):
v_vecs = []
for i in range(len(c.neurons[pop_id])):
v_vec = h.Vector()
try:
v_vec.record(c.neurons[pop_id][i].axon(0.5)._ref_v)
except:
v_vec.record(c.neurons[pop_id][i].soma(0.5)._ref_v)
v_vecs.append(v_vec)
return v_vecs
exc_v_vecs = record_population_voltages(circuit, 0)
pvbc_v_vecs = record_population_voltages(circuit, 1)
def get_population_currents(c,pop_id):
i_vecs = []
#for target in range(len(c.neurons[pop_id])):
for i in range(len(c.neurons[pop_id])):
i_vec = h.Vector()
try:
target = c.neurons[pop_id][i]
i_vec.record(target.soma(0.5)._ref_i)
except:
target = c.neurons[pop_id][i]
i_vec.record(target.soma(0.5)._ref_i)
i_vecs.append(i_vec)
return i_vecs
exc_i_vecs = record_population_currents(circuit, 0)
pvbc_i_vecs = record_population_currents(circuit, 1)
print('starting simulation..')
t_vec = h.Vector() # Time stamp vector
t_vec.record(h._ref_t)
tic = time.time()
h.dt = 0.5
h.tstop = time_for_single
h.finitialize(-65.0)
h.fadvance()
h.continuerun(h.tstop)
elapsed = time.time() - tic
print('that took %0.3f seconds' % elapsed)