Recording soma potential in multiple cells using Cvode.recor
Posted: Fri Aug 19, 2011 7:21 pm
Hi,
I have a list of cell objects and want to record the somatic potential of each cell in the list. I wrote the following code to insert an IClamp in each cell and record Vsoma and injected current for further processing. However, I get a syntax error that I couldn''t figure out. Your help will be highly appreciated.
When I run this code by calling Test(AllCells), I get the following error message:
Also, please advise if you have a better way to define multiple vectors than the way I did.
Thanks,
-S
I have a list of cell objects and want to record the somatic potential of each cell in the list. I wrote the following code to insert an IClamp in each cell and record Vsoma and injected current for further processing. However, I get a syntax error that I couldn''t figure out. Your help will be highly appreciated.
Code: Select all
// Arg 1: a list of cells
proc Test(){local i localobj ss, Iinj, Tinj
ss = new String()
Iinj = new Vector()
Tinj = new Vector()
for i=0,$o1.count()-1 {
sprint(ss.s, "objref SomaV%d", i) // define a set of objects to store Vsoma
execute(ss.s)
sprint(ss.s, "SomaV%d = new Vector()", i) // define a set of vectors to store Vsoma
execute(ss.s)
sprint(ss.s, "objref SomaT%d", i) // define a set of objects to store Tsoma
execute(ss.s)
sprint(ss.s, "SomaT%d = new Vector()", i) // define a set of vectors to store Tsoma
execute(ss.s)
sprint(ss.s, "objref ic%d", i) // define a set of objects for Iclamp
execute(ss.s)
object_push($o1.o(i)) // Access one cell from the list
forsec "soma" {
sprint(ss.s, "ic%d = new IClamp(0.5)", i) // insert Iclamp
execute(ss.s)
sprint(ss.s, "cvode.record(&soma.v(0.5), SomaV%d, SomaT%d)", i, i) //Record Vsoma & Tsoma
execute(ss.s)
}
object_pop()
}
sprint(ss.s, "cvode.record(&ic%d.i, Iinj, Tinj)", i) // Record Iinj and Tinj
execute(ss.s)
run()
}
I cannot figure out the problem. I think I am using cvode.record() in the correct form.Test(AllCells)
nrniv: syntax error
near line 29
{cvode.record(&soma.v(0.5), SomaV0, SomaT0)}
^
FR_Cell[0].execute("cvode.record(&soma.v(0.5), SomaV0, SomaT0)" )
Test(List[8] )
nrniv: execute error: cvode.record(&soma.v(0.5), SomaV0, SomaT0)
near line 29
Also, please advise if you have a better way to define multiple vectors than the way I did.
Thanks,
-S