Mirror Neuron (Antunes et al 2017)

 Download zip file 
Help downloading and running models
Accession:229276
Modeling Mirror Neurons Through Spike-Timing Dependent Plasticity. This script reproduces Figure 3B.
Reference:
1 . Antunes G, Faria da Silva SF, Simoes de Souza FM (2018) Mirror Neurons Modeled Through Spike-Timing-Dependent Plasticity are Affected by Channelopathies Associated with Autism Spectrum Disorder. Int J Neural Syst 28:1750058 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Neuron or other electrically excitable cell;
Brain Region(s)/Organism: Neocortex;
Cell Type(s):
Channel(s): I Calcium; I M; I h; I Potassium; I Sodium;
Gap Junctions:
Receptor(s): AMPA; NMDA;
Gene(s): Cav1.2 CACNA1C; Cav1.3 CACNA1D;
Transmitter(s): Glutamate;
Simulation Environment: NEURON;
Model Concept(s): Detailed Neuronal Models; STDP;
Implementer(s): Simoes-de-Souza, Fabio [fabio.souza at ufabc.edu.br];
Search NeuronDB for information about:  AMPA; NMDA; I M; I h; I Sodium; I Calcium; I Potassium; Glutamate;
/
Final
hoc_recordings
mechanisms
morphology
python_recordings
synapses
README
.provenance.json
biophysics.hoc
cellinfo.json
CHANGELOG
constants.hoc *
creategui.hoc
createsimulation.hoc
current_amps.dat
init_super.hoc
LICENSE *
morphology.hoc
mosinit.hoc
ringplot.hoc *
run.py
run_hoc.sh
run_RmpRiTau.py
template.hoc
VERSION
                            
/* Copyright (c) 2015 EPFL-BBP, All rights reserved.                             
                                                                                 
THIS SOFTWARE IS PROVIDED BY THE BLUE BRAIN PROJECT ``AS IS''                    
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,            
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR           
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE BLUE BRAIN PROJECT                 
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR           
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF             
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR                  
BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,            
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE             
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN           
IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                                    
                                                                                 
This work is licensed under a 
Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
To view a copy of this license, visit 
http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode or send a letter to 
Creative Commons, 171 Second Street, Suite 300, 
San Francisco, California, 94105, USA.                 
*/      

/*                                                                               
 * @file template.hoc                                                           
 * @brief Main cell template of the simulation                                
 * @author James King, Werner Van Geit @ BBP                                                 
 * @date 2015                                                                    
*/        

//modified by Fabio Simoes de Souza @ UFABC, 2016


load_file("morphology.hoc")
load_file("biophysics.hoc")
load_file("synapses/synapses.hoc")

/** Main cell template */
begintemplate cADpyr232_L5_TTPC1_b6836fcf6f
  public init
  public soma, dend, apic, axon
  public all, somatic, apical, axonal, basal
  public nSecSoma, nSecApical, nSecBasal, nSecAxonal, nSecAll, nSecAxonalOrig
  public SecSyn, distribute_channels
  public morphology, synapses
  public re_init_rng

  objref SecSyn, this
  objref all, somatic, apical, axonal, basal
  objref synapses
  strdef tstr
  objref rngList, rng

//Fabio´s Stuff
  public nclist
  objectvar nclist
  public sinapse0,sinapse1,sinapse2
  objectvar sinapse0[1],sinapse1[1],sinapse2[1]
  public randomseed
  public spiketimes, spikecount, voltagem
  objref spiketimes, spikecount, voltagem
  public x, y, z, position
  public gsyn0, gsyn1, psyn0, psyn1
  objref gsyn0, gsyn1, psyn0, psyn1
  public nc
  objref nc

/** Constructor 

    Arguments: 
        synapse_enabled: 0 or 1, switch to disable/enable synapses
*/
proc init() { local synapses_enabled
    synapses_enabled = $1

	nclist=new List() //Fabio´s Stuff
	randomseed = $2 //Fabio´s Stuff
	spiketimes=new Vector() //Fabio´s Stuff
	lastspikecount=0 //Fabio´s Stuff
	voltagem=new Vector() //Fabio´s Stuff
	x=y=z=0 //only change via position
     gsyn0=new Vector()
     gsyn1=new Vector()
     psyn0=new Vector()
     psyn1=new Vector()
     objref nc

    // Create sectionlists to contain all the zones in the cell
	all = new SectionList()
	somatic = new SectionList()
	basal = new SectionList()
	apical = new SectionList()
	axonal = new SectionList()

    // Make sure we start from a clean sheet
	forall delete_section()

    // Load the morphology
    load_morphology()

    // Set the number of compartments per section (2 per 40 mum)
    geom_nseg(40)

    // Initialise the biophysics 
    biophys()

    
    forsec this.all {
        if(diam == 0){
          diam =  1
          printf("Error : Morphology problem with section [%s] 0 diam \n", \
                secname())
        }
    }

    // Initialise synapses if requested
    if (synapses_enabled == 1) {
        load_synapses(randomseed)
    }
    
}


create soma[1], dend[1], apic[1], axon[1]


