Mirams2010WntOdeSystem.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
00004 
00005 University of Oxford means the Chancellor, Masters and Scholars of the
00006 University of Oxford, having an administrative office at Wellington
00007 Square, Oxford OX1 2JD, UK.
00008 
00009 This file is part of Chaste.
00010 
00011 Chaste is free software: you can redistribute it and/or modify it
00012 under the terms of the GNU Lesser General Public License as published
00013 by the Free Software Foundation, either version 2.1 of the License, or
00014 (at your option) any later version.
00015 
00016 Chaste is distributed in the hope that it will be useful, but WITHOUT
00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
00019 License for more details. The offer of Chaste under the terms of the
00020 License is subject to the License being interpreted in accordance with
00021 English Law and subject to any action against the University of Oxford
00022 being under the jurisdiction of the English Courts.
00023 
00024 You should have received a copy of the GNU Lesser General Public License
00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>.
00026 
00027 */
00028 #include "Mirams2010WntOdeSystem.hpp"
00029 #include "CellwiseOdeSystemInformation.hpp"
00030 
00031 Mirams2010WntOdeSystem::Mirams2010WntOdeSystem(double wntLevel,
00032                                                boost::shared_ptr<AbstractCellMutationState> pMutationState,
00033                                                std::vector<double> stateVariables)
00034     : AbstractOdeSystem(3),
00035       mpMutationState(pMutationState),
00036       mWntLevel(wntLevel)
00037 {
00038     mpSystemInfo.reset(new CellwiseOdeSystemInformation<Mirams2010WntOdeSystem>);
00039 
00048     Init(); // set up parameter values
00049 
00050     // Set up rough guesses for the initial steady states in this Wnt conc.
00051     double b1 = 0;
00052     double b2 = 0;
00053     b1 = (mA/2.0) / (((wntLevel + mB)/(mC*wntLevel + mD)) + mF);
00054     if (!mpMutationState)
00055     {
00056         // No mutations specified
00057     }
00058     else if (mpMutationState->IsType<BetaCateninOneHitCellMutationState>())
00059     {
00060         b2 = (mA/2.0)/mF;
00061     }
00062     else
00063     {
00064         b2 = (mA/2.0) / (((wntLevel + mB)/(mC*wntLevel + mD)) + mF);
00065     }
00066 
00067     SetDefaultInitialCondition(0, b1);
00068     SetDefaultInitialCondition(1, b2);
00069     SetDefaultInitialCondition(2, wntLevel);
00070 
00071     if (stateVariables != std::vector<double>())
00072     {
00073         SetStateVariables(stateVariables);
00074     }
00075 }
00076 
00077 void Mirams2010WntOdeSystem::SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState)
00078 {
00079     mpMutationState = pMutationState;
00080 }
00081 
00082 Mirams2010WntOdeSystem::~Mirams2010WntOdeSystem()
00083 {
00084     // Do nothing
00085 }
00086 
00087 void Mirams2010WntOdeSystem::Init()
00088 {
00089     // Initialise model parameter values
00090     mA = 25.38;     // nM hr^{-1}
00091     mB = 0.1;       // dimensionless
00092     mC = 6.386;     // hr
00093     mD = 9.818e-2;  // hr
00094     mE = 1.2e3;     // nM
00095     mF = 1.54e-2;   // hr^{-1}
00096 }
00097 
00098 void Mirams2010WntOdeSystem::EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY)
00099 {
00100     double x1 = rY[0];
00101     double x2 = rY[1];
00102     double wnt_level = rY[2];
00103 
00104     double dx1 = 0.0;
00105     double dx2 = 0.0;
00106     /*
00107      * The variables are
00108      * 1. b = Beta-Catenin1
00109      * 2. b = Beta-Catenin2
00110     */
00111 
00112     double c = mC;
00113     double d = mD;
00114     // Mutations take effect by altering the parameters
00115     if (mpMutationState->IsType<ApcOneHitCellMutationState>()) // APC +/-
00116     {
00117         c = 31.87;
00118         d = 0.490;
00119     }
00120     else if (mpMutationState->IsType<ApcTwoHitCellMutationState>()) // APC -/-
00121     {
00122         c = 71.21;
00123         d = 1.095;
00124     }
00125 
00126     // da
00127     dx1 = mA/2.0 - (((wnt_level + mB)/(c*wnt_level + d))*(mE/(mE+x1)) + mF)*x1;
00128     // db
00129     if (mpMutationState->IsType<BetaCateninOneHitCellMutationState>())
00130     {
00131         dx2 = mA/2.0 - mF*x2;
00132     }
00133     else
00134     {
00135         dx2 = mA/2.0 - (((wnt_level + mB)/(c*wnt_level + d))*(mE/(mE+x2)) + mF)*x2;
00136     }
00137 
00138     rDY[0] = dx1;
00139     rDY[1] = dx2;
00140     rDY[2] = 0.0; // do not change the Wnt level
00141 }
00142 
00143 const boost::shared_ptr<AbstractCellMutationState> Mirams2010WntOdeSystem::GetMutationState() const
00144 {
00145     return mpMutationState;
00146 }
00147 
00148 template<>
00149 void CellwiseOdeSystemInformation<Mirams2010WntOdeSystem>::Initialise()
00150 {
00151     this->mVariableNames.push_back("Beta_Cat_Allele1");
00152     this->mVariableUnits.push_back("nM");
00153     this->mInitialConditions.push_back(50.0); // will be filled in later
00154 
00155     this->mVariableNames.push_back("Beta_Cat_Allele2");
00156     this->mVariableUnits.push_back("nM");
00157     this->mInitialConditions.push_back(50.0); // will be filled in later
00158 
00159     this->mVariableNames.push_back("Wnt Level");
00160     this->mVariableUnits.push_back("non-dim");
00161     this->mInitialConditions.push_back(0.5); // will be filled in later
00162 
00163     this->mInitialised = true;
00164 }
00165 
00166 double Mirams2010WntOdeSystem::GetWntLevel() const
00167 {
00168     return mWntLevel;
00169 }
00170 
00171 // Serialization for Boost >= 1.36
00172 #include "SerializationExportWrapperForCpp.hpp"
00173 CHASTE_CLASS_EXPORT(Mirams2010WntOdeSystem)

Generated on Mon Nov 1 12:35:16 2010 for Chaste by  doxygen 1.5.5