Transforming XML file: NeuroMLFiles/Examples/ChannelML/NaChannel_HH.xml using XSL file: NeuroMLFiles/Schemata/v1.8.1/Level2/ChannelML_v1.8.1_GENESIStab.xsl

View original file before transform

Converting the file: NaChannel_HH.xml

// This is a GENESIS script file generated from a ChannelML v1.8.1 file
// The ChannelML file is mapped onto a tabchannel object


// Units of ChannelML file: Physiological Units, units of GENESIS file generated: Physiological Units

/*
    ChannelML file containing a single Channel description
*/

function make_NaChannel

        /*
            Simple example of Na conductance in squid giant axon. Based on channel from Hodgkin and Huxley 1952

            Reference: A. L. Hodgkin and A. F. Huxley, A quantitative description of membrane current and
            its application to conduction and excitation in nerve, J. Physiol., vol. 117, pp. 500-544, 1952.
            Pubmed: http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?cmd=Retrieve&db=pubmed&dopt=Abstract&list_uids=12991237
        */
        

        str chanpath = "/library/NaChannel"

        if ({exists {chanpath}})
            return
        end
        
        create tabchannel {chanpath}
            

        setfield {chanpath} \
            Ek 50 \
            Ik 0 \
            Xpower 3 \
            Ypower 1
        
        setfield {chanpath} \
            Gbar 120 \
            Gk 0

        
        // No Q10 temperature adjustment found
        float temp_adj_m = 1
        float temp_adj_h = 1
    

        float tab_divs = 400
        float v_min = -100

        float v_max = 100

        float v, dv, i
            
        // Creating table for gate m, using name X for it here

        float dv = ({v_max} - {v_min})/{tab_divs}
            
        call {chanpath} TABCREATE X {tab_divs} {v_min} {v_max}
                
        v = {v_min}

            

        for (i = 0; i <= ({tab_divs}); i = i + 1)
            
            // Looking at rate: alpha
                
            float alpha
                
            float A, B, Vhalf
                         
            // ChannelML form of equation: alpha which is of form exp_linear, with params:
            // A = 1, B = 10, Vhalf = -40, in units: Physiological Units
            A = 1
            B = 10
            Vhalf = -40
            

            if ( {abs {(v - Vhalf)/ B}} < 1e-6)
                alpha = A * (1 + (v - Vhalf)/B/2)
            else
                alpha = A * ((v - Vhalf) / B) /(1 - {exp {-1 * (v - Vhalf)/B}})
            end

        
            // Looking at rate: beta
                
            float beta
                
            float A, B, Vhalf
                         
            // ChannelML form of equation: beta which is of form exponential, with params:
            // A = 4, B = -18, Vhalf = -65, in units: Physiological Units
            A = 4
            B = -18
            Vhalf = -65
            beta = A * {exp {(v - Vhalf) / B}}
        

            // Using the alpha and beta expressions to populate the tables

            float tau = 1/(temp_adj_m * (alpha + beta))
            
            setfield {chanpath} X_A->table[{i}] {temp_adj_m * alpha}
            setfield {chanpath} X_B->table[{i}] {temp_adj_m * (alpha + beta)}
                    
            v = v + dv

        end // end of for (i = 0; i <= ({tab_divs}); i = i + 1)
            
        setfield {chanpath} X_A->calc_mode 1 X_B->calc_mode 1
                    
        // Creating table for gate h, using name Y for it here

        float dv = ({v_max} - {v_min})/{tab_divs}
            
        call {chanpath} TABCREATE Y {tab_divs} {v_min} {v_max}
                
        v = {v_min}

            

        for (i = 0; i <= ({tab_divs}); i = i + 1)
            
            // Looking at rate: alpha
                
            float alpha
                
            float A, B, Vhalf
                         
            // ChannelML form of equation: alpha which is of form exponential, with params:
            // A = 0.07, B = -20, Vhalf = -65, in units: Physiological Units
            A = 0.07
            B = -20
            Vhalf = -65
            alpha = A * {exp {(v - Vhalf) / B}}
        
            // Looking at rate: beta
                
            float beta
                
            float A, B, Vhalf
                         
            // ChannelML form of equation: beta which is of form sigmoid, with params:
            // A = 1, B = -10, Vhalf = -35, in units: Physiological Units
            A = 1
            B = -10
            Vhalf = -35
            beta = A / ( {exp {(v - Vhalf) / B}} + 1)
        

            // Using the alpha and beta expressions to populate the tables

            float tau = 1/(temp_adj_h * (alpha + beta))
            
            setfield {chanpath} Y_A->table[{i}] {temp_adj_h * alpha}
            setfield {chanpath} Y_B->table[{i}] {temp_adj_h * (alpha + beta)}
                    
            v = v + dv

        end // end of for (i = 0; i <= ({tab_divs}); i = i + 1)
            
        setfield {chanpath} Y_A->calc_mode 1 Y_B->calc_mode 1
                    


end

Time to transform file: 0.068 secs