//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// NOTICE OF COPYRIGHT AND OWNERSHIP OF SOFTWARE
//
// Copyright 2010, The University Of Michigan
//
// All rights reserved.
// For research use only; commercial use prohibited.
// No Distribution without permission of William Stacey
// wstacey@umich.edu
//
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//
// This mod file is based on the paper:
// Tort, A. B., Rotstein, H. G., Dugladze, T., et al. (2007). On the formation of gamma-coherent cell assemblies by oriens lacunosum-moleculare interneurons in the hippocampus. Proc Natl Acad Sci U S A,.
// It is for the pyramidal cells
{load_file("syn.tem")}
{load_file("gap.tem")}
{load_file("iapp.tem")}
begintemplate PYRkop
external cvode
// PUBLIC VARIABLES
public soma, Bdend, Adend1, Adend2, Adend3, x, y, z
// PUBLIC OBJECTS
public iRec, iRecT, nc, spiketimes, idvec, synS, synB, synA1, synA2, synA3, synlist, iappS, iappA1, recordT, voltageRecS, gaplist, gapA1 //I added last three
public currentclamp
// PUBLIC METHODS
public getlocoS, getlocoB, getlocoA1, addSynS, addSynB, addSynA1, addSynA2, addSynA3, writeVoltage, writeDipole, is_art, addGapA1
public setIamp, setSomaIamp, setBdendIamp, setAdend1Iamp, setAdend2Iamp, setAdend3Iamp, getG, getTotalArea
public getTotalArea, connect2target, recordVoltage, setScatteredVoltages, plotVoltage, recordcurrent, writecurrent, recordnoise
create soma, Bdend, Adend1, Adend2, Adend3
objref iappS, iappB, iappA1, iappA2, iappA3
objref synS, synB, synA1, synA2, synA3
objref gapS, gapB, gapA1, gapA2, gapA3
objref locS, locB, locA1, locA2, locA3
objref nc, nil, synlist, gaplist
objref spiketimes, idvec, recordT[5], voltageRecS[5], iRec, iRecT
objref currentclamp
strdef cmd
// ========================================================================
//
// init()
//
// ========================================================================
proc init() {
setMorphology()
setConductances2()
insertIapp()
insertSynapses()
insertGapJunctions()
initVectors()
//setIamp()
iappA3.set_random_play( $4, $5, $6, $1) //mean, sd, isUnits, randomseedmultiplier
iappS.set_random_play( $2, $3, $6, $1)
}
// =================================================================================================
//
// position()
//
// =================================================================================================
proc position() { x=$1 y=$2 z=$3 }
// =================================================================================================
//
// is_art()
//
// =================================================================================================
func is_art() { return 0 }
// =================================================================================================
//
// recordVoltage()
//
// =================================================================================================
proc recordVoltage() {
//print "Started RECORDING VOLTAGE at PYR"
soma cvode.record(&v(0.5), voltageRecS[0], recordT[0] )
Bdend cvode.record(&v(0.5), voltageRecS[1], recordT[1] )
Adend1 cvode.record(&v(0.5), voltageRecS[2], recordT[2] )
Adend2 cvode.record(&v(0.5), voltageRecS[3], recordT[3] )
Adend3 cvode.record(&v(0.5), voltageRecS[4], recordT[4] )
}
proc recordnoise() {
//Adend1 iRec.record(&synA1.synList.object(2).i)
//synA1.synList.object(2) cvode.record(&i, iRec, iRecT)
//print synA1.synList.object(0), synA1.synList.object(1), synA1.synList.object(2)
// this run, Exp2Syn[7] is the one I want
iRec.record(&Exp2Syn[7].i) //or .g
}
proc recordcurrent() {
//$1 is total duration of clamp, $2 is amplitude, $3 is rs
soma currentclamp = new SEClamp(.5)
currentclamp.dur1=$1
currentclamp.amp1=$2
currentclamp.rs=$3
iRec.record(¤tclamp.i) //will be the NEGATIVE of the actual incoming current
}
// =================================================================================================
//
// writeVoltage(gid)
//
// =================================================================================================
proc writeVoltage() { local i localobj fo, m
//print "SIZE:", t, " ", recordT[0].size()
m = new Matrix(recordT[0].size(), 6)
m.setcol(0, recordT[0])
m.setcol(1, voltageRecS[0])
//for i=0,4 m.setcol(i+1, voltageRecS[i]) // - to do the axon and dends
fo = new File()
sprint(cmd, "data/%d.dat", $1)
fo.wopen(cmd)
m.fprint(0, fo, "%6.3lf ")
fo.close()
}
// =================================================================================================
//
// writeDipole(gid) this wasn't working for some reason
//
// =================================================================================================
proc writeDipole() { local i localobj fo, m
m = new Matrix(recordT[0].size(), 6)
m.setcol(0, recordT[0])
m.setcol(1, voltageRecS[1])
m.setcol(2, voltageRecS[4])
m.setcol(3, voltageRecS[0])
m.setcol(4, voltageRecS[4] - voltageRecS[0]) //this column is the A3 - B dipole
fo = new File()
sprint(cmd, "data/%d.dat", $1)
fo.wopen(cmd)
m.fprint(0, fo, "%6.3lf ")
fo.close()
}
objref gg //make graph global so it shows all plotted graphs
proc plotVoltage() { local i //localobj gg
gg= new Graph()
voltageRecS[2].plot(gg)
//for i=0,4 {
// voltageRecS[i].plot(gg)
// }
//gg.label($s1) doesn't work
}
// ========================================================================
//
// getTotalArea [um2]
//
// ========================================================================
func getTotalArea() {
return totalArea
}
// ========================================================================
//
// setMorphology( pp )
//
// ========================================================================
proc setMorphology() {
soma {
locS = new SectionRef()
diam = 20 // um
L = 20 // um
}
Bdend {
locB = new SectionRef()
diam = 2 // um
L = 200 // um
}
Adend1 {
locA1 = new SectionRef()
diam = 2 // um
L = 150 // um
}
Adend2 {
locA2 = new SectionRef()
diam = 2 // um
L = 150 // um
}
Adend3 {
locA3 = new SectionRef()
diam = 2 // um
L = 150 // um
}
connect Bdend(1), soma(0)
connect Adend1(0), soma(0.5)
connect Adend2(0), Adend1(1)
connect Adend3(0), Adend2(1)
totalArea = 0 // um2
forall totalArea=totalArea+area(0.5)
// totalArea = 5340
}
// ========================================================================
//
// setConductances
//
// ========================================================================
proc setConductances3() {
// Currents
forall insert kacurrent
Adend1 {
if (ismembrane("kacurrent"))g_kacurrent=0.072
}
Adend2 {
if (ismembrane("kacurrent"))g_kacurrent=0
if (ismembrane("kacurrent"))gd_kacurrent=0.120
}
Adend3 {
if (ismembrane("kacurrent"))g_kacurrent=0
if (ismembrane("kacurrent"))gd_kacurrent=0.200
}
forall {
insert pas
e_pas = -70 // mV
g_pas = 1/28000 // S/cm2
insert NafPyrKop
insert KdrPyrKop
// insert KaPyrKop
insert IhPyrKop
cm = 1
Ra = 150
}
Adend3 {
cm = cm * 2
g_pas = g_pas * 2
}
Bdend {
if (ismembrane("IhPyrKop")) gh_IhPyrKop = 0.1
if (ismembrane("KaPyrKop"))gmax_KaPyrKop = 48
if (ismembrane("IhPyrKop"))v50_IhPyrKop = -82
if (ismembrane("NafPyrKop"))bk_NafPyrKop = 1
if (ismembrane("KaPyrKop"))ck_KaPyrKop = 4
if (ismembrane("KaPyrKop"))dk_KaPyrKop = 1.5
if (ismembrane("KaPyrKop"))ek_KaPyrKop = 11
if (ismembrane("KaPyrKop"))fk_KaPyrKop = 0.825
}
soma {
if (ismembrane("IhPyrKop"))gh_IhPyrKop = 0.1
if (ismembrane("KaPyrKop"))gmax_KaPyrKop = 48
if (ismembrane("IhPyrKop"))v50_IhPyrKop = -82
if (ismembrane("NafPyrKop"))bk_NafPyrKop = 0.8
if (ismembrane("KaPyrKop"))ck_KaPyrKop = 4
if (ismembrane("KaPyrKop"))dk_KaPyrKop = 1.5
if (ismembrane("KaPyrKop"))ek_KaPyrKop = 11
if (ismembrane("KaPyrKop"))fk_KaPyrKop = 0.825
}
Adend1 {
if (ismembrane("IhPyrKop"))gh_IhPyrKop = 0.2
if (ismembrane("KaPyrKop"))gmax_KaPyrKop = 72
if (ismembrane("IhPyrKop"))v50_IhPyrKop = -82
if (ismembrane("NafPyrKop"))bk_NafPyrKop = 0.5
if (ismembrane("KaPyrKop"))ck_KaPyrKop = 4
if (ismembrane("KaPyrKop"))dk_KaPyrKop = 1.5
if (ismembrane("KaPyrKop"))ek_KaPyrKop = 11
if (ismembrane("KaPyrKop"))fk_KaPyrKop = 0.825
}
Adend2 {
if (ismembrane("IhPyrKop"))gh_IhPyrKop = 0.4
if (ismembrane("KaPyrKop"))gmax_KaPyrKop = 120
if (ismembrane("IhPyrKop"))v50_IhPyrKop = -90
if (ismembrane("NafPyrKop"))bk_NafPyrKop = 0.5
if (ismembrane("KaPyrKop"))ck_KaPyrKop = 2
if (ismembrane("KaPyrKop"))dk_KaPyrKop = 1.8
if (ismembrane("KaPyrKop"))ek_KaPyrKop = -1
if (ismembrane("KaPyrKop"))fk_KaPyrKop = 0.7
}
Adend3 {
if (ismembrane("IhPyrKop"))gh_IhPyrKop = 0.7
if (ismembrane("KaPyrKop"))gmax_KaPyrKop = 200
if (ismembrane("IhPyrKop"))v50_IhPyrKop = -90
if (ismembrane("NafPyrKop"))bk_NafPyrKop = 0.5
if (ismembrane("KaPyrKop"))ck_KaPyrKop = 2
if (ismembrane("KaPyrKop"))dk_KaPyrKop = 1.8
if (ismembrane("KaPyrKop"))ek_KaPyrKop = -1
if (ismembrane("KaPyrKop"))fk_KaPyrKop = 0.7
}
}
// ========================================================================
//
// setConductances
//
// ========================================================================
proc setConductances() {
forall {Ra=150}
// Currents
forall {
insert pas
g_pas = 0.0000357*1
insert nacurrent
insert kacurrent
insert kdrcurrent
insert hcurrent
}
// soma{insert Edrive} because of ghost cells
Adend1 {
ki_nacurrent = 0.5
g_kacurrent=0.072
v50_hcurrent = -82
g_hcurrent = 0.0002
}
Adend2 {
ki_nacurrent = 0.5
g_kacurrent=0
gd_kacurrent=0.120
v50_hcurrent = -90
g_hcurrent = 0.0004
}
Adend3 {
cm = 2
g_pas = 0.0000714
ki_nacurrent = 0.5
g_kacurrent=0
gd_kacurrent=0.200
v50_hcurrent = -90
g_hcurrent = 0.0007
}
Bdend {ki_nacurrent = 1}
}
// ========================================================================
//
// setConductances
//
// ========================================================================
proc setConductances2() {
forall {
insert pas
e_pas = -70 // mV
g_pas = 1/28000 // S/cm2
insert NafPyrKop
insert KdrPyrKop
insert KaPyrKop
insert IhPyrKop
cm = 1
Ra = 150
}
Adend3 {
cm = cm * 2
g_pas = g_pas * 2
}
Bdend {
gh_IhPyrKop = 0.1
gmax_KaPyrKop = 48
v50_IhPyrKop = -82
bk_NafPyrKop = 1
ck_KaPyrKop = 4
dk_KaPyrKop = 1.5
ek_KaPyrKop = 11
fk_KaPyrKop = 0.825
}
soma {
gh_IhPyrKop = 0.1
gmax_KaPyrKop = 48
v50_IhPyrKop = -82
bk_NafPyrKop = 0.8
ck_KaPyrKop = 4
dk_KaPyrKop = 1.5
ek_KaPyrKop = 11
fk_KaPyrKop = 0.825
}
Adend1 {
gh_IhPyrKop = 0.2
gmax_KaPyrKop = 72
v50_IhPyrKop = -82
bk_NafPyrKop = 0.5
ck_KaPyrKop = 4
dk_KaPyrKop = 1.5
ek_KaPyrKop = 11
fk_KaPyrKop = 0.825
}
Adend2 {
gh_IhPyrKop = 0.4
gmax_KaPyrKop = 120
v50_IhPyrKop = -90
bk_NafPyrKop = 0.5
ck_KaPyrKop = 2
dk_KaPyrKop = 1.8
ek_KaPyrKop = -1
fk_KaPyrKop = 0.7
}
Adend3 {
gh_IhPyrKop = 0.7
gmax_KaPyrKop = 200
v50_IhPyrKop = -90
bk_NafPyrKop = 0.5
ck_KaPyrKop = 2
dk_KaPyrKop = 1.8
ek_KaPyrKop = -1
fk_KaPyrKop = 0.7
}
forall gmax_KaPyrKop = gmax_KaPyrKop * 0.7
}
// ========================================================================
//
// insertIapp
//
// ========================================================================
proc insertIapp() {
soma iappS = new IApp()
Bdend iappB = new IApp()
Adend1 iappA1 = new IApp()
Adend2 iappA2 = new IApp()
Adend3 iappA3 = new IApp()
}
// ========================================================================
//
// setBdendIamp( i [uA/cm2] )
//
// ========================================================================
proc setBdendIamp() {
iappB.setValue($1*getTotalArea()*1e-5)
}
// ========================================================================
//
// setSomaIamp( i [uA/cm2] )
//
// ========================================================================
proc setSomaIamp() {
iappS.setValue($1*getTotalArea()*1e-5)
}
// ========================================================================
//
// setAdend1Iamp( i [uA/cm2] )
//
// ========================================================================
proc setAdend1Iamp() {
iappA1.setValue($1*getTotalArea()*1e-5,$2)
}
// ========================================================================
//
// setAdend2Iamp( i [uA/cm2] )
//
// ========================================================================
proc setAdend2Iamp() {
iappA2.setValue($1*getTotalArea()*1e-5)
}
// ========================================================================
//
// setAdend3Iamp( i [uA/cm2] )
//
// ========================================================================
proc setAdend3Iamp() {
iappA3.setValue($1*getTotalArea()*1e-5)
}
// ========================================================================
//
// setIamp( iB, iS, iA1, iA2, iA3 [uA/cm2])
//
// ========================================================================
proc setIamp() {
setBdendIamp($1)
setSomaIamp($2)
setAdend1Iamp($3)
setAdend2Iamp($4)
setAdend3Iamp($5)
}
// ========================================================================
//
// insertSynapses
//
// ========================================================================
proc insertSynapses() {
soma synS = new SynObj()
Bdend synB = new SynObj()
Adend1 synA1 = new SynObj()
Adend2 synA2 = new SynObj()
Adend3 synA3 = new SynObj()
synlist = new List()
}
// ========================================================================
//
// addSynS( tau1 (ms), tau2 (ms), Erev (mV), synapseName, synLoc )
//
// ========================================================================
func addSynS() {
synlist.append(synS.synList.object( synS.addSyn( $1, $2, $3, $s4, $5) ) )
return synlist.count()-1
}
// ========================================================================
//
// addSynB( tau1 (ms), tau2 (ms), Erev (mV), synapseName, synLoc )
//
// ========================================================================
func addSynB() {
synlist.append(synB.synList.object( synB.addSyn( $1, $2, $3, $s4, $5) ) )
return synlist.count()-1
}
// ========================================================================
//
// addSynA1( tau1 (ms), tau2 (ms), Erev (mV), synapseName, synLoc )
//
// ========================================================================
func addSynA1() {
synlist.append(synA1.synList.object( synA1.addSyn( $1, $2, $3, $s4, $5) ) )
return synlist.count()-1
}
// ========================================================================
//
// addSynA2( tau1 (ms), tau2 (ms), Erev (mV), synapseName, synLoc )
//
// ========================================================================
func addSynA2() {
synlist.append(synA2.synList.object( synA2.addSyn( $1, $2, $3, $s4, $5) ) )
return synlist.count()-1
}
// ========================================================================
//
// addSynA3( tau1 (ms), tau2 (ms), Erev (mV), synapseName, synLoc )
//
// ========================================================================
func addSynA3() {
synlist.append(synA3.synList.object( synA3.addSyn( $1, $2, $3, $s4, $5) ) )
return synlist.count()-1
}
// ========================================================================
//
// insertGapJunctions
//
// ========================================================================
proc insertGapJunctions() {
soma gapS = new GapObj()
Bdend gapB = new GapObj()
Adend1 gapA1 = new GapObj()
Adend2 gapA2 = new GapObj()
Adend3 gapA3 = new GapObj()
gaplist = new List()
}
// ========================================================================
//
// addGapA1( g )
//
// ========================================================================
func addGapA1() {
gapA1.add( $1 )
gaplist.append(gapA1.gapList.object(0) ) // gapList is prepended, so new one is 0
return gaplist.count()-1
}
// ========================================================================
//
// getTotalArea()
//
// ========================================================================
func getTotalArea() {
return totalArea
}
// ========================================================================
//
// connect2target( $o1 target point process, $o2 returned NetCon )
//
// ========================================================================
proc connect2target() { //$o1 target point process, $o2 returned NetCon
soma $o2 = new NetCon(&v(0.5), $o1, 0 ,0, 0)
//return synD.addNetCon($o2)
}
// ========================================================================
//
// initVectors
//
// ========================================================================
proc initVectors() {
spiketimes = new Vector()
idvec = new Vector()
for i=0, 4 {
voltageRecS[i] = new Vector()
iRec = new Vector()
iRecT = new Vector()
recordT[i] = new Vector()
}
}
// =================================================================================================
//
// setScatteredVoltages(low, high)
//
// =================================================================================================
proc setScatteredVoltages() { localobj rand
rand = new Random(startsw())
rand.uniform($1, $2)
forall v = rand.repick()
}
// ========================================================================
//
// getlocoS
//
// ========================================================================
obfunc getlocoS() { return locS }
// ========================================================================
//
// getlocoB
//
// ========================================================================
obfunc getlocoB() { return locB }
// ========================================================================
//
// getlocoA1
//
// ========================================================================
obfunc getlocoA1() { return locA1 }
// ========================================================================
//
// getlocoA2
//
// ========================================================================
obfunc getlocoA2() { return locA2 }
// ========================================================================
//
// getlocoA3
//
// ========================================================================
obfunc getlocoA3() { return locA3 }
endtemplate PYRkop