// build_pg_net.hoc
// builds simple model
// OSN input goes to two mitral cells
// which are connected to a peri-glomerular cell
load_file("mct_cells.hoc") // loads the McTavish cell templates Mitral and Granule
load_file("PG_def.hoc") // loads the Li and Cleland 2013 pg cell template
objref m1, m2, pg
m1 = new Mitral()
// m2 = new Mitral()
pg = new PGcell(0) // the number 0 passed to PGcell() is the nicot. current
// OSNXs will be representative of breathing while LightXs are repr. of light stim.
objref OSN1, OSN2, Light1, Light2
// let these be NetStims for now. Located arbitrarily because where they have an
// effect is determined by the NetCon.
m1.tuftden OSN1 = new ThetaStim(0.5)
m1.tuftden OSN2 = new ThetaStim(0.5)
m1.tuftden Light1 = new ThetaStim(0.5)
m1.tuftden Light2 = new ThetaStim(0.5)
// introduce synapses so they can be targets in NetCons:
objref m1_osn_glut, m2_osn_glut // excitation of mitral tufts by osn cells
objref pg_osn_glut, pg_osn_glut1 // excitation of pg cell from osn cells. glut1 for osn2
objref m1_pg_inhib, m2_pg_inhib // inhibition of mitral dends by pg
objref pg_m1_glut, pg_m2_glut // excitation of pg by mitral cells
// note m2 will be studied later - for now just sits here unconnected
tuft_excite_pos = 0.5
m1.tuftden m1_osn_glut = new AmpaNmda(tuft_excite_pos)
pg.gemmbody pg_osn_glut = new AmpaNmda(tuft_excite_pos)
pg.gemmbody1 pg_osn_glut1 = new AmpaNmda(tuft_excite_pos)
//m2.tuftden m2_osn_glut = new AmpaNmda(tuft_excite_pos)
mc_recip_pos = 0.05 // (0.05=1/20 of the sections length) with pg's represents 10 ums
// from the junction with the primary dendrite (the begining of the tuft dendrite)
m1.tuftden m1_pg_inhib = new FastInhib(mc_recip_pos) // start out with presumably effective
//m2.tuftden m2_pg_inhib = new FastInhib(mc_recip_pos) // synapses near the mitral cell soma
pg_recip_pos1 = 0.55
pg_recip_pos2 = 0.65
pg.gemmbody pg_m1_glut = new AmpaNmda(pg_recip_pos1)
// when other mc is connected pg.gemmbody pg_m2_glut = new AmpaNmda(pg_recip_pos2)
/////////////////////////////////////////////////////
//
// connect the network
//
/////////////////////////////////////////////////////
// Connect the ThetaStims (OSN's) to the mc's
objref nc[8]
objref nclist
nclist = new List()
// connect the OSNs to the mcs
nc[0] = new NetCon(OSN1, m1_osn_glut, 0, 1, 1) // arguments are source, target, threshold, delay, weight
// nc[1] = new NetCon(OSN2, m2_osn_glut)
nc[1] = new NetCon(OSN2, pg_osn_glut1)
// connect the Lights to the mcs
nc[6] = new NetCon(Light1, m1_osn_glut, 0, 1, 1) // arguments are source, target, threshold, delay, weight
// nc[7] = new NetCon(Light2, m2_osn_glut)
nc[7] = new NetCon(Light2, pg_osn_glut1)
// connect the reciprocal synapse between m1 and pg
m1.secden[0] {nc[2] = new NetCon(&v(mc_recip_pos), pg_m1_glut, -20, 1, 1)}
pg.gemmbody nc[3] = new NetCon(&v(pg_recip_pos1), m1_pg_inhib)
// connect the reciprocal synapse between m2 and pg
// m2.secden[0] nc[4] = new NetCon(&v(mc_recip_pos), pg_m2_glut)
// pg.priden2[0] nc[5] = new NetCon(&v(pg_recip_pos2), m2_pg_inhib)
for i=0,5 {
nclist.append(nc[i])
}
/////////////////////////////////////////////////////
//
// Adjust plasticity of FastInhib and AmpaNmda
//
/////////////////////////////////////////////////////
// it was decided the easiest thing to do was turn off
// plasticity in the AmpaNmda and FastInhib mod files
/*
// test section
objref test_pg
m1.tuftden test_pg = new ThetaStim(0.5) // stimulate granule cell synapse directly
objref test_nc
test_nc = new NetCon(test_pg, pg_m1_glut)
objref test_pg2
m1.tuftden test_pg2 = new ThetaStim(0.5) // stimulate granule cell synapse directly
objref test_nc2
test_nc2 = new NetCon(test_pg2, pg_m1_glut)
nclist.append(test_nc)
nclist.append(test_nc2)
// end test section
*/
/////////////////////////////////////////////////////
//
// Graphical control of ThetaStims
//
/////////////////////////////////////////////////////
objref hbox
hbox = new HBox()
hbox.intercept(1)
xpanel("ThetaStim[0] and [2]")
xlabel("OSN breathing input to mitral cell 1:")
xvalue("ThetaStim[0].outer_interval")
xvalue("ThetaStim[0].outer_start")
xvalue("ThetaStim[0].outer_number")
xvalue("ThetaStim[0].outer_noise")
xvalue("ThetaStim[0].interval")
xvalue("ThetaStim[0].start")
xvalue("ThetaStim[0].number")
xvalue("ThetaStim[0].noise")
// assign some default values
ThetaStim[0].outer_interval=400
ThetaStim[0].outer_start=25
ThetaStim[0].outer_number=80
ThetaStim[0].outer_noise=0
ThetaStim[0].interval=25
ThetaStim[0].start=25
ThetaStim[0].number=3
xlabel("Light input to periglomerular cell:")
xvalue("ThetaStim[2].outer_interval")
xvalue("ThetaStim[2].outer_start")
xvalue("ThetaStim[2].outer_number")
xvalue("ThetaStim[2].outer_noise")
xvalue("ThetaStim[2].interval")
xvalue("ThetaStim[2].start")
xvalue("ThetaStim[2].number")
xvalue("ThetaStim[2].noise")
// assign some default values
ThetaStim[2].outer_interval=395
ThetaStim[2].outer_start=25
ThetaStim[2].outer_number=80
ThetaStim[2].outer_noise=0
ThetaStim[2].interval=25
ThetaStim[2].start=25
ThetaStim[2].number=3
xpanel()
xpanel("ThetaStim[1] and [3]")
xlabel("OSN breathing input to periglomerular cell:")
xvalue("ThetaStim[1].outer_interval")
xvalue("ThetaStim[1].outer_start")
xvalue("ThetaStim[1].outer_number")
xvalue("ThetaStim[1].outer_noise")
xvalue("ThetaStim[1].interval")
xvalue("ThetaStim[1].start")
xvalue("ThetaStim[1].number")
xvalue("ThetaStim[1].noise")
ThetaStim[1].outer_interval=400
ThetaStim[1].outer_start=80
ThetaStim[1].outer_number=5
ThetaStim[1].outer_noise=0
ThetaStim[1].interval=25
ThetaStim[1].start=25
ThetaStim[1].number=3
xlabel("Light input to periglomerular cell:")
xvalue("ThetaStim[3].outer_interval")
xvalue("ThetaStim[3].outer_start")
xvalue("ThetaStim[3].outer_number")
xvalue("ThetaStim[3].outer_noise")
xvalue("ThetaStim[3].interval")
xvalue("ThetaStim[3].start")
xvalue("ThetaStim[3].number")
xvalue("ThetaStim[3].noise")
// assign some default values
ThetaStim[3].outer_interval=0
ThetaStim[3].outer_start=0
ThetaStim[3].outer_number=0
ThetaStim[3].outer_noise=0
ThetaStim[3].interval=0
ThetaStim[3].start=0
ThetaStim[3].number=0
xpanel()
/*xlabel("test pg belo ")
xvalue("ThetaStim[2].interval")
xvalue("ThetaStim[2].start")
xvalue("ThetaStim[2].number")
xvalue("ThetaStim[2].noise")
xlabel("test pg2 belo ")
xvalue("ThetaStim[3].interval")
xvalue("ThetaStim[3].start")
xvalue("ThetaStim[3].number")
xvalue("ThetaStim[3].noise")
*/
global_weight=1
//xvalue("prompt", "variable" [, boolean_deflt, "action" [, boolean_canrun, boolean_usepointer]])
//xvalue("global_weight","global_weight",2,"readjust_weights()",1, 0)
xpanel("Synapse weights")
xlabel("Synapse weights")
xvalue("global_weight")
xbutton("readjust_weights()")
xlabel("OSN1 (ThetaStim[1])to m1:")
xvalue("nc[0].weight")
xlabel("OSN2 (ThetaStim[1]) to pg:")
xvalue("nc[1].weight")
xlabel("m1 to pg:")
xvalue("nc[2].weight")
xlabel("pg back to m1:")
xvalue("nc[3].weight")
// xlabel("m2 to pg")
// xvalue("nc[4].weight")
// xlabel("pg back to m2")
// xvalue("nc[5].weight")
xlabel(" press below to graph stimulations")
xbutton("light(green) breath1(orange) breath2(purple)","{regraph_stims()}")
xbutton("save some data files","write_selected_vecs()")
xbutton("save simulation to tank","save_tank()")
xpanel()
hbox.intercept(0)
hbox.map()
// test values:
ThetaStim[0].number=3
ThetaStim[1].number=3
/*
ThetaStim[2].number=20
ThetaStim[3].number=50
ThetaStim[3].start = 330
*/
/////////////////////////////////////////////////////
//
// Setup vector and event recording for graphing/analysis
//
/////////////////////////////////////////////////////
objref t_vec, m1_v_vec, m2_v_vec
t_vec = new Vector()
m1_v_vec = new Vector()
//m2_v_vec = new Vector()
t_vec.record(&t)
m1_v_vec.record(&m1.soma.v(0.5))
//m2_v_vec.record(&m2.soma.v(0.5))
objref light1_events, light2_events
objref OSN1_events, OSN2_events, m1_events, m2_events, pg_events1, pg_events2
OSN1_events = new Vector()
OSN2_events = new Vector()
m1_events = new Vector()
//m2_events = new Vector()
pg_events1 = new Vector()
pg_events2 = new Vector()
light1_events = new Vector()
light2_events = new Vector()
nc[0].record(OSN1_events)
nc[1].record(OSN2_events)
nc[2].record(m1_events)
nc[3].record(pg_events1) // source position pg_recip_pos1 on granule priden2[0]
//nc[4].record(m2_events)
// nc[5].record(pg_events2) // source position pg_recip_pos2 on granule priden2[0]
nc[6].record(light1_events)
nc[7].record(light2_events) //for these connects the events are recorded into vectors here
// activate all the synapses
proc readjust_weights() {
for i=0,nclist.count-1 {
nc[i].weight=global_weight
}
}
readjust_weights()
// test_nc.weight=global_weight
// test_nc2.weight=global_weight
load_file("cells_volt_graphs_pg.ses")
load_file("run_cntrl.ses")
load_file("graph_fncs_pg.hoc")
load_file("tdt2mat_data.hoc")