Multiscale simulation of the striatal medium spiny neuron (Mattioni & Le Novere 2013)

 Download zip file   Auto-launch 
Help downloading and running models
"… We present a new event-driven algorithm to synchronize different neuronal models, which decreases computational time and avoids superfluous synchronizations. The algorithm is implemented in the TimeScales framework. We demonstrate its use by simulating a new multiscale model of the Medium Spiny Neuron of the Neostriatum. The model comprises over a thousand dendritic spines, where the electrical model interacts with the respective instances of a biochemical model. Our results show that a multiscale model is able to exhibit changes of synaptic plasticity as a result of the interaction between electrical and biochemical signaling. …"
1 . Mattioni M, Le Novère N (2013) Integration of biochemical and electrical signaling-multiscale model of the medium spiny neuron of the striatum. PLoS One 8:e66811 [PubMed]
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Neuron or other electrically excitable cell; Synapse;
Brain Region(s)/Organism: Striatum;
Cell Type(s): Neostriatum medium spiny direct pathway GABA cell;
Channel(s): I Na,p; I Na,t; I T low threshold; I A; I K,Ca; I CAN; I Calcium; I A, slow; I Krp; I R; I Q;
Gap Junctions:
Gene(s): Kv4.2 KCND2; Kv1.2 KCNA2; Cav1.3 CACNA1D; Cav1.2 CACNA1C; Kv2.1 KCNB1;
Simulation Environment: NEURON; Python;
Model Concept(s): Synaptic Plasticity; Signaling pathways; Calcium dynamics; Multiscale;
Implementer(s): Mattioni, Michele [mattioni at];
Search NeuronDB for information about:  Neostriatum medium spiny direct pathway GABA cell; I Na,p; I Na,t; I T low threshold; I A; I K,Ca; I CAN; I Calcium; I A, slow; I Krp; I R; I Q;
# Author Michele Mattioni
# Fri Jan 30 15:57:01 GMT 2009

import ecell.Session as Session
#import mySession as Session
import ecell.ecs
import ecell.config
import ecell.emc
import os
import numpy
from sumatra.external.NeuroTools import parameters

class EcellManager():
    """Control and instatiate the ecell simulator embedding it in an handy python object"""
    def __init__(self, filename=None):
        ecell.ecs.setDMSearchPath( os.pathsep.join( ecell.config.dm_path ) )
        self.sim = ecell.emc.Simulator()
        if ecell.config.version < '3.2.0':
   = Session.Session(self.sim, changeDirectory=False)
   = Session.Session(self.sim)
        # Load the model
        self.molToTrack = ('ca',
                           'PP1abar', # Active PP1/Total PP1
                           'AMPAR', # 
        # Tracking the calcium = 'Variable:/Spine:ca' )
        self.CaMKIIbar = 'Variable:/Spine:CaMKIIbar' )
        self.ampar_P ='Variable:/Spine:AMPAR_P')
        self.ca_in ='Process:/Spine:ca_in')
        self.ca_leak ='Process:/Spine:ca_leak')
        self.ca_pump ='Process:/Spine:ca_pump')
    def createLoggers(self):
        """Create the logger to track the species"""
        loggers = {}
        #log = ecell.LoggerStub()
        for mol in self.molToTrack:
            loggers[mol]  = "Variable:/Spine:" + mol 
                                                       + ":Value" )
            loggers[mol].create() # This creat the Logger Object in the backend
            if mol == 'ca':
                loggers['ca_conc']  = "Variable:/Spine:" + mol 
                                                       + ":MolarConc" )
                loggers['ca_conc'].create() # This creat the Logger Object in the backend
        self.loggers = loggers
    def calcWeight(CaMKIIbar, PP2Bbar, alpha, beta, n=3, k=0.5):
        """Calc the weight of the synapses according to the CaMKII and Pospahtases
        PP2B and PP1"""
        # CaMKII term
        CaMKII_factor = math.pow(CaMKIIbar, n) / (math.pow(k, n) + 
                                                  math.pow(CaMKIIbar, n))
        Phosphatase_factor = math.pow(PP2Bbar, n) / (math.pow(k, n) + 
                                                     math.pow(PP2Bbar, n))
        scaled_CaMKII_factor = alpha * CaMKII_factor
        scaled_Phospatese_factor = beta * Phosphatase_factor 
        weight = 1 + scaled_CaMKII_factor - scaled_Phospatese_factor
        s = "Weight: %s CaMKII factor %s, Phosphatase factor %s" %(weight,
        return weight
    def calcium_peak(self, k_value, duration):
        Mimic the calcium peak
            k_value: the rate of calcium to enter
            duration: Duration of the spike
        basal = self.ca_in['k']
        self.ca_in['k'] = k_value
        self.ca_in['k'] = basal
    def calciumTrain(self, spikes=30, interval=0.1):
        """Create a train of calcium with the specified number of spikes and interval
            spikes: number of spikes
            interval: Interval between spikes
        for i in range(spikes):
            self.calcium_peak(4.0e8, # Magic number from Lu
                         0.00001 #Really fast spike to avoid the overlap
    def converToTimeCourses(self):
        timeCourses = {}
        for key in self.loggers:
            timeCourses[key] = self.loggers[key].getData()
        self.timeCourses = timeCourses

# Testing method

def testCalciumTrain(spikes_number, interval, filename):
    """Run a test simulation wit a train of calcium input"""
    print "Test the results of a train of calcium"""
    ecellManager = EcellManager(filename)
    #ecellManager.ca_in ='Process:/Spine:ca_in')
    print "Model loaded, loggers created. Integration start."
    print "Calcium Train"
    ecellManager.calciumTrain(spikes=spikes_number, interval=interval)
    print "CalciumTrain Test Concluded\n##################"
    return ecellManager

def testChangeCalciumValue(interval, caValue, filename="../biochemical_circuits/biomd183_noCalcium.eml"):
    """Run a test simulation changing the calcium value on the fly"""
    print "Show case of the possibilities to change the level of calcium on the fly"
    ecellManager = EcellManager(filename)
    print "Loggers created"
    print "Running with the updating interval of : %f" %interval
    tstop = 150
    while( < tstop):['Value'] = caValue
    print "immision of Calcium"
    print "Value of Calcium %f"'Value')
    spikes = 4
    for i in range(spikes):['Value'] = 7200['Value'] = caValue
    tstop = tstop+500
    while( < tstop):['Value'] = caValue
    print "ChangeCalciumValue Test Concluded"
    return ecellManager
if __name__ == "__main__":
    import sys
    if len(sys.argv) != 2:
        print("No parameter file supplied. Abort.")
        usage = 'python ecellControl.param'
        print usage
    parameter_file = sys.argv[1]
    param = parameters.ParameterSet(parameter_file)
    ## Setting the mat plotlib backend
    import matplotlib
    if param['interactive'] == False:
        print "Switching backend to Agg. Batch execution"
    import matplotlib.pyplot as plt
    from helpers.plotter import EcellPlotter
    import helpers
    loader = helpers.Loader()

#    ecellManager = testChangeCalciumValue(interval, caValue)
    if param['running_type'] == 'train':
        ecellManager = testCalciumTrain(param['num_spikes'],

    ecp = EcellPlotter()
    if param['interactive'] == False:
        dir = loader.create_new_dir(prefix=os.getcwd()),  dir, "timeCourses")
        ecp.plot_timeCourses(ecellManager.timeCourses, save=True, dir=dir)
        ecp.plot_weight(ecellManager.timeCourses, dir=dir)