diff --git a/docs/source/install/index.rst~ b/docs/source/install/index.rst~ deleted file mode 100644 index 5eb7a17d4624f8d036386d0654ee00d92cf97e92..0000000000000000000000000000000000000000 --- a/docs/source/install/index.rst~ +++ /dev/null @@ -1,207 +0,0 @@ -Installation -============ - -Use pre-built packages ----------------------- - -Linux -^^^^^ - -We recommend that you use our repositories hosted at `Open Build Service -<http://build.opensuse.org>`_. We have packages for the following distributions - -- Debian 7.0, 8.0 -- Ubuntu 12.04, 14.04, 15.04, 15.10, 16.04 -- CentOS 6, 7 -- Fedora 20, 21, 22, 23 -- OpenSUSE 13.1, 13.2, Factory ARM, Leap 42.1, Tumbleweed -- SLE 12, 12 SP1 -- RHEL 7 -- Scientific Linux 7 - -Visit `this page -<https://software.opensuse.org/download.html?project=home:moose&package=moose>`_ -pick you distribution and follow instructions. - -.. note:: - ``moogli`` (tool to visualize network activity) is not available for CentOS-6. - -.. raw:: html - <iframe - src="http://software.opensuse.org/download/package.iframe?project=moose&package=moose"></iframe> - -.. todo:: Packages for gentoo, Arch Linux - - -Mac OSX -^^^^^^ - -Download the ``dmg`` file from `here <https://github.com/BhallaLab/moose/releases/download/ghevar_3.0.2/Moose_3.0.2_OSX.dmg>`_. - -Alternatively, you can use ``homebrew`` to install ``moose`` -:: - $ brew install homebrew/science/moose - - -Windows/Cygwin -^^^^^^^^^^^^^^ - -Building MOOSE --------------- - -In case your distribution is not listed on `our repository page -<https://software.opensuse.org/download.html?project=home:moose&package=moose>`_ -, or if you want to build the lastest development code, read on. - -First, you need to get the source code. You can use ``git`` (clone the -repository) or download snapshot of github repo by clicking on `this link -<https://github.com/BhallaLab/moose/archive/master.zip>`_.:: - $ git clone https://github.com/BhallaLab/moose - -Or, -:: - $ wget https://github.com/BhallaLab/moose/archive/master.zip - $ unzip master.zip - -If you don't want lasest snapshot of ``MOOSE``, you can download other released -versions from here `https://github.com/BhallaLab/moose/releases`. - -Install dependencies -~~~~~~~~~~~~~~~~~~~ - -Next, you need to install required dependencies. Depending on your OS, names of -following packages may vary. - -- cmake (version 2.8 or higher) -- gsl-1.16 or higher `download <ftp://ftp.gnu.org/gnu/gsl/>`_. -- libhdf5 development package e.g. `libhdf5-serial-dev` or `libhdf5-devel` -- python development package e.g. `python-dev` or `python-devel` -- numpy e.g. `python-numpy` or `numpy` - -Most of the dependencies can be installed using package manager. - -On ``Debian/Ubuntu`` -:: - $ sudo apt-get install libhdf5-dev cmake libgsl0-dev libpython-dev python-numpy - -.. note:: - Ubuntu 12.04 does not have required version of ``gsl`` (required 1.16 or - higher, available 1.15). On Ubuntu 16.04, package name is ``libgsl-dev``. - -On ``CentOS/Fedora/RHEL/Scientific Linux`` -:: - $ sudo yum install hdf5-devel cmake libgsl-dev python-devel python-numpy - -On ``OpenSUSE`` -:: - $ sudo zypper install hdf5-devel cmake libgsl-dev python-devel python-numpy - -Now use `cmake` to build moose -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -.. codeblock:: bash - $ cd /to/moose/source/code - $ mkdir _build - $ cd _build - $ cmake .. - $ make - $ ctest --output-on-failure # optional - -This will build pyMOOSE (MOOSE's python extention), `ctest` will run few tests to -check if build process was successful. - -.. note:: - To install MOOSE into non-standard directory, pass additional argument - `-DCMAKE_INSTALL_PREFIX=path/to/install/dir` to cmake - :: - $ cmake -DCMAKE_INSTALL_PREFIC=$HOME/.local .. - - To use different version of python - :: - $ cmake -DPYTHON_EXECUTABLE=/opt/python3/bin/python3 .. - -After that installation is pretty easy -:: - $ sudo make install - -If everything went fine, you should be able to import moose in python shell. - -.. code-block:: python - import moose - - -Graphical User Interface (GUI) ------------------------------- - -You can get the source of ``moose-gui`` from `here -<https://github.com/BhallaLab/moose-gui>`_. You can download it either by -clicking on `this link <https://github.com/BhallaLab/moose-gui/archive/master.zip>`_ -or by using ``git`` :: - $ git clone https://github.com/BhallaLab/moose-gui - -To be able to launch ``moose-gui``, you need to install some more packages - -- matplotlib -- python-qt4 - -On ``Ubuntu/Debian``, these can be installed with -:: - $ sudo apt-get install python-matplotlib python-qt4 - -On ``CentOS/Fedora/RHEL`` -:: - $ sudo yum install python-matplotlib python-qt4 - -Now you can fire up the GUI -:: - $ cd /to/moose-gui - $ python mgui.py - -.. note:: - If you have installed ``moose`` package, then GUI is launched by - running following commnad:: - $ moose - -Building moogli ---------------- - -``moogli`` is subproject of ``MOOSE`` for visualizing models. More details can -be found `here <http://moose.ncbs.res.in/moogli>`_. - -`Moogli` is part of `moose` package. Building moogli can be tricky because of -multiple depednecies it has. - - -To get the latest source code of ``moogli``, click on `this link <https://github.com/BhallaLab/moogli/archive/master.zip>`_. - -Moogli depends on ``OpenSceneGraph`` (version 3.2.0 or higher) which may not -be easily available for your operating system. -For this reason, we distribute required ``OpenSceneGraph`` with ``moogli`` -source code. - -Depending on distribution of your operating system, you would need following -packages to be installed. - -On ``Ubuntu/Debian`` -:: - $ sudo apt-get install python-qt4-dev python-qt4-gl python-sip-dev libqt4-dev - -On ``Fedora/CentOS/RHEL`` -:: - $ sudo yum install sip-devel PyQt4-devel qt4-devel libjpeg-devel PyQt4 - -On ``openSUSE`` -:: - $ sudo zypper install python-sip python-qt4-devel libqt4-devel python-qt4 - -After this, building and installing ``moogli`` should be as simple as -:: - $ cd /path/to/moogli - $ mkdir _build - $ cd _build - $ cmake .. - $ make - $ sudo make install - -If you run into troubles, please report it on our `github repository -<https://github.com/BhallaLab/moose/issues>`_. diff --git a/docs/source/install/moose_quickstart.rst~ b/docs/source/install/moose_quickstart.rst~ deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 diff --git a/genesis/Kholodenko_tosbml.xml b/genesis/Kholodenko_tosbml.xml new file mode 100644 index 0000000000000000000000000000000000000000..01fff65db14ef03c96649d15d08ba481652fa9ed --- /dev/null +++ b/genesis/Kholodenko_tosbml.xml @@ -0,0 +1,902 @@ +<?xml version="1.0" encoding="UTF-8"?> +<sbml xmlns:moose="http://www.moose.ncbs.res.in" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns="http://www.sbml.org/sbml/level3/version1/core" xmlns:addedPrefix="http://www.sbml.org/sbml/level3/version1" level="3" version="1"> + <model id="Kholodenko_tosbml" substanceUnits="substance" timeUnits="second" extentUnits="substance"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the oscillatory MAPK model from Kholodenko 2000 Eur J. Biochem 267:1583-1588 The original model is formulated in terms of idealized Michaelis-Menten enzymes and the enzyme-substrate complex concentrations are therefore assumed negligible. The current implementation of the model uses explicit enzyme reactions involving substrates and is therefore an approximation to the Kholodenko model. The approximation is greatly improved if the enzyme is flagged as Available which is an option in Kinetikit. This flag means that the enzyme protein concentration is not reduced even when it is involved in a complex. However, the substrate protein continues to participate in enzyme-substrate complexes and its concentration is therefore affected. Overall, this model works almost the same as the Kholodenko model but the peak MAPK-PP amplitudes are a little reduced and the period of oscillations is about 10% longer. If the enzymes are not flagged as Available then the oscillations commence only when the Km for enzyme 1 is set to 0.1 uM. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:runTime> 6000.0 </moose:runTime> + <moose:solver/> + <moose:simdt>0.005 </moose:simdt> + <moose:plotdt> 10.0 </moose:plotdt> + <moose:plots> /kinetics/Ras_dash_MKKKK; /kinetics/MKKK_dash_P; /kinetics/MKK_dash_PP; /kinetics/MAPK_dash_PP</moose:plots> + </moose:ModelAnnotation> + </annotation> + <listOfUnitDefinitions> + <unitDefinition id="volume"> + <listOfUnits> + <unit kind="litre" exponent="1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="substance"> + <listOfUnits> + <unit kind="mole" exponent="1" scale="-3" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="litre_per_mmole_per_second"> + <listOfUnits> + <unit kind="litre" exponent="1" scale="0" multiplier="1"/> + <unit kind="mole" exponent="-1" scale="-3" multiplier="1"/> + <unit kind="second" exponent="-1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + <unitDefinition id="per_second"> + <listOfUnits> + <unit kind="second" exponent="-1" scale="0" multiplier="1"/> + </listOfUnits> + </unitDefinition> + </listOfUnitDefinitions> + <listOfCompartments> + <compartment id="kinetics_481_0_" name="kinetics" spatialDimensions="3" size="1.66666666666667e-18" units="volume" constant="true"/> + </listOfCompartments> + <listOfSpecies> + <species id="MAPK_489_0_" name="MAPK" compartment="kinetics_481_0_" initialConcentration="0.0003" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The total concn. of MAPK is 300nM from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-8.0</moose:xCord> + <moose:yCord>-7.0</moose:yCord> + <moose:bgColor>35</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MKKK_491_0_" name="MKKK" compartment="kinetics_481_0_" initialConcentration="0.0001" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The total concn. of MKKK is 100nM from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-8.0</moose:xCord> + <moose:yCord>5.0</moose:yCord> + <moose:bgColor>16</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MKK_493_0_" name="MKK" compartment="kinetics_481_0_" initialConcentration="0.0003" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The total concn. of MKK is 300nM from Kholodenko,2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-8.0</moose:xCord> + <moose:yCord>-1.0</moose:yCord> + <moose:bgColor>60</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="int1_495_0_" name="int1" compartment="kinetics_481_0_" initialConcentration="1e-06" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the intermediate enzyme which catalyses the dephosphorylation of MKKK-P to MKKK. The concentration is set to 1 nM based on from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>4.0</moose:yCord> + <moose:bgColor>30</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MKKK_dash_P_499_0_" name="MKKK_dash_P" compartment="kinetics_481_0_" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the phosphorylated form of MKKK which converts MKK to MKK-P and then to MKK-PP from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>0.0</moose:xCord> + <moose:yCord>5.0</moose:yCord> + <moose:bgColor>51</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="int3_505_0_" name="int3" compartment="kinetics_481_0_" initialConcentration="1e-06" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This intermediate enzyme catalyses the dephosphorylation of MKK-P to MKK. The concentration is 1nM from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>-2.0</moose:yCord> + <moose:bgColor>blue</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="int5_509_0_" name="int5" compartment="kinetics_481_0_" initialConcentration="1e-06" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This catalyses the conversion of MAPK-P to MAPK. The concenration is 1nM. from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>-8.0</moose:yCord> + <moose:bgColor>1</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MKK_dash_P_513_0_" name="MKK_dash_P" compartment="kinetics_481_0_" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the single phoshorylated form of MKK. from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>0.0</moose:xCord> + <moose:yCord>-1.0</moose:yCord> + <moose:bgColor>5</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MAPK_dash_P_515_0_" name="MAPK_dash_P" compartment="kinetics_481_0_" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the single phopshorylated form of MAPK from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>0.0</moose:xCord> + <moose:yCord>-7.0</moose:yCord> + <moose:bgColor>55</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="int2_517_0_" name="int2" compartment="kinetics_481_0_" initialConcentration="1e-06" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This intermediate enzyme which catalyses the dephosphorylation of MKK-PP to MKK-P. The concentration is 1nM. from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>4.0</moose:xCord> + <moose:yCord>-2.0</moose:yCord> + <moose:bgColor>2</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="int4_521_0_" name="int4" compartment="kinetics_481_0_" initialConcentration="1e-06" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This intermediate enzyme catalyses the dephosphorylation of MAPK-PP to MAPK-P. The concentration is 1nM. from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>4.0</moose:xCord> + <moose:yCord>-8.0</moose:yCord> + <moose:bgColor>17</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="Ras_dash_MKKKK_525_0_" name="Ras_dash_MKKKK" compartment="kinetics_481_0_" initialConcentration="1e-06" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The concn. of Ras-MKKKK* is set to 1 nM implicitly from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>6.0</moose:xCord> + <moose:yCord>8.0</moose:yCord> + <moose:bgColor>11</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="inactiveRas_dash_MKKK_529_0_" name="inactiveRas_dash_MKKK" compartment="kinetics_481_0_" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the inactive form of Ras-MKKK. Based on the reaction scheme from Kholodenko 2000, this is equivalent to a binding of the MAPK-PP to the Ras. The amount of Ras in the model is small enough that negligible amounts of MAPK are involved in this reaction. So it is a fair approximation to the negative feedback mechanism from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>11.0</moose:xCord> + <moose:yCord>8.0</moose:yCord> + <moose:bgColor>30</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MKK_dash_PP_533_0_" name="MKK_dash_PP" compartment="kinetics_481_0_" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the double phosphorylated and active form of MKK from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>8.0</moose:xCord> + <moose:yCord>-1.0</moose:yCord> + <moose:bgColor>0</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + <species id="MAPK_dash_PP_539_0_" name="MAPK_dash_PP" compartment="kinetics_481_0_" initialConcentration="0" substanceUnits="substance" hasOnlySubstanceUnits="false" boundaryCondition="false" constant="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + This is the double phosphorylated and active form of MAPK. from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>8.0</moose:xCord> + <moose:yCord>-7.0</moose:yCord> + <moose:bgColor>58</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + </species> + </listOfSpecies> + <listOfReactions> + <reaction id="Neg_feedback_531_0_" name="Neg_feedback" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + From Kholodenko, 2000 Eur J Biochem 267 the Kd is 9 nM. We use a rather fast Kf of 1/sec/uM so that equilibrium is maintained. + </body> + </notes> + <annotation> + <moose:ModelAnnotation> + <moose:Group>MAPK</moose:Group> + <moose:xCord>11.0</moose:xCord> + <moose:yCord>2.0</moose:yCord> + <moose:bgColor>white</moose:bgColor> + <moose:textColor>yellow</moose:textColor> + </moose:ModelAnnotation> + </annotation> + <listOfReactants> + <speciesReference species="MAPK_dash_PP_539_0_" stoichiometry="1" constant="false"/> + <speciesReference species="Ras_dash_MKKKK_525_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="inactiveRas_dash_MKKK_529_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kinetics_481_0_ * Neg_feedback_531_0__Kf * MAPK_dash_PP_539_0_*Ras_dash_MKKKK_525_0_-kinetics_481_0_ * Neg_feedback_531_0__Kb * inactiveRas_dash_MKKK_529_0_ + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <minus/> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <ci> Neg_feedback_531_0__Kf </ci> + <ci> MAPK_dash_PP_539_0_ </ci> + <ci> Ras_dash_MKKKK_525_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <ci> Neg_feedback_531_0__Kb </ci> + <ci> inactiveRas_dash_MKKK_529_0_ </ci> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Neg_feedback_531_0__Kf" value="1000" units="litre_per_mmole_per_second"/> + <localParameter id="Neg_feedback_531_0__Kb" value="0.009" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_2_497_0_" name="2" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + Km is 8nM and Vmax is 0.25nM.s-1 from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>5.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>30</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MKKK_dash_P_499_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MKKK_491_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="int1_495_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MKKK_dash_P_499_0_*int1_495_0_/(kinetics_481_0_ * (Km+MKKK_dash_P_499_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MKKK_dash_P_499_0_ </ci> + <ci> int1_495_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MKKK_dash_P_499_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="8e-06" units="substance"/> + <localParameter id="kcat" value="0.25" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_3_501_0_" name="3" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + Km is 15 nM and Vmax is 0.025s-1 from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>2.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>51</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MKK_493_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MKK_dash_P_513_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="MKKK_dash_P_499_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MKK_493_0_*MKKK_dash_P_499_0_/(kinetics_481_0_ * (Km+MKK_493_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MKK_493_0_ </ci> + <ci> MKKK_dash_P_499_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MKK_493_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.500006000024e-05" units="substance"/> + <localParameter id="kcat" value="0.025" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_4_503_0_" name="4" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + Km is 15nM and Vmax is 0.025s-1 from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>4.0</moose:xCord> + <moose:yCord>2.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>51</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MKK_dash_P_513_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MKK_dash_PP_533_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="MKKK_dash_P_499_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MKK_dash_P_513_0_*MKKK_dash_P_499_0_/(kinetics_481_0_ * (Km+MKK_dash_P_513_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MKK_dash_P_513_0_ </ci> + <ci> MKKK_dash_P_499_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MKK_dash_P_513_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.500006000024e-05" units="substance"/> + <localParameter id="kcat" value="0.025" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_6_507_0_" name="6" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 15nM and the Vmax is 0.75nM.s-1 from Kholodenko 2000. + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>-1.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>blue</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MKK_dash_P_513_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MKK_493_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="int3_505_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MKK_dash_P_513_0_*int3_505_0_/(kinetics_481_0_ * (Km+MKK_dash_P_513_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MKK_dash_P_513_0_ </ci> + <ci> int3_505_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MKK_dash_P_513_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.5e-05" units="substance"/> + <localParameter id="kcat" value="0.75" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_10_511_0_" name="10" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 15nM and Vmax is 0.5nM.s-1 from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>-7.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>1</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MAPK_dash_P_515_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MAPK_489_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="int5_509_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MAPK_dash_P_515_0_*int5_509_0_/(kinetics_481_0_ * (Km+MAPK_dash_P_515_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MAPK_dash_P_515_0_ </ci> + <ci> int5_509_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MAPK_dash_P_515_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.49997000059999e-05" units="substance"/> + <localParameter id="kcat" value="0.5" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_5_519_0_" name="5" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 15nM and Vmax is 0.75nM.s-1 from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>4.0</moose:xCord> + <moose:yCord>-1.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>2</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MKK_dash_PP_533_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MKK_dash_P_513_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="int2_517_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MKK_dash_PP_533_0_*int2_517_0_/(kinetics_481_0_ * (Km+MKK_dash_PP_533_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MKK_dash_PP_533_0_ </ci> + <ci> int2_517_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MKK_dash_PP_533_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.5e-05" units="substance"/> + <localParameter id="kcat" value="0.75" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_9_523_0_" name="9" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 15nM and Vmax is 0.5nM.s-1 from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>4.0</moose:xCord> + <moose:yCord>-7.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>17</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MAPK_dash_PP_539_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MAPK_dash_P_515_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="int4_521_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MAPK_dash_PP_539_0_*int4_521_0_/(kinetics_481_0_ * (Km+MAPK_dash_PP_539_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MAPK_dash_PP_539_0_ </ci> + <ci> int4_521_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MAPK_dash_PP_539_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.49997000059999e-05" units="substance"/> + <localParameter id="kcat" value="0.5" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_1_527_0_" name="1" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 10nM and Vmax is 2.5nM sec^-1. We assume that there is 1 nM of the Ras-MKKKK. From Kholodenko, 2000. If the enzymes are not flagged as Available, then this Km should be set to 0.1 to obtain oscillations. + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>8.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>11</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MKKK_491_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MKKK_dash_P_499_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="Ras_dash_MKKKK_525_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MKKK_491_0_*Ras_dash_MKKKK_525_0_/(kinetics_481_0_ * (Km+MKKK_491_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MKKK_491_0_ </ci> + <ci> Ras_dash_MKKKK_525_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MKKK_491_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1e-05" units="substance"/> + <localParameter id="kcat" value="2.5" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_7_535_0_" name="7" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 15nM which is 0.015uM Vmax is 0.025s-1 from Kholodenko, 2000. + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>-4.0</moose:xCord> + <moose:yCord>-4.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>0</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MAPK_489_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MAPK_dash_P_515_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="MKK_dash_PP_533_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MAPK_489_0_*MKK_dash_PP_533_0_/(kinetics_481_0_ * (Km+MAPK_489_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MAPK_489_0_ </ci> + <ci> MKK_dash_PP_533_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MAPK_489_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.500006000024e-05" units="substance"/> + <localParameter id="kcat" value="0.025" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + <reaction id="_8_537_0_" name="8" reversible="true" fast="false"> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + The Km is 15nM which is 0.015uM and Vmax is 0.025s-1 from Kholodenko, 2000 + </body> + </notes> + <annotation> + <moose:EnzymaticReaction> + <moose:Group>MAPK</moose:Group> + <moose:xCord>4.0</moose:xCord> + <moose:yCord>-4.0</moose:yCord> + <moose:bgColor>red</moose:bgColor> + <moose:textColor>0</moose:textColor> + </moose:EnzymaticReaction> + </annotation> + <listOfReactants> + <speciesReference species="MAPK_dash_P_515_0_" stoichiometry="1" constant="false"/> + </listOfReactants> + <listOfProducts> + <speciesReference species="MAPK_dash_PP_539_0_" stoichiometry="1" constant="false"/> + </listOfProducts> + <listOfModifiers> + <modifierSpeciesReference species="MKK_dash_PP_533_0_"/> + </listOfModifiers> + <kineticLaw> + <notes> + <body xmlns="http://www.w3.org/1999/xhtml"> + kcat *MAPK_dash_P_515_0_*MKK_dash_PP_533_0_/(kinetics_481_0_ * (Km+MAPK_dash_P_515_0_)) + </body> + </notes> + <math xmlns="http://www.w3.org/1998/Math/MathML"> + <apply> + <divide/> + <apply> + <times/> + <ci> kcat </ci> + <ci> MAPK_dash_P_515_0_ </ci> + <ci> MKK_dash_PP_533_0_ </ci> + </apply> + <apply> + <times/> + <ci> kinetics_481_0_ </ci> + <apply> + <plus/> + <ci> Km </ci> + <ci> MAPK_dash_P_515_0_ </ci> + </apply> + </apply> + </apply> + </math> + <listOfLocalParameters> + <localParameter id="Km" value="1.500006000024e-05" units="substance"/> + <localParameter id="kcat" value="0.025" units="per_second"/> + </listOfLocalParameters> + </kineticLaw> + </reaction> + </listOfReactions> + </model> +</sbml> diff --git a/snippets/RandSpikeStats.py b/snippets/RandSpikeStats.py index 05f935d32dc22c3d447d17548c23e1f30cad20ef..dfe288f91441a02da4d5e62ad4df04c82b3fe6fc 100644 --- a/snippets/RandSpikeStats.py +++ b/snippets/RandSpikeStats.py @@ -102,8 +102,6 @@ def main(): moose.setClock( i, dt ) moose.useClock( 8, '/plot#', 'process' ) ''' - - # Run the 'main' if this script is executed standalone. if __name__ == '__main__': main() diff --git a/snippets/analogStimTable.py b/snippets/analogStimTable.py index 09c852d67c0248d3857d8d7ab7b3151f979266f1..006f47f8f4a9bd34ded56d9f8cbecaf58a0202b2 100644 --- a/snippets/analogStimTable.py +++ b/snippets/analogStimTable.py @@ -91,5 +91,6 @@ for plotting. if __name__ == '__main__': main() + # # stimtable.py ends here diff --git a/snippets/analogStimTable.py~ b/snippets/analogStimTable.py~ deleted file mode 100644 index f1cf3c6c21846263b634a0317f373133f90ad808..0000000000000000000000000000000000000000 --- a/snippets/analogStimTable.py~ +++ /dev/null @@ -1,95 +0,0 @@ -# analogStimTable.py --- -# -# Filename: analogStimTable.py -# Description: -# Author: Upi Bhalla -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 3, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth -# Floor, Boston, MA 02110-1301, USA. -# - -import numpy as np -import pylab -import moose -from moose import utils - -def analogStimTable(): - simtime = 150 - simdt = 0.1 - model = moose.Neutral('/model') - data = moose.Neutral('/data') - # This is the stimulus generator - stimtable = moose.StimulusTable('/model/stim') - a = moose.BufPool( '/model/a' ) - b = moose.Pool( '/model/b' ) - reac = moose.Reac( '/model/reac' ) - reac.Kf = 0.1 - reac.Kb = 0.1 - moose.connect( stimtable, 'output', a, 'setConcInit' ) - moose.connect( reac, 'sub', a, 'reac' ) - moose.connect( reac, 'prd', b, 'reac' ) - aPlot = moose.Table('/data/aPlot') - moose.connect(aPlot, 'requestOut', a, 'getConc') - bPlot = moose.Table('/data/bPlot') - moose.connect(bPlot, 'requestOut', b, 'getConc') - moose.setClock( stimtable.tick, simdt ) - moose.setClock( a.tick, simdt ) - moose.setClock( aPlot.tick, simdt ) - - #################################################### - # Here we set up the stimulus table. It is half a sine-wave. - stim = [ np.sin(0.01 * float(i) ) for i in range( 314 )] - stimtable.vector = stim - stimtable.stepSize = 0 # This forces use of current time as x value - - # The table will interpolate its contents over the time start to stop: - # At values less than startTime, it emits the first value in table - stimtable.startTime = 5 - # At values more than stopTime, it emits the last value in table - stimtable.stopTime = 60 - stimtable.doLoop = 1 # Enable repeat playbacks. - stimtable.loopTime = 10 + simtime / 2.0 # Repeat playback over this time - - moose.reinit() - moose.start(simtime) - t = [ x * simdt for x in range( len( aPlot.vector ) )] - pylab.plot( t, aPlot.vector, label='Stimulus waveform' ) - pylab.plot( t, bPlot.vector, label='Reaction product b' ) - pylab.legend() - pylab.show() - -def main(): - """ -Example of using a StimulusTable as an analog signal source in -a reaction system. It could be used similarly to give other -analog inputs to a model, such as a current or voltage clamp signal. - -This demo creates a StimulusTable and assigns it half a sine wave. -Then we assign the start time and period over which to emit the wave. -The output of the StimTable is sent to a pool **a**, which participates -in a trivial reaction:: - - table ----> a <===> b - -The output of **a** and **b** are recorded in a regular table -for plotting. - """ - analogStimTable() - -if __name__ == '__main__': - main - -# -# stimtable.py ends here diff --git a/snippets/crossComptNeuroMesh.py.png b/snippets/crossComptNeuroMesh.py.png new file mode 100644 index 0000000000000000000000000000000000000000..130c8446d0a064cbdff9f09228c633b6d1a2e6f0 Binary files /dev/null and b/snippets/crossComptNeuroMesh.py.png differ diff --git a/snippets/crossComptSimpleReac.py b/snippets/crossComptSimpleReac.py index ddfea60bcdd8bedc6b1a615e371da0334e25706b..e3fffe80d3887f62251259dc95bd25a83a08c617 100644 --- a/snippets/crossComptSimpleReac.py +++ b/snippets/crossComptSimpleReac.py @@ -11,84 +11,84 @@ import math import matplotlib.pyplot as plt -import numpy +import numpy as np import moose def makeModel(): - # create container for model - model = moose.Neutral( 'model' ) - compt0 = moose.CubeMesh( '/model/compt0' ) - compt0.volume = 1e-15 - compt1 = moose.CubeMesh( '/model/compt1' ) - compt1.volume = 1e-16 - compt2 = moose.CubeMesh( '/model/compt2' ) - compt2.volume = 1e-17 - - # Position containers so that they abut each other, with - # compt1 in the middle. - side = compt1.dy - compt0.y1 += side - compt0.y0 += side - compt2.x1 += side - compt2.x0 += side - print(('Volumes = ', compt0.volume, compt1.volume, compt2.volume)) - - # create molecules and reactions - a = moose.Pool( '/model/compt0/a' ) - b = moose.Pool( '/model/compt1/b' ) - c = moose.Pool( '/model/compt2/c' ) - reac0 = moose.Reac( '/model/compt1/reac0' ) - reac1 = moose.Reac( '/model/compt1/reac1' ) - - # connect them up for reactions - moose.connect( reac0, 'sub', a, 'reac' ) - moose.connect( reac0, 'prd', b, 'reac' ) - moose.connect( reac1, 'sub', b, 'reac' ) - moose.connect( reac1, 'prd', c, 'reac' ) - - # Assign parameters - a.concInit = 1 - b.concInit = 12.1 - c.concInit = 1 - reac0.Kf = 0.1 - reac0.Kb = 0.1 - reac1.Kf = 0.1 - reac1.Kb = 0.1 - - # Create the output tables - graphs = moose.Neutral( '/model/graphs' ) - outputA = moose.Table2 ( '/model/graphs/concA' ) - outputB = moose.Table2 ( '/model/graphs/concB' ) - outputC = moose.Table2 ( '/model/graphs/concC' ) - - # connect up the tables - moose.connect( outputA, 'requestOut', a, 'getConc' ); - moose.connect( outputB, 'requestOut', b, 'getConc' ); - moose.connect( outputC, 'requestOut', c, 'getConc' ); - - # Build the solvers. No need for diffusion in this version. - ksolve0 = moose.Ksolve( '/model/compt0/ksolve0' ) - ksolve1 = moose.Ksolve( '/model/compt1/ksolve1' ) - ksolve2 = moose.Ksolve( '/model/compt2/ksolve2' ) - stoich0 = moose.Stoich( '/model/compt0/stoich0' ) - stoich1 = moose.Stoich( '/model/compt1/stoich1' ) - stoich2 = moose.Stoich( '/model/compt2/stoich2' ) - - # Configure solvers - stoich0.compartment = compt0 - stoich1.compartment = compt1 - stoich2.compartment = compt2 - stoich0.ksolve = ksolve0 - stoich1.ksolve = ksolve1 - stoich2.ksolve = ksolve2 - stoich0.path = '/model/compt0/#' - stoich1.path = '/model/compt1/#' - stoich2.path = '/model/compt2/#' - stoich1.buildXreacs( stoich0 ) - stoich1.buildXreacs( stoich2 ) - stoich0.filterXreacs() - stoich1.filterXreacs() - stoich2.filterXreacs() + # create container for model + model = moose.Neutral( 'model' ) + compt0 = moose.CubeMesh( '/model/compt0' ) + compt0.volume = 1e-15 + compt1 = moose.CubeMesh( '/model/compt1' ) + compt1.volume = 1e-16 + compt2 = moose.CubeMesh( '/model/compt2' ) + compt2.volume = 1e-17 + + # Position containers so that they abut each other, with + # compt1 in the middle. + side = compt1.dy + compt0.y1 += side + compt0.y0 += side + compt2.x1 += side + compt2.x0 += side + print(('Volumes = ', compt0.volume, compt1.volume, compt2.volume)) + + # create molecules and reactions + a = moose.Pool( '/model/compt0/a' ) + b = moose.Pool( '/model/compt1/b' ) + c = moose.Pool( '/model/compt2/c' ) + reac0 = moose.Reac( '/model/compt1/reac0' ) + reac1 = moose.Reac( '/model/compt1/reac1' ) + + # connect them up for reactions + moose.connect( reac0, 'sub', a, 'reac' ) + moose.connect( reac0, 'prd', b, 'reac' ) + moose.connect( reac1, 'sub', b, 'reac' ) + moose.connect( reac1, 'prd', c, 'reac' ) + + # Assign parameters + a.concInit = 1 + b.concInit = 12.1 + c.concInit = 1 + reac0.Kf = 0.1 + reac0.Kb = 0.1 + reac1.Kf = 0.1 + reac1.Kb = 0.1 + + # Create the output tables + graphs = moose.Neutral( '/model/graphs' ) + outputA = moose.Table2 ( '/model/graphs/concA' ) + outputB = moose.Table2 ( '/model/graphs/concB' ) + outputC = moose.Table2 ( '/model/graphs/concC' ) + + # connect up the tables + moose.connect( outputA, 'requestOut', a, 'getConc' ); + moose.connect( outputB, 'requestOut', b, 'getConc' ); + moose.connect( outputC, 'requestOut', c, 'getConc' ); + + # Build the solvers. No need for diffusion in this version. + ksolve0 = moose.Ksolve( '/model/compt0/ksolve0' ) + ksolve1 = moose.Ksolve( '/model/compt1/ksolve1' ) + ksolve2 = moose.Ksolve( '/model/compt2/ksolve2' ) + stoich0 = moose.Stoich( '/model/compt0/stoich0' ) + stoich1 = moose.Stoich( '/model/compt1/stoich1' ) + stoich2 = moose.Stoich( '/model/compt2/stoich2' ) + + # Configure solvers + stoich0.compartment = compt0 + stoich1.compartment = compt1 + stoich2.compartment = compt2 + stoich0.ksolve = ksolve0 + stoich1.ksolve = ksolve1 + stoich2.ksolve = ksolve2 + stoich0.path = '/model/compt0/#' + stoich1.path = '/model/compt1/#' + stoich2.path = '/model/compt2/#' + stoich1.buildXreacs( stoich0 ) + stoich1.buildXreacs( stoich2 ) + stoich0.filterXreacs() + stoich1.filterXreacs() + stoich2.filterXreacs() @@ -142,13 +142,17 @@ def main(): # FIXME: Plotting causes seg-fault. ## Iterate through all plots, dump their contents to data.plot. - #for x in moose.wildcardFind( '/model/graphs/conc#' ): - # t = numpy.linspace( 0, runtime, x.vector.size ) # sec - # plt.plot( t, x.vector, label=x.name ) - #plt.legend() - #plt.show() - #quit() - + ### Temp fix, if try to save and plot the graph doesn't give seg fault + for x in moose.wildcardFind( '/model/graphs/conc#' ): + t = np.arange( 0, x.vector.size, 1) # sec + graphpath = x.name+".csv" + #t = np.linspace( 0, runtime,x.vector.size) # sec + f = open(graphpath, "w") + np.savetxt(graphpath, np.vstack((t*plotdt,x.vector))) + plt.plot( t, x.vector, label=x.name ) + plt.legend() + plt.show() + quit() # Run the 'main' if this script is executed standalone. if __name__ == '__main__': main() diff --git a/snippets/cspaceSteadyState.py b/snippets/cspaceSteadyState.py index 13b8ae8a142dcb7713765dd7d651bb5c58378f01..713e157bc3ea258b0682d65a544c05f592b9b695 100644 --- a/snippets/cspaceSteadyState.py +++ b/snippets/cspaceSteadyState.py @@ -13,28 +13,28 @@ import numpy import moose def displayPlots(): - for x in moose.wildcardFind( '/model/graphs/#' ): - t = numpy.arange( 0, x.vector.size, 1 ) #sec - pylab.plot( t, x.vector, label=x.name ) - pylab.legend() - pylab.show() + for x in moose.wildcardFind( '/model/graphs/#' ): + t = numpy.arange( 0, x.vector.size, 1 ) #sec + pylab.plot( t, x.vector, label=x.name ) + pylab.legend() + pylab.show() def getState( ksolve, state ): - state.randomInit() - moose.start( 0.1 ) # Run the model for 2 seconds. - state.settle() - ''' - scale = 1.0 / ( 1e-15 * 6.022e23 ) - for x in ksolve.nVec[0]: - print x * scale, - # print ksolve.nVec[0] - print state.nIter, state.status, state.stateType, state.nNegEigenvalues, state.nPosEigenvalues, state.solutionStatus - ''' - moose.start( 20.0 ) # Run model for 10 seconds, just for display + state.randomInit() + moose.start( 0.1 ) # Run the model for 2 seconds. + state.settle() + ''' + scale = 1.0 / ( 1e-15 * 6.022e23 ) + for x in ksolve.nVec[0]: + print x * scale, + # print ksolve.nVec[0] + print state.nIter, state.status, state.stateType, state.nNegEigenvalues, state.nPosEigenvalues, state.solutionStatus + ''' + moose.start( 20.0 ) # Run model for 10 seconds, just for display def main(): - """ + """ This example sets up the kinetic solver and steady-state finder, on a bistable model. It looks for the fixed points 100 times, as follows: @@ -71,53 +71,53 @@ def main(): this algorithm! You may wish to sample concentration space logarithmically rather than linearly. - """ - # The wildcard uses # for single level, and ## for recursive. - #compartment = makeModel() - moose.loadModel( '../genesis/M1719.cspace', '/model', 'ee' ) - compartment = moose.element( 'model/kinetics' ) - compartment.name = 'compartment' - ksolve = moose.Ksolve( '/model/compartment/ksolve' ) - stoich = moose.Stoich( '/model/compartment/stoich' ) - stoich.compartment = compartment - stoich.ksolve = ksolve - #ksolve.stoich = stoich - stoich.path = "/model/compartment/##" - state = moose.SteadyState( '/model/compartment/state' ) - - moose.reinit() - state.stoich = stoich - #state.showMatrices() - state.convergenceCriterion = 1e-7 - - moose.le( '/model/graphs' ) - a = moose.element( '/model/compartment/a' ) - b = moose.element( '/model/compartment/b' ) - c = moose.element( '/model/compartment/c' ) - - for i in range( 0, 100 ): - getState( ksolve, state ) - - moose.start( 100.0 ) # Run the model for 100 seconds. - - b = moose.element( '/model/compartment/b' ) - c = moose.element( '/model/compartment/c' ) - - # move most molecules over to b - b.conc = b.conc + c.conc * 0.95 - c.conc = c.conc * 0.05 - moose.start( 100.0 ) # Run the model for 100 seconds. - - # move most molecules back to a - c.conc = c.conc + b.conc * 0.95 - b.conc = b.conc * 0.05 - moose.start( 100.0 ) # Run the model for 100 seconds. - - # Iterate through all plots, dump their contents to data.plot. - displayPlots() - - quit() + """ + # The wildcard uses # for single level, and ## for recursive. + #compartment = makeModel() + moose.loadModel( '../genesis/M1719.cspace', '/model', 'ee' ) + compartment = moose.element( 'model/kinetics' ) + compartment.name = 'compartment' + ksolve = moose.Ksolve( '/model/compartment/ksolve' ) + stoich = moose.Stoich( '/model/compartment/stoich' ) + stoich.compartment = compartment + stoich.ksolve = ksolve + #ksolve.stoich = stoich + stoich.path = "/model/compartment/##" + state = moose.SteadyState( '/model/compartment/state' ) + + moose.reinit() + state.stoich = stoich + #state.showMatrices() + state.convergenceCriterion = 1e-7 + + moose.le( '/model/graphs' ) + a = moose.element( '/model/compartment/a' ) + b = moose.element( '/model/compartment/b' ) + c = moose.element( '/model/compartment/c' ) + + for i in range( 0, 100 ): + getState( ksolve, state ) + + moose.start( 100.0 ) # Run the model for 100 seconds. + + b = moose.element( '/model/compartment/b' ) + c = moose.element( '/model/compartment/c' ) + + # move most molecules over to b + b.conc = b.conc + c.conc * 0.95 + c.conc = c.conc * 0.05 + moose.start( 100.0 ) # Run the model for 100 seconds. + + # move most molecules back to a + c.conc = c.conc + b.conc * 0.95 + b.conc = b.conc * 0.05 + moose.start( 100.0 ) # Run the model for 100 seconds. + + # Iterate through all plots, dump their contents to data.plot. + displayPlots() + + quit() # Run the 'main' if this script is executed standalone. if __name__ == '__main__': - main() + main() diff --git a/snippets/diffSpinyNeuron.py b/snippets/diffSpinyNeuron.py index b1502b7fd32fada219a40c6f75974a2a4f601bd0..54d42330364dcca5b9ba7b3557b45255454fd0a4 100644 --- a/snippets/diffSpinyNeuron.py +++ b/snippets/diffSpinyNeuron.py @@ -267,8 +267,6 @@ def main(): moose.setClock( i, chemdt ) # for the chem objects moose.setClock( 10, diffdt ) # for the diffusion moose.setClock( 18, plotdt ) # for the output tables. - ''' - ''' moose.reinit() for i in numpy.arange( 0, runtime, animationdt ): moose.start( animationdt ) diff --git a/snippets/funcInputToPools.py b/snippets/funcInputToPools.py index 2ca3f4c0c592aa6e03e95e506fabbc9c97531f24..b6f8f0b31d4531d50c04421b14fb8d877ddf8769 100644 --- a/snippets/funcInputToPools.py +++ b/snippets/funcInputToPools.py @@ -65,9 +65,6 @@ def makeModel(): stoich.compartment = compartment stoich.ksolve = gsolve stoich.path = '/model/compartment/##' - ''' - ''' - # We need a finer timestep than the default 0.1 seconds, # in order to get numerical accuracy. for i in range (10, 19 ): @@ -75,27 +72,27 @@ def makeModel(): def main(): """ - This example describes the special (and discouraged) use case where - functions provide input to a reaction system. Here we have two functions of - time which control the pool # and pool rate of change, respectively:: +This example describes the special (and discouraged) use case where +functions provide input to a reaction system. Here we have two functions of +time which control the pool # and pool rate of change, respectively:: - number of molecules of a = 1 + sin(t) - rate of change of number of molecules of b = 10 * cos(t) +number of molecules of a = 1 + sin(t) +rate of change of number of molecules of b = 10 * cos(t) - In the stochastic case one must set a special flag *useClockedUpdate* - in order to achieve clock-triggered updates from the functions. This is - needed because the functions do not have reaction events to trigger them, - and even if there were reaction events they might not be frequent enough to - track the periodic updates. The use of this flag slows down the calculations, - so try to use a table to control a pool instead. +In the stochastic case one must set a special flag *useClockedUpdate* +in order to achieve clock-triggered updates from the functions. This is +needed because the functions do not have reaction events to trigger them, +and even if there were reaction events they might not be frequent enough to +track the periodic updates. The use of this flag slows down the calculations, +so try to use a table to control a pool instead. - To run in stochastic mode:: +To run in stochastic mode:: - ''python funcInputToPools'' + ''python funcInputToPools'' - To run in deterministic mode:: +To run in deterministic mode:: - ''python funcInputToPools false'' + ''python funcInputToPools false'' """ @@ -120,4 +117,4 @@ def main(): # Run the 'main' if this script is executed standalone. if __name__ == '__main__': - main() + main() \ No newline at end of file diff --git a/snippets/function.py~ b/snippets/function.py~ deleted file mode 100644 index 8b574ea0e842549f2b96304a7795df254ba13e6d..0000000000000000000000000000000000000000 --- a/snippets/function.py~ +++ /dev/null @@ -1,200 +0,0 @@ -# function.py --- -# -# Filename: function.py -# Description: -# Author: Subhasis Ray -# Maintainer: -# Created: Tue Sep 9 17:59:50 2014 (+0530) -# Version: -# Last-Updated: Sun Dec 20 00:02:50 2015 (-0500) -# By: subha -# Update #: 4 -# URL: -# Keywords: -# Compatibility: -# -# - -# Commentary: -# -# -# -# - -# Change log: -# -# -# -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 3, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth -# Floor, Boston, MA 02110-1301, USA. -# -# - -# Code: - -import numpy as np -import sys -import matplotlib.pyplot as plt - -import moose - -simtime = 1.0 - -def example(): - demo = moose.Neutral('/model') - function = moose.Function('/model/function') - function.c['c0'] = 1.0 - function.c['c1'] = 2.0 - function.x.num = 1 - function.expr = 'c0 * exp(c1*x0) * cos(y0) + sin(t)' - # mode 0 - evaluate function value, derivative and rate - # mode 1 - just evaluate function value, - # mode 2 - evaluate derivative, - # mode 3 - evaluate rate - function.mode = 0 - function.independent = 'y0' - nsteps = 1000 - xarr = np.linspace(0.0, 1.0, nsteps) - # Stimulus tables allow you to store sequences of numbers which - # are delivered via the 'output' message at each time step. This - # is a placeholder and in real scenario you will be using any - # sourceFinfo that sends out a double value. - input_x = moose.StimulusTable('/xtab') - input_x.vector = xarr - input_x.startTime = 0.0 - input_x.stepPosition = xarr[0] - input_x.stopTime = simtime - moose.connect(input_x, 'output', function.x[0], 'input') - - yarr = np.linspace(-np.pi, np.pi, nsteps) - input_y = moose.StimulusTable('/ytab') - input_y.vector = yarr - input_y.startTime = 0.0 - input_y.stepPosition = yarr[0] - input_y.stopTime = simtime - moose.connect(function, 'requestOut', input_y, 'getOutputValue') - - # data recording - result = moose.Table('/ztab') - moose.connect(result, 'requestOut', function, 'getValue') - derivative = moose.Table('/zprime') - moose.connect(derivative, 'requestOut', function, 'getDerivative') - rate = moose.Table('/dz_by_dt') - moose.connect(rate, 'requestOut', function, 'getRate') - x_rec = moose.Table('/xrec') - moose.connect(x_rec, 'requestOut', input_x, 'getOutputValue') - y_rec = moose.Table('/yrec') - moose.connect(y_rec, 'requestOut', input_y, 'getOutputValue') - - dt = simtime/nsteps - for ii in range(32): - moose.setClock(ii, dt) - moose.reinit() - moose.start(simtime) - - # Uncomment the following lines and the import matplotlib.pyplot as plt on top - # of this file to display the plot. - plt.subplot(3,1,1) - plt.plot(x_rec.vector, result.vector, 'r-', label='z = {}'.format(function.expr)) - z = function.c['c0'] * np.exp(function.c['c1'] * xarr) * np.cos(yarr) + np.sin(np.arange(len(xarr)) * dt) - plt.plot(xarr, z, 'b--', label='numpy computed') - plt.xlabel('x') - plt.ylabel('z') - plt.legend() - - plt.subplot(3,1,2) - plt.plot(y_rec.vector, derivative.vector, 'r-', label='dz/dy0') - # derivatives computed by putting x values in the analytical formula - dzdy = function.c['c0'] * np.exp(function.c['c1'] * xarr) * (- np.sin(yarr)) - plt.plot(yarr, dzdy, 'b--', label='numpy computed') - plt.xlabel('y') - plt.ylabel('dz/dy') - plt.legend() - - plt.subplot(3,1,3) - # *** BEWARE *** The first two entries are spurious. Entry 0 is - # *** from reinit sending out the defaults. Entry 2 is because - # *** there is no lastValue for computing real forward difference. - plt.plot(np.arange(2, len(rate.vector), 1) * dt, rate.vector[2:], 'r-', label='dz/dt') - dzdt = np.diff(z)/dt - plt.plot(np.arange(0, len(dzdt), 1.0) * dt, dzdt, 'b--', label='numpy computed') - plt.xlabel('t') - plt.ylabel('dz/dt') - plt.legend() - plt.tight_layout() - plt.show() - -def main(): - """ - Function objects can be used to evaluate expressions with arbitrary - number of variables and constants. We can assign expression of the - form:: - - f(c_, c1, ..., cM, x0, x1, ..., xN, y0,..., yP ) - - where `ci`'s are constants and `xi`'s and `yi`'s are variables. - - The constants must be defined before setting the expression and - variables are connected via messages. The constants can have any - name, but the variable names must be of the form x{i} or y{i} - where i is increasing integer starting from 0. - - The `xi`'s are field elements and you have to set their number - first (function.x.num = N). Then you can connect any source field - sending out double to the 'input' destination field of the - `x[i]`. - - The `yi`'s are useful when the required variable is a value field - and is not available as a source field. In that case you connect - the `requestOut` source field of the function element to the - `get{Field}` destination field on the target element. The `yi`'s - are automatically added on connecting. Thus, if you call:: - - moose.connect(function, 'requestOut', a, 'getSomeField') - moose.connect(function, 'requestOut', b, 'getSomeField') - - then ``a.someField`` will be assigned to ``y0`` and - ``b.someField`` will be assigned to ``y1``. - - In this example we evaluate the expression: ``z = c0 * exp(c1 * - x0) * cos(y0)`` - - with x0 ranging from -1 to +1 and y0 ranging from -pi to - +pi. These values are stored in two stimulus tables called xtab - and ytab respectively, so that at each timestep the next values of - x0 and y0 are assigned to the function. - - Along with the value of the expression itself we also compute its - derivative with respect to y0 and its derivative with respect to - time (rate). The former uses a five-point stencil for the - numerical differentiation and has a glitch at y=0. The latter uses - backward difference divided by dt. - - Unlike Func class, the number of variables and constants are - unlimited in Function and you can set all the variables via - messages. - - """ - example() - -if __name__ == '__main__': - main() - - - - -# -# function.py ends here diff --git a/snippets/intfire.py b/snippets/intfire.py index bfd6c80885e667a0a9647722d8573f2786df9074..7cd93d3c35a92d3f28a4640cdcf94dc05367fe2e 100644 --- a/snippets/intfire.py +++ b/snippets/intfire.py @@ -49,9 +49,8 @@ import moose def connect_two_intfires(): """ -Connect two IntFire neurons so that spike events in one gets -transmitted to synapse of the other. - + Connect two IntFire neurons so that spike events in one gets + transmitted to synapse of the other. """ if1 = moose.IntFire('if1') if2 = moose.IntFire('if2') @@ -64,12 +63,11 @@ transmitted to synapse of the other. def connect_spikegen(): """ -Connect a SpikeGen object to an IntFire neuron such that spike -events in spikegen get transmitted to the synapse of the IntFire -neuron. - -if3 = moose.IntFire('if3') + Connect a SpikeGen object to an IntFire neuron such that spike + events in spikegen get transmitted to the synapse of the IntFire + neuron. """ + if3 = moose.IntFire('if3') sf3 = moose.SimpleSynHandler( 'if3/sh' ) moose.connect( sf3, 'activationOut', if3, 'activation' ) sf3.synapse.num = 1 @@ -79,8 +77,7 @@ if3 = moose.IntFire('if3') def setup_synapse(): """ -Create an intfire object and create two synapses on it. - + Create an intfire object and create two synapses on it. """ if4 = moose.IntFire('if4') sf4 = moose.SimpleSynHandler( 'if4/sh' ) @@ -96,9 +93,8 @@ Create an intfire object and create two synapses on it. def main(): """ -Demonstrates connection between 2 IntFire neurons to observe -spike generation. - + Demonstrates connection between 2 IntFire neurons to observe + spike generation. """ connect_two_intfires() connect_spikegen() diff --git a/snippets/loadKineticModel.py b/snippets/loadKineticModel.py index f5addb08402a94a7aa588f4b19b1e928ebf0478c..ad71c67a94451d6276dfbab3efd49bf947467e8b 100644 --- a/snippets/loadKineticModel.py +++ b/snippets/loadKineticModel.py @@ -54,7 +54,7 @@ def main(): This example illustrates loading, running, and saving a kinetic model defined in kkit format. It uses a default kkit model but you can specify another using the command line - ``python filename runtime solver``. + ``python filename runtime solver``. We use the gsl solver here. The model already defines a couple of plots and sets the runtime 20 secs. diff --git a/snippets/loadSbmlmodel.py b/snippets/loadSbmlmodel.py index 744c723933686e32c5c095de1949cfacd10a3483..6288215d586b0767d17e8157d737dc31e569869e 100644 --- a/snippets/loadSbmlmodel.py +++ b/snippets/loadSbmlmodel.py @@ -43,7 +43,7 @@ import pylab import moose from moose.SBML import * -from moose.chemUtil.add_Delete_ChemicalSolver import * +#from moose.chemUtil.add_Delete_ChemicalSolver import * def main(): """ diff --git a/snippets/reacDiffBranchingNeuron.py b/snippets/reacDiffBranchingNeuron.py index 53206070f278c1ade54389af5910577396873237..ac4de98234afd462ae5ad11d15ad4cc14ef605c4 100644 --- a/snippets/reacDiffBranchingNeuron.py +++ b/snippets/reacDiffBranchingNeuron.py @@ -120,12 +120,21 @@ def makeChemModel( compt ): """ This function sets up a simple oscillatory chemical system within the script. The reaction system is:: +<<<<<<< HEAD s ---a---> a // s goes to a, catalyzed by a. s ---a---> b // s goes to b, catalyzed by a. a ---b---> s // a goes to s, catalyzed by b. b -------> s // b is degraded irreversibly to s. +======= + + s ---a---> a // s goes to a, catalyzed by a. + s ---a---> b // s goes to b, catalyzed by a. + a ---b---> s // a goes to s, catalyzed by b. + b -------> s // b is degraded irreversibly to s. + +>>>>>>> 0e491aa41584cf7a66c0e242374d8ee61660eb7b in sum, **a** has a positive feedback onto itself and also forms **b**. **b** has a negative feedback onto **a**. Finally, the diffusion constant for **a** is 1/10 that of **b**. diff --git a/snippets/scaleVolumes.py b/snippets/scaleVolumes.py index 35c7ce760ce5f8982dbaf28aeee72017f9ae110b..965a8562f28d6b0c2b01825a2977df5064a854b5 100644 --- a/snippets/scaleVolumes.py +++ b/snippets/scaleVolumes.py @@ -155,8 +155,14 @@ def main(): # Iterate through all plots, dump their contents to data.plot. displayPlots() pylab.show( block=False ) +<<<<<<< HEAD + print(('vol = ', vol, 'hit 0 to go to next plot')) + eval(str(input())) + +======= print( 'vol = %f ' % vol ) response = input( "Press enter to go to next plot... " ) +>>>>>>> 0e491aa41584cf7a66c0e242374d8ee61660eb7b quit() # Run the 'main' if this script is executed standalone. diff --git a/snippets/vclamp.py~ b/snippets/vclamp.py~ deleted file mode 100644 index 3ebd20cef9413d85cb69f73ea9f69988ad74f90d..0000000000000000000000000000000000000000 --- a/snippets/vclamp.py~ +++ /dev/null @@ -1,137 +0,0 @@ -# vclamp.py --- -# -# Filename: vclamp.py -# Description: -# Author:Subhasis Ray -# Maintainer: -# Created: Sat Feb 2 19:16:54 2013 (+0530) -# Version: -# Last-Updated: Tue Jun 11 17:35:20 2013 (+0530) -# By: subha -# Update #: 178 -# URL: -# Keywords: -# Compatibility: -# -# - -# Commentary: -# -# -# -# - -# Change log: -# -# -# -# -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License as -# published by the Free Software Foundation; either version 3, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; see the file COPYING. If not, write to -# the Free Software Foundation, Inc., 51 Franklin Street, Fifth -# Floor, Boston, MA 02110-1301, USA. -# -# - -# Code: - -import sys -sys.path.append('../../python') -import moose -sys.path.append('../squid') -from squid import SquidAxon -from pylab import * - -def vclamp_demo(simtime=50.0, dt=1e-2): - ## It is good practice to modularize test elements inside a - ## container - container = moose.Neutral('/vClampDemo') - ## Create a compartment with properties of a squid giant axon - comp = SquidAxon('/vClampDemo/axon') - # Create and setup the voltage clamp object - clamp = moose.VClamp('/vClampDemo/vclamp') - ## The defaults should work fine - # clamp.mode = 2 - # clamp.tau = 10*dt - # clamp.ti = dt - # clamp.td = 0 - # clamp.gain = comp.Cm / dt - ## Setup command voltage time course - command = moose.PulseGen('/vClampDemo/command') - command.delay[0] = 10.0 - command.width[0] = 20.0 - command.level[0] = 50.0 - command.delay[1] = 1e9 - moose.connect(command, 'output', clamp, 'commandIn') - ## Connect the Voltage Clamp to the compartemnt - moose.connect(clamp, 'currentOut', comp, 'injectMsg') - moose.connect(comp, 'VmOut', clamp, 'sensedIn') - ## setup stimulus recroding - this is the command pulse - stimtab = moose.Table('/vClampDemo/vclamp_command') - moose.connect(stimtab, 'requestOut', command, 'getOutputValue') - ## Set up Vm recording - vmtab = moose.Table('/vClampDemo/vclamp_Vm') - moose.connect(vmtab, 'requestOut', comp, 'getVm') - ## setup command potential recording - this is the filtered input - ## to PID controller - commandtab = moose.Table('/vClampDemo/vclamp_filteredcommand') - moose.connect(commandtab, 'requestOut', clamp, 'getCommand') - ## setup current recording - Imtab = moose.Table('/vClampDemo/vclamp_inject') - moose.connect(Imtab, 'requestOut', clamp, 'getCurrent') - # Scheduling - moose.setClock(0, dt) - moose.setClock(1, dt) - moose.setClock(2, dt) - moose.setClock(3, dt) - moose.useClock(0, '%s/##[TYPE=Compartment]' % (container.path), 'init') - moose.useClock(0, '%s/##[TYPE=PulseGen]' % (container.path), 'process') - moose.useClock(1, '%s/##[TYPE=Compartment]' % (container.path), 'process') - moose.useClock(2, '%s/##[TYPE=HHChannel]' % (container.path), 'process') - moose.useClock(2, '%s/##[TYPE=VClamp]' % (container.path), 'process') - moose.useClock(3, '%s/##[TYPE=Table]' % (container.path), 'process') - moose.reinit() - print(('RC filter in VClamp:: tau:', clamp.tau)) - print(('PID controller in VClamp:: ti:', clamp.ti, 'td:', clamp.td, 'gain:', clamp.gain)) - moose.start(simtime) - print(('Finished simulation for %g seconds' % (simtime))) - tseries = linspace(0, simtime, len(vmtab.vector)) - subplot(211) - title('Membrane potential and clamp voltage') - plot(tseries, vmtab.vector, 'g-', label='Vm (mV)') - plot(tseries, commandtab.vector, 'b-', label='Filtered command (mV)') - plot(tseries, stimtab.vector, 'r-', label='Command (mV)') - xlabel('Time (ms)') - ylabel('Voltage (mV)') - legend() - # print len(commandtab.vector) - subplot(212) - title('Current through clamp circuit') - # plot(tseries, stimtab.vector, label='stimulus (uA)') - plot(tseries, Imtab.vector, label='injected current (uA)') - xlabel('Time (ms)') - ylabel('Current (uA)') - legend() - show() - -def main(): - """ - This snippet is to demonstrate modelling of voltage clamping. - """ - vclamp_demo() - -if __name__ == '__main__': - main() - -# -# vclamp.py ends here