Mirams2010WntOdeSystem.cpp

00001 /*
00002 
00003 Copyright (c) 2005-2015, 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 // These #includes are needed for the constructor and EvaluateYDerivatives()
00039 #include "ApcOneHitCellMutationState.hpp"
00040 #include "ApcTwoHitCellMutationState.hpp"
00041 #include "BetaCateninOneHitCellMutationState.hpp"
00042 #include "CellLabel.hpp"
00043 #include "WildTypeCellMutationState.hpp"
00044 
00045 Mirams2010WntOdeSystem::Mirams2010WntOdeSystem(double wntLevel,
00046                                                boost::shared_ptr<AbstractCellMutationState> pMutationState,
00047                                                std::vector<double> stateVariables)
00048     : AbstractOdeSystem(3),
00049       mpMutationState(pMutationState),
00050       mWntLevel(wntLevel)
00051 {
00052     mpSystemInfo.reset(new CellwiseOdeSystemInformation<Mirams2010WntOdeSystem>);
00053 
00062     Init(); // set up parameter values
00063 
00064     // Set up rough guesses for the initial steady states in this Wnt conc.
00065     double b1 = 0;
00066     double b2 = 0;
00067     b1 = (mA/2.0) / (((wntLevel + mB)/(mC*wntLevel + mD)) + mF);
00068     if (!mpMutationState)
00069     {
00070         // No mutations specified
00071     }
00072     else if (mpMutationState->IsType<BetaCateninOneHitCellMutationState>())
00073     {
00074         b2 = (mA/2.0)/mF;
00075     }
00076     else
00077     {
00078         b2 = (mA/2.0) / (((wntLevel + mB)/(mC*wntLevel + mD)) + mF);
00079     }
00080 
00081     SetDefaultInitialCondition(0, b1);
00082     SetDefaultInitialCondition(1, b2);
00083     SetDefaultInitialCondition(2, wntLevel);
00084 
00085     if (stateVariables != std::vector<double>())
00086     {
00087         SetStateVariables(stateVariables);
00088     }
00089 }
00090 
00091 void Mirams2010WntOdeSystem::SetMutationState(boost::shared_ptr<AbstractCellMutationState> pMutationState)
00092 {
00093     mpMutationState = pMutationState;
00094 }
00095 
00096 Mirams2010WntOdeSystem::~Mirams2010WntOdeSystem()
00097 {
00098     // Do nothing
00099 }
00100 
00101 void Mirams2010WntOdeSystem::Init()
00102 {
00103     // Initialise model parameter values
00104     mA = 25.38;     // nM hr^{-1}
00105     mB = 0.1;       // dimensionless
00106     mC = 6.386;     // hr
00107     mD = 9.818e-2;  // hr
00108     mE = 1.2e3;     // nM
00109     mF = 1.54e-2;   // hr^{-1}
00110 }
00111 
00112 void Mirams2010WntOdeSystem::EvaluateYDerivatives(double time, const std::vector<double>& rY, std::vector<double>& rDY)
00113 {
00114     double x1 = rY[0];
00115     double x2 = rY[1];
00116     double wnt_level = rY[2];
00117 
00118     double dx1 = 0.0;
00119     double dx2 = 0.0;
00120     /*
00121      * The variables are
00122      * 1. b = Beta-Catenin1
00123      * 2. b = Beta-Catenin2
00124     */
00125 
00126     double c = mC;
00127     double d = mD;
00128     // Mutations take effect by altering the parameters
00129     if (mpMutationState->IsType<ApcOneHitCellMutationState>()) // APC +/-
00130     {
00131         c = 31.87;
00132         d = 0.490;
00133     }
00134     else if (mpMutationState->IsType<ApcTwoHitCellMutationState>()) // APC -/-
00135     {
00136         c = 71.21;
00137         d = 1.095;
00138     }
00139 
00140     // da
00141     dx1 = mA/2.0 - (((wnt_level + mB)/(c*wnt_level + d))*(mE/(mE+x1)) + mF)*x1;
00142     // db
00143     if (mpMutationState->IsType<BetaCateninOneHitCellMutationState>())
00144     {
00145         dx2 = mA/2.0 - mF*x2;
00146     }
00147     else
00148     {
00149         dx2 = mA/2.0 - (((wnt_level + mB)/(c*wnt_level + d))*(mE/(mE+x2)) + mF)*x2;
00150     }
00151 
00152     rDY[0] = dx1;
00153     rDY[1] = dx2;
00154     rDY[2] = 0.0; // do not change the Wnt level
00155 }
00156 
00157 const boost::shared_ptr<AbstractCellMutationState> Mirams2010WntOdeSystem::GetMutationState() const
00158 {
00159     return mpMutationState;
00160 }
00161 
00162 template<>
00163 void CellwiseOdeSystemInformation<Mirams2010WntOdeSystem>::Initialise()
00164 {
00165     this->mVariableNames.push_back("Beta_Cat_Allele1");
00166     this->mVariableUnits.push_back("nM");
00167     this->mInitialConditions.push_back(50.0); // will be filled in later
00168 
00169     this->mVariableNames.push_back("Beta_Cat_Allele2");
00170     this->mVariableUnits.push_back("nM");
00171     this->mInitialConditions.push_back(50.0); // will be filled in later
00172 
00173     this->mVariableNames.push_back("Wnt Level");
00174     this->mVariableUnits.push_back("non-dim");
00175     this->mInitialConditions.push_back(0.5); // will be filled in later
00176 
00177     this->mInitialised = true;
00178 }
00179 
00180 double Mirams2010WntOdeSystem::GetWntLevel() const
00181 {
00182     return mWntLevel;
00183 }
00184 
00185 // Serialization for Boost >= 1.36
00186 #include "SerializationExportWrapperForCpp.hpp"
00187 CHASTE_CLASS_EXPORT(Mirams2010WntOdeSystem)

Generated by  doxygen 1.6.2