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 "UblasIncludes.hpp" 00029 #include "AbstractVanLeeuwen2009WntSwatCellCycleModel.hpp" 00030 00031 00032 AbstractVanLeeuwen2009WntSwatCellCycleModel::AbstractVanLeeuwen2009WntSwatCellCycleModel() 00033 : AbstractWntOdeBasedCellCycleModel() 00034 { 00035 } 00036 00037 00038 AbstractVanLeeuwen2009WntSwatCellCycleModel::AbstractVanLeeuwen2009WntSwatCellCycleModel(const AbstractVanLeeuwen2009WntSwatCellCycleModel& rOtherModel) 00039 : AbstractWntOdeBasedCellCycleModel(rOtherModel) 00040 { 00041 if (rOtherModel.mpOdeSystem != NULL) 00042 { 00043 mpOdeSystem = new VanLeeuwen2009WntSwatCellCycleOdeSystem(*static_cast<VanLeeuwen2009WntSwatCellCycleOdeSystem*>(rOtherModel.mpOdeSystem)); 00044 } 00045 } 00046 00047 00048 void AbstractVanLeeuwen2009WntSwatCellCycleModel::ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel() 00049 { 00050 assert(mpOdeSystem!=NULL); 00051 assert(mpCell!=NULL); 00052 double beta_catenin_level = mpOdeSystem->rGetStateVariables()[16] 00053 + mpOdeSystem->rGetStateVariables()[17] 00054 + mpOdeSystem->rGetStateVariables()[18] 00055 + mpOdeSystem->rGetStateVariables()[19]; 00056 00057 CellProliferativeType cell_type = TRANSIT; 00058 00059 // For mitogenic stimulus of 1/25.0 in Wnt equations 00060 if (beta_catenin_level < 10.188) 00061 { 00062 cell_type = DIFFERENTIATED; 00063 } 00064 00065 mpCell->SetCellProliferativeType(cell_type); 00066 } 00067 00068 00069 void AbstractVanLeeuwen2009WntSwatCellCycleModel::Initialise() 00070 { 00071 assert(mpOdeSystem==NULL); 00072 assert(mpCell!=NULL); 00073 00074 double wnt_level = GetWntLevel(); 00075 00076 InitialiseOdeSystem(wnt_level, mpCell->GetMutationState()); 00077 00078 mpOdeSystem->SetStateVariables(mpOdeSystem->GetInitialConditions()); 00079 00080 ChangeCellProliferativeTypeDueToCurrentBetaCateninLevel(); 00081 } 00082 00083 00084 bool AbstractVanLeeuwen2009WntSwatCellCycleModel::SolveOdeToTime(double currentTime) 00085 { 00086 // We are in G0 or G1 phase - running cell cycle ODEs 00087 #ifdef CHASTE_CVODE 00088 const double dt = SimulationTime::Instance()->GetTimeStep(); 00089 #else 00090 double dt = 0.00005; // Needs to be this precise to stop crazy errors whilst we are still using rk4. 00091 #endif // CHASTE_CVODE 00092 00093 // Pass this time step's Wnt stimulus into the solver as a constant over this timestep. 00094 mpOdeSystem->rGetStateVariables()[21] = GetWntLevel(); 00095 00096 // Use the cell's current mutation status as another input 00097 static_cast<VanLeeuwen2009WntSwatCellCycleOdeSystem*>(mpOdeSystem)->SetMutationState(mpCell->GetMutationState()); 00098 00099 msSolver.SolveAndUpdateStateVariable(mpOdeSystem, mLastTime, currentTime, dt); 00100 00101 mLastTime = currentTime; // normally done in Abstract class, but no harm in doing it here to prevent following line throwing an error. 00102 UpdateCellProliferativeType(); 00103 return msSolver.StoppingEventOccurred(); 00104 } 00105 00106 00107 double AbstractVanLeeuwen2009WntSwatCellCycleModel::GetMembraneBoundBetaCateninLevel() 00108 { 00109 return mpOdeSystem->rGetStateVariables()[13] + mpOdeSystem->rGetStateVariables()[14]; 00110 } 00111 00112 00113 double AbstractVanLeeuwen2009WntSwatCellCycleModel::GetCytoplasmicBetaCateninLevel() 00114 { 00115 return mpOdeSystem->rGetStateVariables()[7] + mpOdeSystem->rGetStateVariables()[8] 00116 + mpOdeSystem->rGetStateVariables()[9] + mpOdeSystem->rGetStateVariables()[10] 00117 + mpOdeSystem->rGetStateVariables()[11]; 00118 } 00119 00120 00121 double AbstractVanLeeuwen2009WntSwatCellCycleModel::GetNuclearBetaCateninLevel() 00122 { 00123 return mpOdeSystem->rGetStateVariables()[16] + 00124 mpOdeSystem->rGetStateVariables()[17] + 00125 mpOdeSystem->rGetStateVariables()[18] + 00126 mpOdeSystem->rGetStateVariables()[19]; 00127 }