SimpleOxygenBasedCellCycleModel.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 
00029 #include "SimpleOxygenBasedCellCycleModel.hpp"
00030 #include "RandomNumberGenerator.hpp"
00031 #include "ApoptoticCellProperty.hpp"
00032 #include "CellPropertyRegistry.hpp"
00033 
00034 SimpleOxygenBasedCellCycleModel::SimpleOxygenBasedCellCycleModel()
00035     : mTimeSpentInG1Phase(0.0),
00036       mCurrentHypoxicDuration(0.0),
00037       mHypoxicConcentration(0.4),
00038       mQuiescentConcentration(1.0),
00039       mCriticalHypoxicDuration(2.0)
00040 {
00041     mCurrentHypoxiaOnsetTime = SimulationTime::Instance()->GetTime();
00042 }
00043 
00044 
00045 double SimpleOxygenBasedCellCycleModel::GetCurrentHypoxicDuration()
00046 {
00047     return mCurrentHypoxicDuration;
00048 }
00049 
00050 
00051 double SimpleOxygenBasedCellCycleModel::GetCurrentHypoxiaOnsetTime()
00052 {
00053     return mCurrentHypoxiaOnsetTime;
00054 }
00055 
00056 
00057 void SimpleOxygenBasedCellCycleModel::UpdateCellCyclePhase()
00058 {
00059     // mG1Duration is set when the cell cycle model is given a cell
00060 
00061     bool cell_is_apoptotic = mpCell->HasCellProperty<ApoptoticCellProperty>();
00062 
00063     if (!cell_is_apoptotic)
00064     {
00065         UpdateHypoxicDuration();
00066 
00067         // Get cell's oxygen concentration
00068         double oxygen_concentration;
00069         switch (mDimension)
00070         {
00071             case 1:
00072             {
00073                 const unsigned DIM = 1;
00074                 oxygen_concentration = CellwiseData<DIM>::Instance()->GetValue(mpCell, 0);
00075                 break;
00076             }
00077             case 2:
00078             {
00079                 const unsigned DIM = 2;
00080                 oxygen_concentration = CellwiseData<DIM>::Instance()->GetValue(mpCell, 0);
00081                 break;
00082             }
00083             case 3:
00084             {
00085                 const unsigned DIM = 3;
00086                 oxygen_concentration = CellwiseData<DIM>::Instance()->GetValue(mpCell, 0);
00087                 break;
00088             }
00089 
00090             default:
00091                 NEVER_REACHED;
00092         }
00093 
00094         AbstractSimpleCellCycleModel::UpdateCellCyclePhase();
00095 
00096         if (mCurrentCellCyclePhase == G_ONE_PHASE)
00097         {
00098             // Update G1 duration based on oxygen concentration
00099             double dt = SimulationTime::Instance()->GetTimeStep();
00100 
00101             if (oxygen_concentration < mQuiescentConcentration)
00102             {
00103                 mG1Duration += (1 - std::max(oxygen_concentration, 0.0)/mQuiescentConcentration)*dt;
00104                 mTimeSpentInG1Phase += dt;
00105             }
00106         }
00107     }
00108 }
00109 
00110 
00111 AbstractCellCycleModel* SimpleOxygenBasedCellCycleModel::CreateCellCycleModel()
00112 {
00113     // Create a new cell cycle model
00114     SimpleOxygenBasedCellCycleModel* p_model = new SimpleOxygenBasedCellCycleModel();
00115 
00116     // Set the values of the new cell cycle model's member variables
00117     p_model->SetDimension(mDimension);
00118     p_model->SetCellProliferativeType(mCellProliferativeType);
00119     p_model->SetHypoxicConcentration(mHypoxicConcentration);
00120     p_model->SetQuiescentConcentration(mQuiescentConcentration);
00121     p_model->SetCriticalHypoxicDuration(mCriticalHypoxicDuration);
00122     p_model->SetCurrentHypoxiaOnsetTime(mCurrentHypoxiaOnsetTime);
00123 
00124     return p_model;
00125 }
00126 
00127 
00128 void SimpleOxygenBasedCellCycleModel::UpdateHypoxicDuration()
00129 {
00130     assert(!(mpCell->HasCellProperty<ApoptoticCellProperty>()));
00131     assert(!mpCell->HasApoptosisBegun());
00132 
00133     // Get cell's oxygen concentration
00134     double oxygen_concentration;
00135     switch (mDimension)
00136     {
00137         case 1:
00138         {
00139             const unsigned DIM = 1;
00140             oxygen_concentration = CellwiseData<DIM>::Instance()->GetValue(mpCell, 0);
00141             break;
00142         }
00143         case 2:
00144         {
00145             const unsigned DIM = 2;
00146             oxygen_concentration = CellwiseData<DIM>::Instance()->GetValue(mpCell, 0);
00147             break;
00148         }
00149         case 3:
00150         {
00151             const unsigned DIM = 3;
00152             oxygen_concentration = CellwiseData<DIM>::Instance()->GetValue(mpCell, 0);
00153             break;
00154         }
00155         default:
00156             NEVER_REACHED;
00157     }
00158 
00159     if (oxygen_concentration < mHypoxicConcentration)
00160     {
00161         // Update the duration of the current period of hypoxia
00162         mCurrentHypoxicDuration = (SimulationTime::Instance()->GetTime() - mCurrentHypoxiaOnsetTime);
00163 
00164         // Include a little bit of stochasticity here
00165         double prob_of_death = 0.9 - 0.5*(oxygen_concentration/mHypoxicConcentration);
00166         if (mCurrentHypoxicDuration > mCriticalHypoxicDuration && RandomNumberGenerator::Instance()->ranf() < prob_of_death)
00167         {
00168             mpCell->AddCellProperty(CellPropertyRegistry::Instance()->Get<ApoptoticCellProperty>());
00169         }
00170     }
00171     else
00172     {
00173         // Reset the cell's hypoxic duration and update the time at which the onset of hypoxia occurs
00174         mCurrentHypoxicDuration = 0.0;
00175         mCurrentHypoxiaOnsetTime = SimulationTime::Instance()->GetTime();
00176     }
00177 }
00178 
00179 
00180 double SimpleOxygenBasedCellCycleModel::GetHypoxicConcentration()
00181 {
00182     return mHypoxicConcentration;
00183 }
00184 
00185 
00186 void SimpleOxygenBasedCellCycleModel::SetHypoxicConcentration(double hypoxicConcentration)
00187 {
00188     assert(hypoxicConcentration<=1.0);
00189     assert(hypoxicConcentration>=0.0);
00190     mHypoxicConcentration = hypoxicConcentration;
00191 }
00192 
00193 
00194 double SimpleOxygenBasedCellCycleModel::GetQuiescentConcentration()
00195 {
00196     return mQuiescentConcentration;
00197 }
00198 
00199 
00200 void SimpleOxygenBasedCellCycleModel::SetQuiescentConcentration(double quiescentConcentration)
00201 {
00202     assert(quiescentConcentration <= 1.0);
00203     assert(quiescentConcentration >= 0.0);
00204     mQuiescentConcentration = quiescentConcentration;
00205 }
00206 
00207 
00208 double SimpleOxygenBasedCellCycleModel::GetCriticalHypoxicDuration()
00209 {
00210     return mCriticalHypoxicDuration;
00211 }
00212 
00213 
00214 void SimpleOxygenBasedCellCycleModel::SetCriticalHypoxicDuration(double criticalHypoxicDuration)
00215 {
00216     assert(criticalHypoxicDuration >= 0.0);
00217     mCriticalHypoxicDuration = criticalHypoxicDuration;
00218 }
00219 
00220 void SimpleOxygenBasedCellCycleModel::SetCurrentHypoxiaOnsetTime(double currentHypoxiaOnsetTime)
00221 {
00222     assert(currentHypoxiaOnsetTime >= 0.0);
00223     mCurrentHypoxiaOnsetTime = currentHypoxiaOnsetTime;
00224 }
00225 
00226 // Serialization for Boost >= 1.36
00227 #include "SerializationExportWrapperForCpp.hpp"
00228 CHASTE_CLASS_EXPORT(SimpleOxygenBasedCellCycleModel)

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