//Fabio´s stuff
proc position() {local i
  access soma 
for i = 0, n3d()-1 {
    pt3dchange(i, $1-x+x3d(i), $2-y+y3d(i), $3-z+z3d(i), diam3d(i))
  }
  x = $1  y = $2  z = $3
}


/** Iterate over the section and compute how many segments should be allocate 
    to each. 

    Arguments:
        chunkSize: int, for every chunkSize length at 2 compartments, default 40 
*/                                                                             
proc geom_nseg() { local secIndex, chunkSize                              
    chunkSize = 40                                                              
    if( numarg() > 0 ) {                                                        
        chunkSize = $1                                                          
    }                                                                           
    soma area(.5) // make sure diam reflects 3d points                          
    secIndex=0                                                                  
    forsec all {                                                                
        nseg = 1 + 2*int(L/chunkSize)                                           
        secIndex = secIndex+1                                                   
    }                                                                           
}        

/** Initialise biophysics */                                                                             
proc biophys() {localobj bp
    // Replace the axon with a stub axon
    replace_axon()
    
    // Initialise distance function to soma
    access soma
    distance()

    // Run the biophysics function from the template
    bp = new cADpyr232_biophys()
    bp.biophys(this)
}

/** Load the morphology */                                                                             
proc load_morphology() {localobj m
    m = new morphology_b6836fcf6f()
    m.morphology(this)
}

/** Load the synapses */                                                                             
proc load_synapses() { local randomseed
    randomseed = $1
    synapses = new synapses_b6836fcf6f(randomseed)
    synapses.load_synapses(this)
}


/** Replace the axon built from the original morphology file with a stub axon.  
    The stub axon will attempt to use diam info from original axon and L=30.                                                                                
*/                                                                             
proc replace_axon(){ local nSec, D1, D2, dist, count                     
                                                                                
    // preserve the number of original axonal sections                          
    nSec  = 0                                                                   
    forsec axonal{nSec = nSec + 1}                                              
                                                                                
    // Try to grab info from original axon                                      
    if (nSec == 0) { //No axon section present                                    
        D1 = D2 = 1                                                             
    } else {                                                                    
        access axon[0]                                                          
        D1 = D2 = diam                                                          
        if( nSec > 1 ) { //More than one axon section present                    
            access soma distance() //to calculate distance from soma            
            count = 0 
            // loop through all axon sections and check for 60um distance
            forsec axonal {
                count = count + 1                                               
                dist = distance(0.5)
                // if section is longer than 60um then store diam 
                // and exit from loop                                            
                if( dist > 60 ) { 
                    D2 = diam                                                   
                    break                                                       
                }                                                               
            }                                                                   
        }                                                                       
    }                                                                           
                                                                                
    // Delete old axon                                                  
    forsec axonal{delete_section()}
    
    // And create new one                                             
    execute1("create axon[2]\n", this)                                          
                                                                                
    // Set dimensions of new axon, and append sections to sectionlists
    access axon[0] {                                                            
        L = 30                                                              
        diam = D1                                                           
        nseg = 1 + 2*int(L/40)                                              
        all.append()                                                            
        axonal.append()                                                         
    }                            
    access axon[1] {                                                            
        L = 30                                                                  
        diam = D2                                                           
        nseg = 1 + 2*int(L/40)                                              
        all.append()                                                            
        axonal.append()                                                         
    }                                                                           
    nSecAxonal = 2                                                              
        
    // Connect sections to each other and to soma
    soma[0] connect axon[0](0), 1                                           
    axon[0] connect axon[1](0), 1
    access soma                                                	
}                 


/** (Re)initialise random number generators for stochastic channels

    Arguments:
        gid: int, global identifier of the cell
*/
proc re_init_rng() {local channelID
    objref rng
    rngList = new List()
    channelID = 0

    forsec this.somatic {
        for (x, 0) {
            // Initialise the random number generator
            rng = new Random()
            // Set the seeds to a value that depends on the gid of the cell
            // and the channelid within the cell
            rng.MCellRan4( channelID*10000+100, $1*10000+250+1 )
            channelID = channelID + 1
            // Set to uniform distribution
            rng.uniform(0,1)

            // Pass rng to stochastic channel
            setdata_StochKv(x)
            setRNG_StochKv(rng)

            // Store the rngs in a list for persistency
            rngList.append(rng)
        }
    }

    forsec this.basal {
        for (x, 0) {
            rng = new Random()
            rng.MCellRan4( channelID*10000+100, $1*10000+250+1 )
            channelID = channelID + 1
            rng.uniform(0,1)
            setdata_StochKv(x)
            setRNG_StochKv(rng)
            rngList.append(rng)
        }
    }

    forsec this.apical {
        for (x, 0) {
            rng = new Random()
            rng.MCellRan4( channelID*10000+100, $1*10000+250+1 )
            channelID = channelID + 1
            rng.uniform(0,1)
            setdata_StochKv(x)
            setRNG_StochKv(rng)
            rngList.append(rng)
        }
    }
}


endtemplate cADpyr232_L5_TTPC1_b6836fcf6f

Loading data, please wait...