Chaste Release::3.1
Mirams2010WntOdeSystem.cpp
00001 /*
00002 
00003 Copyright (c) 2005-2012, University of Oxford.
00004 All rights reserved.
00005 
00006 University of Oxford means the Chancellor, Masters and Scholars of the
00007 University of Oxford, having an administrative office at Wellington
00008 Square, Oxford OX1 2JD, UK.
00009 
00010 This file is part of Chaste.
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided that the following conditions are met:
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019  * Neither the name of the University of Oxford nor the names of its
00020    contributors may be used to endorse or promote products derived from this
00021    software without specific prior written permission.
00022 
00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 
00034 */
00035 #include "Mirams2010WntOdeSystem.hpp"
00036 #include "CellwiseOdeSystemInformation.hpp"
00037 
00038 Mirams2010WntOdeSystem::Mirams2010WntOdeSystem(double wntLevel,
00039                                                boost::shared_ptr<AbstractCellMutationState> pMutationState,
00040                                                std::vector<double> stateVariables)
00041     : AbstractOdeSystem(3),
00042       mpMutationState(pMutationState),
00043       mWntLevel(wntLevel)
00044 {
00045     mpSystemInfo.reset(new CellwiseOdeSystemInformation<Mirams2010WntOdeSystem>);
00046 
00055     Init(); // set up parameter values
00056 
00057     // Set up rough guesses for the initial steady states in this Wnt conc.
00058     double b1 = 0;
00059     double b2 = 0;
00060     b1 = (mA/2.0) / (((wntLevel + mB)/(mC*wntLevel + mD)) + mF);
00061     if (!mpMutationState)
00062     {
00063         // No mutations specified
00064     }
00065     else if (mpMutationState->IsType<BetaCateninOneHitCellMutationState>())
00066     {
00067         b2 = (mA/2.0)/mF;
00068     }
00069     else
00070     {
00071         b2 = (mA/2.0) / (((wntLevel + mB)/(mC*wntLevel + mD)) + mF);
00072     }
00073 
00074     SetDefaultInitialCondition(0, b1);
00075     SetDefaultInitialCondition(1, b2);
00076     SetDefaultInitialCondition(2, wntLevel);
00077 
00078     if (stateVariables != std::vector<double>())
00079     {
00080         SetStateVariables(stateVariables);
00081     }
00082 }
00083 
00084 void Mirams2010WntOdeSystem::SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState)
00085 {
00086     mpMutationState = pMutationState;
00087 }
00088 
00089 Mirams2010WntOdeSystem::~Mirams2010WntOdeSystem()
00090 {
00091     // Do nothing
00092 }
00093 
00094 void Mirams2010WntOdeSystem::Init()
00095 {
00096     // Initialise model parameter values
00097     mA = 25.38;     // nM hr^{-1}
00098     mB = 0.1;       // dimensionless
00099     mC = 6.386;     // hr
00100     mD = 9.818e-2;  // hr
00101     mE = 1.2e3;     // nM
00102     mF = 1.54e-2;   // hr^{-1}
00103 }
00104 
00105 void Mirams2010WntOdeSystem::EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY)
00106 {
00107     double x1 = rY[0];
00108     double x2 = rY[1];
00109     double wnt_level = rY[2];
00110 
00111     double dx1 = 0.0;
00112     double dx2 = 0.0;
00113     /*
00114      * The variables are
00115      * 1. b = Beta-Catenin1
00116      * 2. b = Beta-Catenin2
00117     */
00118 
00119     double c = mC;
00120     double d = mD;
00121     // Mutations take effect by altering the parameters
00122     if (mpMutationState->IsType<ApcOneHitCellMutationState>()) // APC +/-
00123     {
00124         c = 31.87;
00125         d = 0.490;
00126     }
00127     else if (mpMutationState->IsType<ApcTwoHitCellMutationState>()) // APC -/-
00128     {
00129         c = 71.21;
00130         d = 1.095;
00131     }
00132 
00133     // da
00134     dx1 = mA/2.0 - (((wnt_level + mB)/(c*wnt_level + d))*(mE/(mE+x1)) + mF)*x1;
00135     // db
00136     if (mpMutationState->IsType<BetaCateninOneHitCellMutationState>())
00137     {
00138         dx2 = mA/2.0 - mF*x2;
00139     }
00140     else
00141     {
00142         dx2 = mA/2.0 - (((wnt_level + mB)/(c*wnt_level + d))*(mE/(mE+x2)) + mF)*x2;
00143     }
00144 
00145     rDY[0] = dx1;
00146     rDY[1] = dx2;
00147     rDY[2] = 0.0; // do not change the Wnt level
00148 }
00149 
00150 const boost::shared_ptr<AbstractCellMutationState> Mirams2010WntOdeSystem::GetMutationState() const
00151 {
00152     return mpMutationState;
00153 }
00154 
00155 template<>
00156 void CellwiseOdeSystemInformation<Mirams2010WntOdeSystem>::Initialise()
00157 {
00158     this->mVariableNames.push_back("Beta_Cat_Allele1");
00159     this->mVariableUnits.push_back("nM");
00160     this->mInitialConditions.push_back(50.0); // will be filled in later
00161 
00162     this->mVariableNames.push_back("Beta_Cat_Allele2");
00163     this->mVariableUnits.push_back("nM");
00164     this->mInitialConditions.push_back(50.0); // will be filled in later
00165 
00166     this->mVariableNames.push_back("Wnt Level");
00167     this->mVariableUnits.push_back("non-dim");
00168     this->mInitialConditions.push_back(0.5); // will be filled in later
00169 
00170     this->mInitialised = true;
00171 }
00172 
00173 double Mirams2010WntOdeSystem::GetWntLevel() const
00174 {
00175     return mWntLevel;
00176 }
00177 
00178 // Serialization for Boost >= 1.36
00179 #include "SerializationExportWrapperForCpp.hpp"
00180 CHASTE_CLASS_EXPORT(Mirams2010WntOdeSystem)