Skip to content

Commit

Permalink
Merge pull request #2 from OpenSourceBrain/master
Browse files Browse the repository at this point in the history
Updated scripts to test & compare channels NML2 vs mod
  • Loading branch information
RokasSt committed Dec 11, 2015
2 parents 3874e87 + 21aee3d commit 1b97767
Show file tree
Hide file tree
Showing 8 changed files with 242 additions and 46 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

/NeuroML2/*.mod
/NeuroML2/*.hoc
/NeuroML2/*.dat

/NEURON*/test/*.dat
/NEURON*/*.dat
Expand Down
37 changes: 32 additions & 5 deletions NEURON/test/Test_SK2.hoc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ insert Golgi_lkg
glbar_Golgi_lkg=2.1e-05

insert Golgi_SK2
gkbar_Golgi_SK2=0.000000038

//ena = -55
ek = -84.69


insert CaClamp

Expand Down Expand Up @@ -48,8 +53,8 @@ Soma {



tstop = 600.0
dt = 0.01
tstop = 1000.0
dt = 0.002


objref v_time
Expand All @@ -64,10 +69,25 @@ f_time = new File()
objref Soma_v
{ Soma_v = new Vector() }
{ Soma_v.record(&Soma.v(0.5))}

objref Soma_ca
{ Soma_ca = new Vector() }
{ Soma_ca.record(&Soma.cai(0.5))}

objref Soma_o1, Soma_o2, Soma_c1, Soma_c2, Soma_c3, Soma_c4
{ Soma_o1 = new Vector() }
{ Soma_o1.record(&Soma.o1_Golgi_SK2(0.5))}
{ Soma_o2 = new Vector() }
{ Soma_o2.record(&Soma.o2_Golgi_SK2(0.5))}
{ Soma_c1 = new Vector() }
{ Soma_c1.record(&Soma.c1_Golgi_SK2(0.5))}
{ Soma_c2 = new Vector() }
{ Soma_c2.record(&Soma.c2_Golgi_SK2(0.5))}
{ Soma_c3 = new Vector() }
{ Soma_c3.record(&Soma.c3_Golgi_SK2(0.5))}
{ Soma_c4 = new Vector() }
{ Soma_c4.record(&Soma.c4_Golgi_SK2(0.5))}

objref f_Soma_v


Expand Down Expand Up @@ -115,7 +135,7 @@ strdef timeFilename

f_Soma_v = new File()
strdef filename
{sprint(filename, "Soma.dat")}
{sprint(filename, "KAHP.dat")}
f_Soma_v.wopen(filename)
Soma_v.printf(f_Soma_v)
f_Soma_v.close()
Expand All @@ -129,12 +149,20 @@ f_Soma_v.close()

objref f_Soma_si
f_Soma_si = new File()
{ f_Soma_si.wopen("Soma.si.dat") }
{ f_Soma_si.wopen("KAHP.si.dat") }
for i=0, Soma_v.size()-1 {
f_Soma_si.printf("%f\t%f\n", v_time.x[i]/1000, Soma_v.x[i]/1000)
}
{ f_Soma_si.close() }

objref f_Soma_r
f_Soma_r = new File()
{ f_Soma_r.wopen("KAHP.states.dat") }
for i=0, Soma_v.size()-1 {
f_Soma_r.printf("%f\t%f\t%f\t%f\t%f\t%f\t%f\n", v_time.x[i]/1000, Soma_o1.x[i], Soma_o2.x[i], Soma_c1.x[i], Soma_c2.x[i], Soma_c3.x[i], Soma_c4.x[i])
}
{ f_Soma_r.close() }




Expand All @@ -148,7 +176,6 @@ if (usegui==1) {
xbutton("Stop","stoprun=1")
t = 0
xvalue("t","t", 2 )
tstop = 600.0
xvalue("Tstop","tstop", 1,"tstop_changed()", 0, 1 )
dt = 0.01
xvalue("dt","dt", 1,"setdt()", 0, 1 )
Expand Down
174 changes: 174 additions & 0 deletions NEURON/test/Test_Soma.hoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,174 @@
usegui = 1

{load_file("stdlib.hoc")}
{load_file("stdgui.hoc")}


create Soma
access Soma

celsius = 23

Soma {pt3dclear() pt3dadd(0.0, 0, 0.0, 27) pt3dadd(0.0, 27, 0.0, 27)}
define_shape()

forall Ra = 100

insert Golgi_lkg
glbar_Golgi_lkg=2.1e-05

insert Golgi_KA
gkbar_Golgi_KA=0.008

insert Golgi_CALC

//ena = -55
ek = -84.69

proc initialiseValues0() {

forall v = -65

}

objref fih0
{fih0 = new FInitializeHandler(0, "initialiseValues0()")}

objref stim1
objref stim2


Soma {
stim1 = new IClamp(0.5)
stim1.del = 200.0
stim1.dur = 200.0
stim1.amp = -0.005

stim2 = new IClamp(0.5)
stim2.del = 800.0
stim2.dur = 200.0
stim2.amp = 0.04
}



tstop = 1500.0
dt = 0.002


objref v_time
objref f_time

v_time = new Vector()
{ v_time.record(&t) }
//{ v_time.resize(70001) } // false
f_time = new File()


objref Soma_v
{ Soma_v = new Vector() }
{ Soma_v.record(&Soma.v(0.5))}
objref Soma_ca
{ Soma_ca = new Vector() }
{ Soma_ca.record(&Soma.cai(0.5))}
objref Soma_ka_a
{ Soma_ka_a = new Vector() }
{ Soma_ka_a.record(&Soma.a_Golgi_KA(0.5))}
objref Soma_ka_b
{ Soma_ka_b = new Vector() }
{ Soma_ka_b.record(&Soma.b_Golgi_KA(0.5))}

objref f_Soma_v


objref GraphWin_0
objref GraphWin_1
objref GraphWin_2
objref GraphWin_3

if (usegui==1) {
GraphWin_0 = new Graph(0)
{GraphWin_0.size(0, tstop,-110.0,50.0)}
{GraphWin_0.view(0, -110.0, tstop, 160.0, 80, 330, 330, 250)}
{
GraphWin_0.addexpr("Soma.v", "Soma.v(0.5)", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_0)
}

GraphWin_2 = new Graph(0)
{GraphWin_2.size(0, tstop,0,1)}
{GraphWin_2.view(0, 0, tstop, 1, 80, 330, 330, 250)}
{
GraphWin_2.addexpr("KA a", "Soma.a_Golgi_KA", 1, 1, 0.8, 0.9, 2)
GraphWin_2.addexpr("KA b", "Soma.b_Golgi_KA", 2, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_2)
}

GraphWin_3 = new Graph(0)
{GraphWin_3.size(0, tstop,0,0.005)}
{GraphWin_3.view(0, 0, tstop, 0.005, 80, 330, 330, 250)}
{
GraphWin_3.addexpr("cai", "Soma.cai", 1, 1, 0.8, 0.9, 2)
graphList[0].append(GraphWin_3)
}

}

{run()}

strdef timeFilename


f_Soma_v = new File()
strdef filename
{sprint(filename, "Soma.dat")}
f_Soma_v.wopen(filename)
Soma_v.printf(f_Soma_v)
f_Soma_v.close()


{ sprint(timeFilename, "%s", "time.dat")}
{ f_time.wopen(timeFilename) }
{ v_time.printf(f_time) }
{ f_time.close() }

objref f_Soma_si
f_Soma_si = new File()
{ f_Soma_si.wopen("Soma.si.dat") }
for i=0, Soma_v.size()-1 {
f_Soma_si.printf("%f\t%f\n", v_time.x[i]/1000, Soma_v.x[i]/1000)
}
{ f_Soma_si.close() }



objref f_Soma_ka
f_Soma_ka = new File()
{sprint(filename, "KA.dat")}
f_Soma_ka.wopen(filename)
for i=0, Soma_v.size()-1 {
f_Soma_ka.printf("%f\t%f\t%f\n", v_time.x[i]/1000, Soma_ka_a.x[i], Soma_ka_b.x[i])
}
f_Soma_ka.close()




if (usegui==1) {
// This code pops up a simple Run Control

{
xpanel("RunControl", 0)
v_init = -60.0
xbutton("Init & Run","run()")
xbutton("Stop","stoprun=1")
t = 0
xvalue("t","t", 2 )
xvalue("Tstop","tstop", 1,"tstop_changed()", 0, 1 )
dt = 0.01
xvalue("dt","dt", 1,"setdt()", 0, 1 )
xpanel(80,80)
}
}

forall psection()
20 changes: 8 additions & 12 deletions NeuroML2/LEMS_KAHP_Test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

<!--Note: this could be: Simulation id="sim1" ... , but Component type="Simulation" ...
is used to allow validation of this file according to the LEMS schema specified above...-->
<Component type="Simulation" id="sim1" length="600.0ms" step="0.05ms" target="network_Soma">
<Component type="Simulation" id="sim1" length="1000.0ms" step="0.05ms" target="network_Soma">

<Display id="CG_v" title="Soma VOLTAGE" xmin="-60.0" xmax="660.0" ymin="-120.0" ymax="64.0" timeScale="1ms">
<Display id="CG_v" title="Soma VOLTAGE" xmin="-60.0" xmax="1060.0" ymin="-120.0" ymax="64.0" timeScale="1ms">
<Line id="VOLTAGE" timeScale="1ms" quantity="CG_Test/0/TestKAHP/v" scale="1 mV" color="#000000"/>
</Display>

<Display id="GraphWin_0" title="Soma channels" xmin="-60.0" xmax="660.0" ymin="-0.1" ymax="1.1" timeScale="1ms">
<Display id="GraphWin_0" title="Soma channels" xmin="-60.0" xmax="1060.0" ymin="-0.1" ymax="1.1" timeScale="1ms">
<Line id="o1" timeScale="1ms" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/o1/occupancy" scale="1" color="#000000"/>
<Line id="o2" timeScale="1ms" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/o2/occupancy" scale="1" color="#FF0000"/>

Expand All @@ -40,26 +40,22 @@
<Line id="c4" timeScale="1ms" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/c4/occupancy" scale="1" color="#7a5230"/>
</Display>

<Display id="CG_conc" title="Soma [Ca2+]" xmin="-60" xmax="660" ymin="-0.0006" ymax="0.006" timeScale="1ms">
<Display id="CG_conc" title="Soma [Ca2+]" xmin="-60" xmax="1060" ymin="-0.0006" ymax="0.006" timeScale="1ms">
<Line id="[Ca2+]" timeScale="1ms" quantity="CG_Test/0/TestKAHP/caConc" scale="1 mM" color="#000000"/>
</Display>




<OutputFile id="v" fileName="KAHP.v.dat">
<OutputColumn id="v" quantity="CG_Test/0/TestKAHP/v"/>
</OutputFile>

<OutputFile id="states" fileName="KAHP.states.dat">
<OutputColumn id="o1" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/o1/occupancy"/>
<OutputColumn id="o2" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/o2/occupancy"/>

<OutputColumn id="c1" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/c1/occupancy"/>
<OutputColumn id="c2" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/c2/occupancy"/>
<OutputColumn id="c3" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/c3/occupancy"/>
<OutputColumn id="c4" quantity="CG_Test/0/TestKAHP/biophys/membraneProperties/KAHP_CML_all/KAHP_CML/n/c4/occupancy"/>

</OutputFile>

<OutputFile id="v" fileName="KAHP.v.dat">
<OutputColumn id="v" quantity="CG_Test/0/TestKAHP/v"/>
</OutputFile>


Expand Down
18 changes: 13 additions & 5 deletions NeuroML2/LEMS_Soma_Test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,31 @@

<!--Note: this could be: Simulation id="sim1" ... , but Component type="Simulation" ...
is used to allow validation of this file according to the LEMS schema specified above...-->
<Component type="Simulation" id="sim1" length="600.0ms" step="0.005ms" target="network_Soma">
<Component type="Simulation" id="sim1" length="1500.0ms" step="0.005ms" target="network_Soma">

<Display id="CG_v" title="Soma VOLTAGE" xmin="-60.0" xmax="660.0" ymin="-75" ymax="50" timeScale="1ms">
<Display id="CG_v" title="Soma VOLTAGE" xmin="-100.0" xmax="1600.0" ymin="-75" ymax="50" timeScale="1ms">
<Line id="VOLTAGE" timeScale="1ms" quantity="CG_Test/0/TestSoma/v" scale="1 mV" color="#000000"/>
</Display>

<Display id="CG_conc" title="Soma [Ca2+]" xmin="-60" xmax="660" ymin="-0.0006" ymax="0.006" timeScale="1ms">
<Line id="[Ca2+]" timeScale="1ms" quantity="CG_Test/0/TestSoma/caConc" scale="1 mM" color="#000000"/>
<Display id="Rates" title="Rate variables" xmin="-100.0" xmax="1600.0" ymin="-0.1" ymax="1.1" timeScale="1ms">
<Line id="KA a" timeScale="1ms" quantity="CG_Test/0/TestSoma/biophys/membraneProperties/KA_all/Golgi_KA/a/q" scale="1" color="#000000"/>
<Line id="KA b" timeScale="1ms" quantity="CG_Test/0/TestSoma/biophys/membraneProperties/KA_all/Golgi_KA/b/q" scale="1" color="#FF0000"/>
</Display>


<Display id="CG_conc" title="Soma [Ca2+]" xmin="-100.0" xmax="1600.0" ymin="-0.0006" ymax="0.006" timeScale="1ms">
<Line id="[Ca2+]" timeScale="1ms" quantity="CG_Test/0/TestSoma/caConc" scale="1 mM" color="#000000"/>
</Display>


<OutputFile id="v" fileName="Soma.v.dat">
<OutputColumn id="v" quantity="CG_Test/0/TestSoma/v"/>
</OutputFile>

<OutputFile id="rates" fileName="KA.dat">
<OutputColumn id="a" quantity="CG_Test/0/TestSoma/biophys/membraneProperties/KA_all/Golgi_KA/a/q"/>
<OutputColumn id="b" quantity="CG_Test/0/TestSoma/biophys/membraneProperties/KA_all/Golgi_KA/b/q"/>
</OutputFile>


</Component>

Expand Down
17 changes: 3 additions & 14 deletions NeuroML2/TestKAHP.cell.nml
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,11 @@
<membraneProperties>

<channelDensity condDensity="0.021 mS_per_cm2" id="LeakCond_all" ionChannel="LeakCond" erev="-55.0 mV" ion="non_specific"/>

<channelDensity condDensity="0.038 mS_per_cm2" id="KAHP_CML_all" ionChannel="KAHP_CML" ion="k" erev="-84.69 mV"/>

<!--
<channelDensity condDensity="36.0 mS_per_cm2" id="KAHP_CML_all" ionChannel="KAHP_CML" ion="k" erev="-84.69 mV"/>
<channelDensity condDensity="3.8e-6 mS_per_cm2" id="KAHP_CML_all" ionChannel="KAHP_CML" ion="k" erev="-84.69 mV"/>

<channelDensity condDensity="32.0 mS_per_cm2" id="KV_CML_all" ionChannel="KV_CML" ion="k" erev="-84.69 mV"/>
<channelDensity condDensity="0.19 mS_per_cm2" id="NaP_CML_all" ionChannel="NaP_CML" ion="na" erev="87.39 mV"/>
<channelDensity condDensity="48.0 mS_per_cm2" id="NaT_CML_all" ionChannel="NaT_CML" ion="na" erev="87.39 mV"/>
<channelDensityNernst condDensity="0.46 mS_per_cm2" id="CaHVA_CML_all" ionChannel="CaHVA_CML" ion="ca"/>-->
<!--
-->


<spikeThresh value="0 mV"/>
Expand Down
Loading

0 comments on commit 1b97767

Please sign in to comment.