diff --git a/docs/user/GUI/Kkit12Documentation.rst b/docs/user/GUI/Kkit12Documentation.rst deleted file mode 100644 index 2b6b142a4e8d14c0438b4dda4528a8ecf41de984..0000000000000000000000000000000000000000 --- a/docs/user/GUI/Kkit12Documentation.rst +++ /dev/null @@ -1,491 +0,0 @@ --------------- - -Kinetikit 12: Interface for chemical kinetic models in MOOSEGUI -=============================================================== - -Upinder Bhalla, Harsha Rani - -Feb 25 2016. - --------------- - -- `Introduction <#introduction>`_ - -- `**TODO** What are chemical kinetic - models? <#todo-what-are-chemical-kinetic-models>`_ - - - `Levels of model <#levels-of-model>`_ - - `Numerical methods <#numerical-methods>`_ - -- `Using Kinetikit 12 <#using-kinetikit-12>`_ - - - `Overview <#overview>`_ - - `Model layout and icons <#model-layout-and-icons>`_ - - - `Compartment <#compartment>`_ - - `Pool <#pool>`_ - - `Buffered pools <#buffered-pools>`_ - - `Reaction <#reaction>`_ - - `Mass-action enzymes <#mass-action-enzymes>`_ - - `Michaelis-Menten Enzymes <#michaelis-menten-enzymes>`_ - - `Function <#function>`_ - - - `Model operations <#model-operations>`_ - - `Model Building <#model-building>`_ - -`Introduction <#TOC>`_ ----------------------- - -Kinetikit 12 is a graphical interface for doing chemical kinetic -modeling in MOOSE. It is derived in part from Kinetikit, which was the -graphical interface used in GENESIS for similar models. Kinetikit, also -known as kkit, was at version 11 with GENESIS. Here we start with -Kinetikit 12. - -`**TODO** What are chemical kinetic models? <#TOC>`_ ----------------------------------------------------- - -Much of neuronal computation occurs through chemical signaling. For -example, many forms of synaptic plasticity begin with calcium influx -into the synapse, followed by calcium binding to calmodulin, and then -calmodulin activation of numerous enzymes. These events can be -represented in chemical terms: - - 4 Ca2+ + CaM <===> Ca4.CaM - -Such chemical equations can be modeled through standard Ordinary -Differential Equations, if we ignore space: - - d[Ca]/dt = −4Kf ∗ [Ca]4 ∗ [CaM] + 4Kb ∗ [Ca4.CaM] d[CaM]/dt = −Kf ∗ - [Ca]4 ∗ [CaM] + Kb ∗ [Ca4.CaM] d[Ca4.CaM]/dt = Kf ∗ [Ca]4 ∗ [CaM] − - Kb ∗ [Ca4.CaM] - -MOOSE models these chemical systems. This help document describes how to -do such modelling using the graphical interface, Kinetikit 12. - -`Levels of model <#TOC>`_ -~~~~~~~~~~~~~~~~~~~~~~~~~ - -Chemical kinetic models can be simple well-stirred (or point) models, or -they could have multiple interacting compartments, or they could include -space explicitly using reaction-diffusion. In addition such models could -be solved either deterministically, or using a stochastic formulation. -At present Kinetikit handles compartmental models but does not compute -diffusion within the compartments, though MOOSE itself can do this at -the script level. Kkit12 will do deterministic as well as stochastic -chemical calculations. - -`Numerical methods <#TOC>`_ -~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- **Deterministic**: Adaptive timestep 5th order Runge-Kutta-Fehlberg - from the GSL (GNU Scientific Library). -- **Stochastic**: Optimized Gillespie Stochastic Systems Algorithm, - custom implementation. - -`Using Kinetikit 12 <#TOC>`_ ----------------------------- - -`Overview <#TOC>`_ -~~~~~~~~~~~~~~~~~~ - -- Load models using **``File -> Load model``**. A reaction schematic - for the chemical system appears in the **``Editor view``** tab. -- View parameters in **``Editor view``** tab by clicking on icons, and - looking at entries in **``Properties``** table to the right. -- Edit parameters by changing their values in the **``Properties``** - table. -- From Run View, Pools can be plotted by clicking on their icons and - dragging the icons onto the plot Window. Presently only concentration - is plottable. -- Run models using **``Run``** button. -- Select numerical method using options under **``Preferences``** - button in simulation control. -- Save plots using the icons at the bottom of the **``Plot Window``**. - -Most of these operations are detailed in other sections, and are shared -with other aspects of the MOOSE simulation interface. Here we focus on -the Kinetikit-specific items. - -`Model layout and icons <#TOC>`_ -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -When you are in the **``Model View``** (``Editor``) tab you will see a collection of -icons, arrows, and grey boxes surrounding these. This is a schematic of -the reaction scheme being modeled. You can view and change parameters, -and change the layout of the model. - -.. figure:: ../../images/Moose1.png - :align: center - :alt: - -Resizing the model layout and icons: - -- **Zoom**: Comma and period keys. Alternatively, the mouse scroll - wheel or vertical scroll line on the track pad will cause the display - to zoom in and out. -- **Pan**: The arrow keys move the display left, right, up, and down. -- **Entire Model View**: Pressing the **``a``** key will fit the entire - model into the entire field of view. -- **Resize Icons**: Angle bracket keys, that is, **``<``** and - **``>``** or **``+``** and **``-``**. This resizes the icons while - leaving their positions on the screen layout more or less the same. -- **Original Model View**: Presing the **``A``** key (capital ``A``) - will revert to the original model view including the original icon - scaling. - -`Compartment <#TOC>`_ -^^^^^^^^^^^^^^^^^^^^^ - -The *compartment* in moose is usually a contiguous domain in which a -certain set of chemical reactions and molecular species occur. The -definition is very closely related to that of a cell-biological -compartment. Examples include the extracellular space, the cell -membrane, the cytosol, and the nucleus. Compartments can be nested, but -of course you cannot put a bigger compartment into a smaller one. - -- **Icon**: Grey boundary around a set of reactions. -- **Moving Compartments**: Click and drag on the boundary. -- **Resizing Compartment boundary**: Happens automatically when - contents are repositioned, so that the boundary just contains - contents. -- **Compartment editable parameters**: - - - **``name``**: The name of the compartment. - - **``size``**: This is the volume, surface area or length of the - compartment, depending on its type. - -- **Compartment fixed parameters**: - - - **``numDimensions``**: This specifies whether the compartment is a - volume, a 2-D surface, or if it is just being represented as a - length. - -`Pool <#TOC>`_ -^^^^^^^^^^^^^^ - -This is the set of molecules of a given species within a compartment. -Different chemical states of the same molecule are in different pools. - -- **Icon**: |image0| Colored rectangle with pool name in it. -- **Moving pools**: Click and drag. -- **Pool editable parameters**: - - - **``name``**: Name of the pool - - **``n``**: Number of molecules in the pool - - **``nInit``**: Initial number of molecules in the pool. ``n`` gets - set to this value when the ``reinit`` operation is done. - - **``conc``**: Concentration of the molecules in the pool. - - conc = n \* unit\_scale\_factor / (NA \* vol) - - - **``concInit``**: Initial concentration of the molecules in the - pool. - - concInit = nInit \* unit\_scale\_factor / (NA \* vol) ``conc`` - is set to this value when the ``reinit`` operation is done. - -- **Pool fixed parameters** - - - **``size``**: Derived from the compartment that holds the pool. - Specifies volume, surface area or length of the holding - compartment. - -`Buffered pools <#TOC>`_ -^^^^^^^^^^^^^^^^^^^^^^^^ - -Some pools are set to a fixed ``n``, that is number of molecules, and -therefore a fixed concentration, throughout a simulation. These are -buffered pools. - -- **Icon**: |image1| Colored rectangle with pool name in it. -- **Moving Buffered pools**: Click and drag. -- **Buffered Pool editable parameters** - - - **``name``**: Name of the pool - - **``nInit``**: Fixed number of molecules in the pool. ``n`` gets - set to this value throughout the run. - - **``concInit``**: Fixed concentration of the molecules in the - pool. - - concInit = nInit \* unit\_scale\_factor / (NA \* vol) ``conc`` - is set to this value throughout the run. - -- **Pool fixed parameters**: - - - **``n``**: Number of molecules in the pool. Derived from - ``nInit``. - - **``conc``**: Concentration of molecules in the pool. Derived from - ``concInit``. - - **``size``**: Derived from the compartment that holds the pool. - Specifies volume, surface area or length of the holding - compartment. - -`Reaction <#TOC>`_ -^^^^^^^^^^^^^^^^^^ - -These are conversion reactions between sets of pools. They are -reversible, but you can set either of the rates to zero to get -irreversibility. In the illustration below, **``D``** and **``A``** are -substrates, and **``B``** is the product of the reaction. This is -indicated by the direction of the green arrow. - -.. figure:: ../../images/KkitReaction.png - :align: center - :alt: - -- **Icon**: |image2| Reversible reaction arrow. -- **Moving Reactions**: Click and drag. -- **Reaction editable parameters**: - - - name : Name of reaction - - K\ :sub:`f`\ : Forward rate of reaction, in - ``concentration/time`` units. This is the normal way to express - and manipulate the reaction rate. - - k\ :sub:`f`\ : Forward rate of reaction, in ``number/time`` - units. This is used internally for computations, but is - volume-dependent and should not be used to manipulate the reaction - rate unless you really know what you are doing. - - K\ :sub:`b`\ : Backward rate of reaction, in - ``concentration/time`` units. This is the normal way to express - and manipulate the reaction rate. - - k\ :sub:`b`\ : Backward rate of reaction, in ``number/time`` - units. This is used internally for computations, but is - volume-dependent and should not be used to manipulate the reaction - rate unless you really know what you are doing. - -- **Reaction fixed parameters**: - - - **numProducts**: Number of product molecules. - - **numSubstrates**: Number of substrates molecules. - -`Mass-action enzymes <#TOC>`_ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -These are enzymes that model the chemical equations - - E + S <===> E.S -> E + P - -Note that the second reaction is irreversible. Note also that -mass-action enzymes include a pool to represent the **``E.S``** -(enzyme-substrate) complex. In the example below, the enzyme pool is -named **``MassActionEnz``**, the substrate is **``C``**, and the product -is **``E``**. The direction of the enzyme reaction is indicated by the -red arrows. - -.. figure:: ../../images/MassActionEnzReac.png - :align: center - :alt: - -- **Icon**: |image3| Colored ellipse atop a small square. The ellipse - represents the enzyme. The small square represents **``E.S``**, the - enzyme-substrate complex. The ellipse icon has the same color as the - enzyme pool **``E``**. It is connected to the enzyme pool **``E``** - with a straight line of the same color. - - The ellipse icon sits on a continuous, typically curved arrow in red, - from the substrate to the product. - - A given enzyme pool can have any number of enzyme activities, since - the same enzyme might catalyze many reactions. - -- **Moving Enzymes**: Click and drag on the ellipse. -- **Enzyme editable parameters** - - - name : Name of enzyme. - - K\ :sub:`m`\ : Michaelis-Menten value for enzyme, in - ``concentration`` units. - - k\ :sub:`cat`\ : Production rate of enzyme, in ``1/time`` units. - Equal to k\ :sub:`3`\ , the rate of the second, irreversible - reaction. - - k\ :sub:`1`\ : Forward rate of the **E+S** reaction, in number - and ``1/time`` units. This is what is used in the internal - calculations. - - k\ :sub:`2`\ : Backward rate of the **E+S** reaction, in - ``1/time`` units. Used in internal calculations. - - k\ :sub:`3`\ : Forward rate of the **E.S -> E + P** reaction, in - ``1/time`` units. Equivalent to k\ :sub:`cat`\ . Used in internal - calculations. - - ratio: This is equal to k\ :sub:`2`\ /k\ :sub:`3`\ . Needed to - define the internal rates in terms of K\ :sub:`m`\ and - k\ :sub:`cat`\ . I usually use a value of 4. - -- **Enzyme-substrate-complex editable parameters**: These are identical - to those of any other pool. - - - **name**: Name of the **``E.S``** complex. Defaults to - **``<enzymeName>_cplx``**. - - **n**: Number of molecules in the pool - - **nInit**: Initial number of molecules in the complex. ``n`` gets - set to this value when the ``reinit`` operation is done. - - **conc**: Concentration of the molecules in the pool. - - conc = n \* unit\_scale\_factor / (NA \* vol) - - - **``concInit``**: Initial concentration of the molecules in the - pool. - - concInit = nInit \* unit\_scale\_factor / (NA \* vol) ``conc`` - is set to this value when the ``reinit`` operation is done. - -- **Enzyme-substrate-complex fixed parameters**: - - - **size**: Derived from the compartment that holds the pool. - Specifies volume, surface area or length of the holding - compartment. Note that the Enzyme-substrate-complex is assumed to - be in the same compartment as the enzyme molecule. - -`Michaelis-Menten Enzymes <#TOC>`_ -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -These are enzymes that obey the Michaelis-Menten equation - - V = Vmax \* [S] / ( Km + [S] ) = kcat \* [Etot] \* [S] / ( Km + [S] - ) - -where - -- V\ :sub:`max`\ is the maximum rate of the enzyme -- [Etot] is the total amount of the enzyme -- K\ :sub:`m`\ is the Michaelis-Menten constant -- S is the substrate. - -Nominally these enzymes model the same chemical equation as the -mass-action enzyme: - - E + S <===> E.S -> E + P - -but they make the assumption that the **``E.S``** is in a -quasi-steady-state with **``E``** and **``S``**, and they also ignore -sequestration of the enzyme into the complex. So there is no -representation of the **``E.S``** complex. In the example below, the -enzyme pool is named **``MM_Enz``**, the substrate is **``E``**, and the -product is **``F``**. The direction of the enzyme reaction is indicated -by the red arrows. - -.. figure:: ../../images/MM_EnzReac.png - :align: center - :alt: - -- **Icon**: |image4| Colored ellipse. The ellipse represents the enzyme - The ellipse icon has the same color as the enzyme **``MM_Enz``**. It - is connected to the enzyme pool **``MM_Enz``** with a straight line - of the same color. The ellipse icon sits on a continuous, typically - curved arrow in red, from the substrate to the product. A given - enzyme pool can have any number of enzyme activities, since the same - enzyme might catalyze many reactions. -- **Moving Enzymes**: Click and drag. -- **Enzyme editable parameters**: - - - name: Name of enzyme. - - K\ :sub:`m`\ : Michaelis-Menten value for enzyme, in - ``concentration`` units. - - k\ :sub:`cat`\ : Production rate of enzyme, in ``1/time`` units. - Equal to k\ :sub:`3`\ , the rate of the second, irreversible - reaction. - -`Function <#TOC>`_ -^^^^^^^^^^^^^^^^^^ - -Function objects can be used to evaluate expressions with arbitrary -number of variables and constants. We can assign expression of the form: - -f(c0, c1, ..., cM, x0, x1, ..., xN, y0,..., yP ) - -where ci‘s are constants and xi‘s and yi‘s are variables. - -It can parse mathematical expression defining a function and evaluate it -and/or its derivative for specified variable values. The variables can -be input from other moose objects. In case of arbitrary variable names, -the source message must have the variable name as the first argument. - -- **Icon**: Colored rectangle with pool name. This is **``ƒ``** in the - example image below. The input pools **``A``** and **``B``** connect - to the **ƒ** with blue arrows. The function ouput's to BuffPool - -`Model operations <#TOC>`_ -~~~~~~~~~~~~~~~~~~~~~~~~~~ - -- **Loading models**: **``File -> Load Model -> select from dialog``**. - This operation makes the previously loaded model disable and loads - newly selected models in **``Model View``** -- **New**: **``File -> New -> Model name``**. This opens a empty widget - for model building -- **Saving models**: **``File -> Save Model -> select from dialog``**. -- **Changing numerical methods**: **``Preference->Chemical tab``** item - from Simulation Control. Currently supports: - - - Runge Kutta: This is the Runge-Kutta-Fehlberg implementation from - the GNU Scientific Library (GSL). It is a fifth order variable - timestep explicit method. Works well for most reaction systems - except if they have very stiff reactions. - - Gillespie: Optimized Gillespie stochastic systems algorithm, - custom implementation. This uses variable timesteps internally. - Note that it slows down with increasing numbers of molecules in - each pool. It also slows down, but not so badly, if the number of - reactions goes up. - - Exponential Euler:This methods computes the solution of partial - and ordinary differential equations. - -`Model building <#TOC>`_ -~~~~~~~~~~~~~~~~~~~~~~~~ - -.. figure:: ../../images/chemical_CS.png - :align: center - :alt: - -- The Edit Widget includes various menu options and model icons on the - top.\* Use the mouse buttton to click and drag icons from toolbar to - Edit Widget, two things will happen, icon will appear in the editor - widget and a object editor will pop up with lots of parameters with - respect to moose object. Rules: - - :: - - * Firstly Compartment has to be created. - (At present only single compartment model is allowed) - - - Enzyme should be dropped on a pool as parent and function should - be dropped on buffPool for output - - - Drag in pool's and reaction on to the editor widget, now one can - set up a reaction.Click on mooseObject drag the mouse (a black dotted line for ExpectedConnection will appear) - to any object for connection. - E.g Pool to reaction and reaction to pool. Pool to function and function to Pool. - Specific connection type gets specific colored arrow. E.g. - Green color arrow for specifying connection between reactant and - product for reaction. Second order reaction can also be done by - repeating the connection over again - - Each connection can be deleted and using rubberband selection each moose object can be deleted - - When clicked on pool object 4 icons comes up - - |delete| : This deletes the object, its associated connection and if its enzyme's parent then enzyme and its associated connection is also deleted. - - |clone| : Clones the object - - |move| : Object can be moved around - - |plot| : Plot the object in plotWidget at Graph 1 - - Note: Missing icon means the operation is not permitted - -.. figure:: ../../images/Chemical_run.png - :align: center - :alt: - -- From run widget, pools are draggable to plot window for plotting. - (Currently **``conc``** is plotted as default field) Plots are - color-coded as per in model. -- Model can be run by clicking start button. One can stop button in - mid-stream and start up again without affectiong the calculations. - The reset button clears the simulation. - -.. |image0| image:: ../../images/Pool.png -.. |image1| image:: ../../images/BufPool.png -.. |image2| image:: ../../images/KkitReacIcon.png -.. |image3| image:: ../../images/MassActionEnzIcon.png -.. |image4| image:: ../../images/MM_EnzIcon.png -.. |delete| image:: ../../images/delete.png -.. |clone| image:: ../../images/clone.png -.. |move| image:: ../../images/move.png -.. |plot| image:: ../../images/plot.png \ No newline at end of file diff --git a/docs/user/GUI/MooseGuiDocs.rst b/docs/user/GUI/MooseGuiDocs.rst deleted file mode 100644 index d093bc49a03179eff08c5d01e16c2684af5bf164..0000000000000000000000000000000000000000 --- a/docs/user/GUI/MooseGuiDocs.rst +++ /dev/null @@ -1,256 +0,0 @@ --------------- - -**MOOSE GUI: Graphical interface for MOOSE** -============================================ - -Upinder Bhalla, Harsha Rani, Aviral Goel - -Aug 28 2013. - --------------- - -Contents --------- - -- `Introduction <#introduction>`_ -- `Interface <#interface>`_ - - - `Menu Bar <#menu-bar>`_ - - - `File <#menu-file>`_ - - - `New <#file-new>`_ - - `Load Model <#file-load-model>`_ - - `Connect BioModels <#file-connect-biomodels>`_ - - `Quit <#file-quit>`_ - - - `View <#menu-view>`_ - - - `Editor View <#editor-view>`_ - - `Run View <#run-view>`_ - - `Dock Widgets <#dock-widgets>`_ - - `SubWindows <#subwindows>`_ - - - `Help <#menu-help>`_ - - - `About MOOSE <#about-moose>`_ - - `Built-in Documentation <#built-in-documentation>`_ - - `Report a bug <#report-a-bug>`_ - - - `Editor View <#editor-view>`_ - - - `Model Editor <#model-editor>`_ - - `Property Editor <#property-editor>`_ - - - `Run View <#run-view>`_ - - - `Simulation Controls <#simulation-controls>`_ - - `Plot Widget <#plot-widget>`_ - - - `Toolbar <#plot-widget-toolbar>`_ - - `Context Menu <#plot-widget-context-menu>`_ - -Introduction ------------- - -The Moose GUI currently allow you work on -`chemical <Kkit12Documentation.html>`_ models using a interface. This -document describes the salient features of the GUI - -Interface ---------- - -The interface layout consists of a `menu bar <#menu-bar>`_ and two -views, `editor view <#editor-view>`_ and `run view <#run-view>`_. - -Menu Bar -~~~~~~~~ - -.. figure:: ../../images/MooseGuiMenuImage.png - :align: center - :alt: - -The menu bar appears at the top of the main window. In Ubuntu 12.04, the -menu bar appears only when the mouse is in the top menu strip of the -screen. It consists of the following options - - -File -^^^^ - -The File menu option provides the following sub options - - -- `New <#file-new>`_ - Create a new chemical signalling model. -- `Load Model <#file-load-model>`_ - Load a chemical signalling or - compartmental neuronal model from a file. -- `Paper\_2015\_Demos Model <#paper-2015-demos-model>`_ - Loads and - Runs chemical signalling or compartmental neuronal model from a file. -- `Recently Loaded Models <#recently-loaded-models>`_ - List of models - loaded in MOOSE. (Atleast one model should be loaded) -- `Connect BioModels <#file-connect-biomodels>`_ - Load chemical - signaling models from the BioModels database. -- `Save <#file-quit>`_ - Saves chemical model to Genesis/SBML format. -- `Quit <#file-quit>`_ - Quit the interface. - -View -^^^^ - -View menu option provides the following sub options - - -- `Editor View <#editor-view>`_ - Switch to the editor view for editing - models. -- `Run View <#run-view>`_ - Switch to run view for running models. -- `Dock Widgets <#dock-widgets>`_ - Following dock widgets are provided - - - - - `Python <#dock-widget-python>`_ - Brings up a full fledged python - interpreter integrated with MOOSE GUI. You can interact with - loaded models and load new models through the PyMoose API. The - entire power of python language is accessible, as well as - MOOSE-specific functions and classes. - - `Edit <#dock-widget-edit>`_ - A property editor for viewing and - editing the fields of a selected object such as a pool, enzyme, - function or compartment. Editable field values can be changed by - clicking on them and overwriting the new values. Please be sure to - press enter once the editing is complete, in order to save your - changes. - -- `SubWindows <#subwindows>`_ - This allows you to tile or tabify the - run and editor views. - -Help -^^^^ - -- `About Moose <#about-moose>`_ - Version and general information about - MOOSE. -- `Built-in documentation <#butilt-in-documentation>`_ - Documentation - of MOOSE GUI. -- `Report a bug <#report-a-bug>`_ - Directs to the github bug tracker - for reporting bugs. - -Editor View -~~~~~~~~~~~ - -The editor view provides two windows - - -- `Model Editor <#model-editor>`_ - The model editor is a workspace to - edit and create models. Using click-and-drag from the icons in the - menu bar, you can create model entities such as chemical pools, - reactions, and so on. A click on any object brings its property - editor on screen (see below). In objects that can be interconnected, - a click also brings up a special arrow icon that is used to connect - objects together with messages. You can move objects around within - the edit window using click-and-drag. Finally, you can delete objects - by selecting one or more, and then choosing the delete option from - the pop-up menu. The links below is the screenshots point to the - details for the chemical signalling model editor. - -.. figure:: ../../images/ChemicalSignallingEditor.png - :align: center - :alt: Chemical Signalling Model Editor - - Chemical Signalling Model Editor - -- `Property Editor <#property-editor>`_ - The property editor provides - a way of viewing and editing the properties of objects selected in - the model editor. - -.. figure:: ../../images/PropertyEditor.png - :align: center - :alt: Property Editor - - Property Editor -Run View -~~~~~~~~ - -The Run view, as the name suggests, puts the GUI into a mode where the -model can be simulated. As a first step in this, you can click-and-drag -an object to the graph window in order to create a time-series plot for -that object. For example, in a chemical reaction, you could drag a pool -into the graph window and subsequent simulations will display a graph of -the concentration of the pool as a function of time. Within the Run View -window, the time-evolution of the simulation is displayed as an -animation. For chemical kinetic models, the size of the icons for -reactant pools scale to indicate concentration. Above the Run View -window, there is a special tool bar with a set of simulation controls to -run the simulation. - -Simulation Controls -^^^^^^^^^^^^^^^^^^^ - -.. figure:: ../../images/SimulationControl.png - :align: center - :alt: Simulation Control - - Simulation Control -This panel allows you to control the various aspects of the simulation. - -- `Run Time <#run-time>`_ - Determines duration for which simulation is - to run. A simulation which has already run, runs further for the - specified additional period. -- `Reset <#reset>`_ - Restores simulation to its initial state; - re-initializes all variables to t = 0. -- `Stop <#stop>`_ - This button halts an ongoing simulation. -- `Current time <#current-time>`_ - This reports the current simulation - time. -- `Preferences <#preferences>`_ - Allows you to set simulation and - visualization related preferences. - -Plot Widget -^^^^^^^^^^^ - -Toolbar -''''''' - -On top of plot window there is a little row of icons: - -.. figure:: ../../images/PlotWindowIcons.png - :align: center - :alt: - -These are the plot controls. If you hover the mouse over them for a few -seconds, a tooltip pops up. The icons represent the following functions: - -- |image0| - Add a new plot window - -- |image1| - Deletes current plot window - -- |image2| - Toggle X-Y axis grid - -- |image3| - Returns the plot display to its default position - -- |image4| - Undoes or re-does manipulations you have done to the - display. - -- |image5| - The plots will pan around with the mouse when you hold the - left button down. The plots will zoom with the mouse when you hold - the right button down. - -- |image6| - With the **``left mouse button``**, this will zoom in to - the specified rectangle so that the plots become bigger. With the - **``right mouse button``**, the entire plot display will be shrunk to - fit into the specified rectangle. - -- |image7| - You don't want to mess with these . - -- |image8| - Save the plot. - -Context Menu -'''''''''''' - -The context menu is enabled by right clicking on the plot window. It has -the following options - - -- **Export to CSV** - Exports the plotted data to CSV format -- **Toggle Legend** - Toggles the plot legend -- **Remove** - Provides a list of plotted entities. The selected entity - will not be plotted. - -.. |image0| image:: ../../images/Addgraph.png -.. |image1| image:: ../../images/delgraph.png -.. |image2| image:: ../../images/grid.png -.. |image3| image:: ../../images/MatPlotLibHomeIcon.png -.. |image4| image:: ../../images/MatPlotLibDoUndo.png -.. |image5| image:: ../../images/MatPlotLibPan.png -.. |image6| image:: ../../images/MatPlotLibZoom.png -.. |image7| image:: ../../images/MatPlotLibConfigureSubplots.png -.. |image8| image:: ../../images/MatPlotLibSave.png diff --git a/docs/user/GUI/RdesigneurDocumentation.rst b/docs/user/GUI/RdesigneurDocumentation.rst deleted file mode 100644 index 59550378c91c1f242b4eacccf0b3a0f2c3c4db62..0000000000000000000000000000000000000000 --- a/docs/user/GUI/RdesigneurDocumentation.rst +++ /dev/null @@ -1,801 +0,0 @@ --------------- - -**Rdesigneur: Building multiscale models** -========================================== - -Upi Bhalla - -Dec 28 2015. - --------------- - -Contents --------- - -Introduction ------------- - -**Rdesigneur** (Reaction Diffusion and Electrical SIGnaling in NEURons) -is an interface to the multiscale modeling capabilities in MOOSE. It is -designed to build models incorporating biochemical signaling pathways in -dendrites and spines, coupled to electrical events in neurons. -Rdesigneur assembles models from predefined parts: it delegates the -details to specialized model definition formats. Rdesigneur combines one -or more of the following cell parts to build models: - -- Neuronal morphology -- Dendritic spines -- Ion channels -- Reaction systems - -Rdesigneur's main role is to specify how these are put together, -including assigning parameters to do so. Rdesigneur also helps with -setting up the simulation input and output. - -Quick Start ------------ - -Here we provide a few use cases, building up from a minimal model to a -reasonably complete multiscale model spanning chemical and electrical -signaling. - -Bare Rdesigneur: single passive compartment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -If we don't provide any arguments at all to the Rdesigneur, it makes a -model with a single passive electrical compartment in the MOOSE path -``/model/elec/soma``. Here is how to do this: - -:: - - import moose - import rdesigneur as rd - rdes = rd.rdesigneur() - rdes.buildModel() - -To confirm that it has made a compartment with some default values we -can add a line: - -:: - - moose.showfields( rdes.soma ) - -This should produce the output: - -:: - - [ /model[0]/elec[0]/soma[0] ] - diameter = 0.0005 - fieldIndex = 0 - Ra = 7639437.26841 - y0 = 0.0 - Rm = 424413.177334 - index = 0 - numData = 1 - inject = 0.0 - initVm = -0.065 - Em = -0.0544 - y = 0.0 - numField = 1 - path = /model[0]/elec[0]/soma[0] - dt = 0.0 - tick = -2 - z0 = 0.0 - name = soma - Cm = 7.85398163398e-09 - x0 = 0.0 - Vm = -0.06 - className = ZombieCompartment - idValue = 465 - length = 0.0005 - Im = 1.3194689277e-08 - x = 0.0005 - z = 0.0 - -Simulate and display current pulse to soma -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -A more useful script would run and display the model. Rdesigneur can -help with the stimulus and the plotting. This simulation has the same -passive compartment, and current is injected as the simulation runs. -This script displays the membrane potential of the soma as it charges -and discharges. - -:: - - import moose - import rdesigneur as rd - rdes = rd.rdesigneur( - stimList = [['soma', '1', 'inject', '(t>0.1 && t<0.2) * 2e-8']], - plotList = [['soma', '1', 'Vm', 'Soma membrane potential']], - ) - rdes.buildModel() - moose.reinit() - moose.start( 0.3 ) - rdes.display() - -The *stimList* defines a stimulus. Each entry has four arguments: - -:: - - `[region_in_cell, region_expression, parameter, expression_string]` - -- ``region_in_cell`` specifies the objects to stimulate. Here it is - just the soma. -- ``region_expression`` specifies a geometry based calculation to - decide whether to apply the stimulus. The value must be >0 for the - stimulus to be present. Here it is just 1. -- ``parameter`` specifies the simulation parameter to assign. Here it - is the injection current to the compartment. -- ``expression_string`` calculates the value of the parameter, - typically as a function of time. Here we use the function sign(x), - where sign(x) == +1 for x > 0, 0 for x = 0 and -1 for x < 0. - -To summarise this, the *stimList* here means *inject a current of 20nA -to the soma between the times of 0.1 and 0.2 s*. - -The *plotList* defines what to plot. It has a similar set of arguments: - -:: - - `[region_in_cell, region_expression, parameter, title_of_plot]` - -These mean the same thing as for the stimList except for the title of -the plot. - -The *rdes.display()* function causes the plots to be displayed. - -.. figure:: ../../images/rdes2_passive_squid.png - :align: center - :alt: Plot for current input to passive compartment - - Plot for current input to passive compartment -When we run this we see an initial depolarization as the soma settles -from its initial -65 mV to a resting Em = -54.4 mV. These are the -original HH values, see the example above. At t = 0.1 seconds there is -another depolarization due to the current injection, and at t = 0.2 -seconds this goes back to the resting potential. - -HH Squid model in a single compartment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here we put the Hodgkin-Huxley squid model channels into a passive -compartment. The HH channels are predefined as prototype channels for -Rdesigneur, - -:: - - import moose - import pylab - import rdesigneur as rd - rdes = rd.rdesigneur( - chanProto = [['make_HH_Na()', 'Na'], ['make_HH_K()', 'K']], - chanDistrib = [ - ['Na', 'soma', 'Gbar', '1200' ], - ['K', 'soma', 'Gbar', '360' ]], - stimList = [['soma', '1', 'inject', '(t>0.1 && t<0.2) * 1e-8' ]], - plotList = [['soma', '1', 'Vm', 'Membrane potential']] - ) - - rdes.buildModel() - moose.reinit() - moose.start( 0.3 ) - rdes.display() - -Here we introduce two new model specification lines: - -- **chanProto**: This specifies which ion channels will be used in the - model. Each entry here has two fields: the source of the channel - definition, and (optionally) the name of the channel. In this example - we specify two channels, an Na and a K channel using the original - Hodgkin-Huxley parameters. As the source of the channel definition we - use the name of the Python function that builds the channel. The - *make\_HH\_Na()* and *make\_HH\_K()* functions are predefined but we - can also specify our own functions for making prototypes. We could - also have specified the channel prototype using the name of a channel - definition file in ChannelML (a subset of NeuroML) format. -- **chanDistrib**: This specifies *where* the channels should be placed - over the geometry of the cell. Each entry in the chanDistrib list - specifies the distribution of parameters for one channel using four - entries: - - ``[object_name, region_in_cell, parameter, expression_string]`` - - In this case the job is almost trivial, since we just have a single - compartment named *soma*. So the line - - ``['Na', 'soma', 'Gbar', '1200' ]`` - - means *Put the Na channel in the soma, and set its maximal - conductance density (Gbar) to 1200 Siemens/m^2*. - -As before we apply a somatic current pulse. Since we now have HH -channels in the model, this generates action potentials. - -.. figure:: ../../images/rdes3_squid.png - :align: center - :alt: Plot for HH squid simulation - - Plot for HH squid simulation -Reaction system in a single compartment -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here we use the compartment as a place in which to embed a chemical -model. The chemical oscillator model is predefined in the rdesigneur -prototypes. - -:: - - import moose - import pylab - import rdesigneur as rd - rdes = rd.rdesigneur( - turnOffElec = True, - diffusionLength = 1e-3, # Default diffusion length is 2 microns - chemProto = [['make_Chem_Oscillator()', 'osc']], - chemDistrib = [['osc', 'soma', 'install', '1' ]], - plotList = [['soma', '1', 'dend/a', 'conc', 'a Conc'], - ['soma', '1', 'dend/b', 'conc', 'b Conc']] - ) - rdes.buildModel() - b = moose.element( '/model/chem/dend/b' ) - b.concInit *= 5 - moose.reinit() - moose.start( 200 ) - - rdes.display() - -In this special case we set the turnOffElec flag to True, so that -Rdesigneur only sets up chemical and not electrical calculations. This -makes the calculations much faster, since we disable electrical -calculations and delink chemical calculations from them. - -We also have a line which sets the ``diffusionLength`` to 1 mm, so that -it is bigger than the 0.5 mm squid axon segment in the default -compartment. If you don't do this the system will subdivide the -compartment into 2 micron voxels for the purposes of putting in a -reaction-diffusion system, which we discuss below. - -There are a couple of lines to change the initial concentration of the -molecular pool b. It is scaled up 5x to give rise to slowly decaying -oscillations. - -.. figure:: ../../images/rdes4_osc.png - :align: center - :alt: Plot for single-compartment reaction simulation - - Plot for single-compartment reaction simulation -Reaction-diffusion system -~~~~~~~~~~~~~~~~~~~~~~~~~ - -In order to see what a reaction-diffusion system looks like, delete the -``diffusionLength`` expression in the previous example and add a couple -of lines to set up 3-D graphics for the reaction-diffusion product: - -:: - - import moose - import pylab - import rdesigneur as rd - rdes = rd.rdesigneur( - turnOffElec = True, - chemProto = [['make_Chem_Oscillator()', 'osc']], - chemDistrib = [['osc', 'soma', 'install', '1' ]], - plotList = [['soma', '1', 'dend/a', 'conc', 'Concentration of a'], - ['soma', '1', 'dend/b', 'conc', 'Concentration of b']], - moogList = [['soma', '1', 'dend/a', 'conc', 'a Conc', 0, 360 ]] - ) - - rdes.buildModel() - bv = moose.vec( '/model/chem/dend/b' ) - bv[0].concInit *= 2 - bv[-1].concInit *= 2 - moose.reinit() - - rdes.displayMoogli( 1, 400, 0.001 ) - -This is the line we deleted. - -:: - - `diffusionLength = 1e-3,` - -With this change we permit *rdesigneur* to use the default diffusion -length of 2 microns. The 500-micron axon segment is now subdivided into -250 voxels, each of which has a reaction system and diffusing molecules. -To make it more picturesque, we have added a line after the plotList, to -display the outcome in 3-D: - -:: - - 'moogList = [['soma', '1', 'dend/a', 'conc', 'a Conc', 0, 360 ]]' - -This line says: take the model compartments defined by ``soma`` as the -region to display, do so throughout the the geometry (the ``1`` -signifies this), and over this range find the chemical entity defined by -``dend/a``. For each ``a`` molecule, find the ``conc`` and dsiplay it. -There are two optional arguments, ``0`` and ``360``, which specify the -low and high value of the displayed variable. - -In order to initially break the symmetry of the system, we change the -initial concentration of molecule b at each end of the cylinder: - -:: - - bv[0].concInit *= 2 - bv[-1].concInit *= 2 - -If we didn't do this the entire system would go through a few cycles of -decaying oscillation and then reach a boring, spatially uniform, steady -state. Try putting an initial symmetry break elsewhere to see what -happens. - -To display the concenctration changes in the 3-D soma as the simulation -runs, we use the line - -:: - - `rdes.displayMoogli( 1, 400, 0.001 )` - -The arguments mean: *displayMoogli( frametime, runtime, rotation )* -Here, - -:: - - frametime = time by which simulation advances between display updates - runtime = Total simulated time - rotation = angle by which display rotates in each frame, in radians. - -When we run this, we first get a 3-D display with the oscillating -reaction-diffusion system making its way inward from the two ends. After -the simulation ends the plots for all compartments for the whole run -come up. - -.. figure:: ../../images/rdes5_reacdiff.png - :align: center - :alt: Display for oscillatory reaction-diffusion simulation - - Display for oscillatory reaction-diffusion simulation -Primer on using the 3-D MOOGLI display -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here is a short primer on the 3-D display controls. - -- *Roll, pitch, and yaw*: Use the letters *r*, *p*, and *y*. To rotate - backwards, use capitals. -- *Zoom out and in*: Use the *,* and *.* keys, or their upper-case - equivalents, *<* and *>*. Easier to remember if you think in terms of - the upper-case. -- *Left/right/up/down*: Arrow keys. -- *Quit*: control-q or control-w. -- You can also use the mouse or trackpad to control most of the above. -- By default rdesigneur gives Moogli a small rotation each frame. It is - the *rotation* argument in the line: - - ``displayMoogli( frametime, runtime, rotation )`` - -These controls operate over and above this rotation, but the rotation -continues. If you set the rotation to zero you can, with a suitable -flick of the mouse, get the image to rotate in any direction you choose -as long as the window is updating. - -Make a toy multiscale model with electrical and chemical signaling. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Now we put together chemical and electrical models. In this toy model we -have an HH-squid type single compartment electrical model, cohabiting -with a chemical oscillator. The chemical oscillator regulates K+ channel -amounts, and the average membrane potential regulates the amounts of a -reactant in the chemical oscillator. This is a recipe for some strange -firing patterns. - -:: - - import moose - import pylab - import rdesigneur as rd - rdes = rd.rdesigneur( - # We want just one compartment so we set diffusion length to be - # bigger than the 0.5 mm HH axon compartment default. - diffusionLength = 1e-3, - chanProto = [['make_HH_Na()', 'Na'], ['make_HH_K()', 'K']], - chanDistrib = [ - ['Na', 'soma', 'Gbar', '1200' ], - ['K', 'soma', 'Gbar', '360' ]], - chemProto = [['make_Chem_Oscillator()', 'osc']], - chemDistrib = [['osc', 'soma', 'install', '1' ]], - # These adaptor parameters give interesting-looking but - # not particularly physiological behaviour. - adaptorList = [ - [ 'dend/a', 'conc', 'Na', 'modulation', 1, -5.0 ], - [ 'dend/b', 'conc', 'K', 'modulation', 1, -0.2], - [ 'dend/b', 'conc', '.', 'inject', -1.0e-7, 4e-7 ], - [ '.', 'Vm', 'dend/s', 'conc', 2.5, 20.0 ] - ], - plotList = [['soma', '1', 'dend/a', 'conc', 'a Conc'], - ['soma', '1', 'dend/b', 'conc', 'b Conc'], - ['soma', '1', 'dend/s', 'conc', 's Conc'], - ['soma', '1', 'Na', 'Gk', 'Na Gk'], - ['soma', '1', '.', 'Vm', 'Membrane potential'] - ] - ) - - rdes.buildModel() - moose.reinit() - moose.start( 250 ) # Takes a few seconds to run this. - - rdes.display() - -We've already modeled the HH squid model and the oscillator -individually, and you should recognize the parts of those models above. -The new section that makes this work the *adaptorList* which specifies -how the electrical and chemical parts talk to each other. This entirely -fictional set of interactions goes like this: - -:: - - [ 'dend/a', 'conc', 'Na', 'modulation', 1, -5.0 ] - -- *dend/a*: The originating variable comes from the 'a' pool on the - 'dend' compartment. - - *conc*: This is the originating variable name on the 'a' pool. - - *Na*: This is the target variable - - *modulation*: scale the Gbar of Na up and down. Use 'modulation' - rather than direct assignment of Gbar since Gbar is different for - each differently-sized compartment. - - *1*: This is the initial offset - - *-5.0*: This is the scaling from the input to the parameter updated - in the simulation. - -A similar set of adaptor entries couple the molecule *dend/b* to the K -channel, *dend/b* again to the current injection into the soma, and the -membrane potential to the concentration of *dend/s*. - -.. figure:: ../../images/rdes6_multiscale.png - :align: center - :alt: Plot for toy multiscale model - - Plot for toy multiscale model -Morphology: Load .swc morphology file and view it -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Here we build a passive model using a morphology file in the .swc file -format (as used by NeuroMorpho.org). The morphology file is predefined -for Rdesigneur and resides in the directory ``./cells``. We apply a -somatic current pulse, and view the somatic membrane potential in a -plot, as before. To make things interesting we display the morphology in -3-D upon which we represent the membrane potential as colors. - -:: - - import moose - import rdesigneur as rd - rdes = rd.rdesigneur( - cellProto = [['./cells/h10.CNG.swc', 'elec']], - stimList = [['soma', '1', '.', 'inject', 't * 25e-9' ]], - plotList = [['#', '1', '.', 'Vm', 'Membrane potential'], - ['#', '1', 'Ca_conc', 'Ca', 'Ca conc (uM)']], - moogList = [['#', '1', '.', 'Vm', 'Soma potential']] - ) - - rdes.buildModel() - - moose.reinit() - rdes.displayMoogli( 0.0002, 0.1 ) - -Here the new concept is the cellProto line, which loads in the specified -cell model: - -:: - - `[ filename, cellname ]` - -The system recognizes the filename extension and builds a model from the -swc file. It uses the cellname **elec** in this example. - -We use a similar line as in the reaction-diffusion example, to build up -a Moogli display of the cell model: - -:: - - `moogList = [['#', '1', '.', 'Vm', 'Soma potential']]` - -Here we have: - -:: - - *#*: the path to use for selecting the compartments to display. - This wildcard means use all compartments. - *1*: The expression to use for the compartments. Again, `1` means use - all of them. - *.*: Which object in the compartment to display. Here we are using the - compartment itself, so it is just a dot. - *Vm*: Field to display - *Soma potential*: Title for display. - -.. figure:: ../../images/rdes7_passive.png - :align: center - :alt: 3-D display for passive neuron - - 3-D display for passive neuron -Build an active neuron model by putting channels into a morphology file -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -We load in a morphology file and distribute voltage-gated ion channels -over the neuron. Here the voltage-gated channels are obtained from a -number of channelML files, located in the ``./channels`` subdirectory. -Since we have a spatially extended neuron, we need to specify the -spatial distribution of channel densities too. - -:: - - import moose - import rdesigneur as rd - rdes = rd.rdesigneur( - chanProto = [ - ['./chans/hd.xml'], - ['./chans/kap.xml'], - ['./chans/kad.xml'], - ['./chans/kdr.xml'], - ['./chans/na3.xml'], - ['./chans/nax.xml'], - ['./chans/CaConc.xml'], - ['./chans/Ca.xml'] - ], - cellProto = [['./cells/h10.CNG.swc', 'elec']], - chanDistrib = [ \ - ["hd", "#dend#,#apical#", "Gbar", "50e-2*(1+(p*3e4))" ], - ["kdr", "#", "Gbar", "p < 50e-6 ? 500 : 100" ], - ["na3", "#soma#,#dend#,#apical#", "Gbar", "850" ], - ["nax", "#soma#,#axon#", "Gbar", "1250" ], - ["kap", "#axon#,#soma#", "Gbar", "300" ], - ["kap", "#dend#,#apical#", "Gbar", - "300*(H(100-p*1e6)) * (1+(p*1e4))" ], - ["Ca_conc", "#", "tau", "0.0133" ], - ["kad", "#soma#,#dend#,#apical#", "Gbar", "50" ], - ["Ca", "#", "Gbar", "50" ] - ], - stimList = [['soma', '1', '.', 'inject', '(t>0.02) * 1e-9' ]], - plotList = [['#', '1', '.', 'Vm', 'Membrane potential'], - ['#', '1', 'Ca_conc', 'Ca', 'Ca conc (uM)']], - moogList = [['#', '1', 'Ca_conc', 'Ca', 'Calcium conc (uM)', 0, 120], - ['#', '1', '.', 'Vm', 'Soma potential']] - ) - - rdes.buildModel() - - moose.reinit() - rdes.displayMoogli( 0.0002, 0.052 ) - -Here we make more extensive use of two concepts which we've already seen -from the single compartment squid model: - -1. *chanProto*: This defines numerous channels, each of which is of the - form: - - ``[ filename ]`` - - or - - ``[ filename, channelname ]`` - -If the *channelname* is not specified the system uses the last part of -the channel name, before the filetype suffix. - -2. *chanDistrib*: This defines the spatial distribution of each channel - type. Each line is of a form that should be familiar now: - - ``[channelname, region_in_cell, parameter, expression_string]`` - -- The *channelname* is the name of the prototype from *chanproto*. This - is usually an ion channel, but in the example above you can also see - a calcium concentration pool defined. -- The *region\_in\_cell* is typically defined using wildcards, so that - it generalizes to any cell morphology. For example, the plain - wildcard ``#`` means to consider all cell compartments. The wildcard - ``#dend#`` means to consider all compartments with the string - ``dend`` somewhere in the name. Wildcards can be comma-separated, so - ``#soma#,#dend#`` means consider all compartments with either soma or - dend in their name. The naming in MOOSE is defined by the model file. - Importantly, in **.swc** files MOOSE generates names that respect the - classification of compartments into axon, soma, dendrite, and apical - dendrite compartments respectively. SWC files generate compartment - names such as: - - :: - - soma_<number> - dend_<number> - apical_<number> - axon_<number> - -where the number is automatically assigned by the reader. In order to -select all dendritic compartments, for example, one would use *"#dend#"* -where the *"#"* acts as a wildcard to accept any string. - The -*parameter* is usually Gbar, the channel conductance density in *S/m^2*. -If *Gbar* is zero or less, then the system economizes by not -incorporating this channel mechanism in this part of the cell. -Similarly, for calcium pools, if the *tau* is below zero then the -calcium pool object is simply not inserted into this part of the cell. - -The *expression\_string* defines the value of the parameter, such as -Gbar. This is typically a function of position in the cell. The -expression evaluator knows about several parameters of cell geometry. -All units are in metres: - -- *x*, *y* and *z* coordinates. -- *g*, the geometrical distance from the soma -- *p*, the path length from the soma, measured along the dendrites. -- *dia*, the diameter of the dendrite. -- *L*, The electrotonic length from the soma (no units). - -Along with these geometrical arguments, we make liberal use of the -Heaviside function H(x) to set up the channel distributions. The -expression evaluator also knows about pretty much all common algebraic, -trignometric, and logarithmic functions, should you wish to use these. - -Also note the two Moogli displays. The first is the calcium -concentration. The second is the membrane potential in each compartment. -Easy! - -.. figure:: ../../images/rdes8_active.png - :align: center - :alt: 3-D display for active neuron - - 3-D display for active neuron -Build a spiny neuron from a morphology file and put active channels in it. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -This model is one step elaborated from the previous one, in that we now -also have dendritic spines. MOOSE lets one decorate a bare neuronal -morphology file with dendritic spines, specifying various geometric -parameters of their location. As before, we use an swc file for the -morphology, and the same ion channels and distribution. - -:: - - import moose - import pylab - import rdesigneur as rd - rdes = rd.rdesigneur( - chanProto = [ - ['./chans/hd.xml'], - ['./chans/kap.xml'], - ['./chans/kad.xml'], - ['./chans/kdr.xml'], - ['./chans/na3.xml'], - ['./chans/nax.xml'], - ['./chans/CaConc.xml'], - ['./chans/Ca.xml'] - ], - cellProto = [['./cells/h10.CNG.swc', 'elec']], - spineProto = [['make_active_spine()', 'spine']], - chanDistrib = [ - ["hd", "#dend#,#apical#", "Gbar", "50e-2*(1+(p*3e4))" ], - ["kdr", "#", "Gbar", "p < 50e-6 ? 500 : 100" ], - ["na3", "#soma#,#dend#,#apical#", "Gbar", "850" ], - ["nax", "#soma#,#axon#", "Gbar", "1250" ], - ["kap", "#axon#,#soma#", "Gbar", "300" ], - ["kap", "#dend#,#apical#", "Gbar", - "300*(H(100-p*1e6)) * (1+(p*1e4))" ], - ["Ca_conc", "#", "tau", "0.0133" ], - ["kad", "#soma#,#dend#,#apical#", "Gbar", "50" ], - ["Ca", "#", "Gbar", "50" ] - ], - spineDistrib = [['spine', '#dend#,#apical#', '20e-6', '1e-6']], - stimList = [['soma', '1', '.', 'inject', '(t>0.02) * 1e-9' ]], - plotList = [['#', '1', '.', 'Vm', 'Membrane potential'], - ['#', '1', 'Ca_conc', 'Ca', 'Ca conc (uM)']], - moogList = [['#', '1', 'Ca_conc', 'Ca', 'Calcium conc (uM)', 0, 120], - ['#', '1', '.', 'Vm', 'Soma potential']] - ) - - rdes.buildModel() - - moose.reinit() - rdes.displayMoogli( 0.0002, 0.023 ) - -Spines are set up in a familiar way: we first define one (or more) -prototype spines, and then distribute these around the cell. Here is the -prototype string: - -:: - - [spine_proto, spinename] - -*spine\_proto*: This is typically a function. One can define one's own, -but there are several predefined ones in rdesigneur. All these define a -spine with the following parameters: - -- head diameter 0.5 microns -- head length 0.5 microns -- shaft length 1 micron -- shaft diameter of 0.2 microns -- RM = 1.0 ohm-metre square -- RA = 1.0 ohm-meter -- CM = 0.01 Farads per square metre. - -Here are the predefined spine prototypes: - -- *make\_passive\_spine()*: This just makes a passive spine with the - default parameters -- *make\_exc\_spine()*: This makes a spine with NMDA and glu receptors, - and also a calcium pool. The NMDA channel feeds the Ca pool. -- *make\_active\_spine()*: This adds a Ca channel to the exc\_spine. - and also a calcium pool. - -The spine distributions are specified in a familiar way for the first -few arguments, and then there are multiple (optional) spine-specific -parameters: - -*[spinename, region\_in\_cell, spacing, spacing\_distrib, size, -size\_distrib, angle, angle\_distrib ]* - -Only the first two arguments are mandatory. - -- *spinename*: The prototype name -- *region\_in\_cell*: Usual wildcard specification of names of - compartments in which to put the spines. -- *spacing*: Math expression to define spacing between spines. In the - current implementation this evaluates to - ``1/probability_of_spine_per_unit_length``. Defaults to 10 microns. - Thus, there is a 10% probability of a spine insertion in every - micron. This evaluation method has the drawback that it is possible - to space spines rather too close to each other. If spacing is zero or - less, no spines are inserted. -- *spacing\_distrib*: Math expression for distribution of spacing. In - the current implementation, this specifies the interval at which the - system samples from the spacing probability above. Defaults to 1 - micron. -- *size*: Linear scale factor for size of spine. All dimensions are - scaled by this factor. The default spine head here is 0.5 microns in - diameter and length. If the scale factor were to be 2, the volume - would be 8 times as large. Defaults to 1.0. -- *size\_distrib*: Range for size of spine. A random number R is - computed in the range 0 to 1, and the final size used is - ``size + (R - 0.5) * size_distrib``. Defaults to 0.5 -- *angle*: This specifies the initial angle at which the spine sticks - out of the dendrite. If all angles were zero, they would all point - away from the soma. Defaults to 0 radians. -- *angle\_distrib*: Specifies a random number to add to the initial - angle. Defaults to 2 PI radians, so the spines come out in any - direction. - -One may well ask why we are not using a Python dictionary to handle all -these parameters. Short answer is: terseness. Longer answer is that the -rdesigneur format is itself meant to be an intermediate form for an -eventual high-level, possibly XML-based multiscale modeling format. - -.. figure:: ../../images/rdes9_spiny_active.png - :align: center - :alt: 3-D display for spiny active neuron - - 3-D display for spiny active neuron -Build a spiny neuron from a morphology file and put a reaction-diffusion system in it. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -Rdesigneur is specially designed to take reaction systems with a -dendrite, a spine head, and a spine PSD compartment, and embed these -systems into neuronal morphologies. This example shows how this is done. - -The dendritic molecules diffuse along the dendrite in the region -specified by the *chemDistrib* keyword. In this case they are placed on -all apical and basal dendrites, but only at distances over 500 microns -from the soma. The spine head and PSD reaction systems are inserted only -into spines within this same *chemDistrib* zone. Diffusion coupling -between dendrite, and each spine head and PSD is also set up. It takes a -predefined chemical model file for Rdesigneur, which resides in the -``./chem`` subdirectory. As in an earlier example, we turn off the -electrical calculations here as they are not needed. Here we plot out -the number of receptors on every single spine as a function of time. - -(stuff here) - -Make a full multiscale model with complex spiny morphology and electrical and chemical signaling. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -(stuff here)