File: functions.g

package info (click to toggle)
genesis 2.1-1.1
  • links: PTS
  • area: main
  • in suites: potato
  • size: 14,288 kB
  • ctags: 10,667
  • sloc: ansic: 111,959; makefile: 2,240; yacc: 1,797; lex: 976; csh: 54; sh: 13
file content (72 lines) | stat: -rw-r--r-- 1,774 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
//genesis

// =================================
//      link in a new compartment
// =================================
function link_compartment
    addmsg $1 $2 RAXIAL Ra previous_state
    addmsg $2 $1 AXIAL previous_state
end

// =================================
//      link in a new channel
// =================================
function link_channel(chan, comp)
    addmsg {chan} {comp} CHANNEL Gk Ek
    addmsg {comp} {chan} VOLTAGE Vm
end

function singlelink_channel(chan, comp)
    addmsg {chan} {comp} CHANNEL Gk Ek
end

function link_hhchannel(chan, comp)
    addmsg {chan} {comp} CHANNEL Gk Ek
    addmsg {comp} {chan} VOLTAGE Vm
    addmsg {comp} {chan} EREST Erest
end

// =================================
//   somatic current injection (uA)
// =================================
function inject(neuron, value)
str neuron
float value
    setfield {neuron}/soma inject value
end

// =================================
//   modify spike output based on 
//   integration step to give constant 
//   impulse area
// =================================
function adjustspike
    setfield /##[TYPE=spike] output_amp {1.0/{getclock 0}}
    //    echo SPIKE:  {1.0/getclock(0)}
end

// =================================
//   sets baseline LOT input rates
// =================================
function baseline(min, max, rate)
    float min, max, rate
    str path

    path = "/bulb/mitral[]/input"
    setfield {path} min_amp {min} max_amp {max} rate {rate}
end

// =================================
//   simulate shock to the LOT
// =================================
function shock(value)
str path
float value
float oldrate, oldmin, oldmax
    // shock
    baseline {value} {value} 1000
    step 1
    // baseline 0.05 0.1 0.4		// 400 Hz noise
    baseline 0 0 0
end