SimpleOxygenBasedCellCycleModel.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 
00036 #include "SimpleOxygenBasedCellCycleModel.hpp"
00037 #include "RandomNumberGenerator.hpp"
00038 #include "ApoptoticCellProperty.hpp"
00039 #include "CellPropertyRegistry.hpp"
00040 #include "Exception.hpp"
00041 
00042 SimpleOxygenBasedCellCycleModel::SimpleOxygenBasedCellCycleModel()
00043     : mCurrentHypoxicDuration(0.0),
00044       mHypoxicConcentration(0.4),
00045       mQuiescentConcentration(1.0),
00046       mCriticalHypoxicDuration(2.0)
00047 {
00048     mCurrentHypoxiaOnsetTime = SimulationTime::Instance()->GetTime();
00049 }
00050 
00051 double SimpleOxygenBasedCellCycleModel::GetCurrentHypoxicDuration()
00052 {
00053     return mCurrentHypoxicDuration;
00054 }
00055 
00056 double SimpleOxygenBasedCellCycleModel::GetCurrentHypoxiaOnsetTime()
00057 {
00058     return mCurrentHypoxiaOnsetTime;
00059 }
00060 
00061 void SimpleOxygenBasedCellCycleModel::UpdateCellCyclePhase()
00062 {
00063     // mG1Duration is set when the cell-cycle model is given a cell
00064 
00065     bool cell_is_apoptotic = mpCell->HasCellProperty<ApoptoticCellProperty>();
00066 
00067     if (!cell_is_apoptotic)
00068     {
00069         UpdateHypoxicDuration();
00070 
00071         // Get cell's oxygen concentration
00072         double oxygen_concentration = mpCell->GetCellData()->GetItem("oxygen");
00073 
00074         AbstractSimpleCellCycleModel::UpdateCellCyclePhase();
00075 
00076         if (mCurrentCellCyclePhase == G_ONE_PHASE)
00077         {
00078             // Update G1 duration based on oxygen concentration
00079             double dt = SimulationTime::Instance()->GetTimeStep();
00080 
00081             if (oxygen_concentration < mQuiescentConcentration)
00082             {
00083                 mG1Duration += (1 - std::max(oxygen_concentration, 0.0)/mQuiescentConcentration)*dt;
00084             }
00085         }
00086     }
00087 }
00088 
00089 AbstractCellCycleModel* SimpleOxygenBasedCellCycleModel::CreateCellCycleModel()
00090 {
00091     // Create a new cell-cycle model
00092     SimpleOxygenBasedCellCycleModel* p_model = new SimpleOxygenBasedCellCycleModel();
00093 
00094     /*
00095      * Set each member variable of the new cell-cycle model that inherits
00096      * its value from the parent.
00097      *
00098      * Note 1: some of the new cell-cycle model's member variables (namely
00099      * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide,
00100      * mCurrentHypoxicDuration, mCurrentHypoxiaOnsetTime) will already have been
00101      * correctly initialized in its constructor.
00102      *
00103      * Note 2: one or more of the new cell-cycle model's member variables
00104      * may be set/overwritten as soon as InitialiseDaughterCell() is called on
00105      * the new cell-cycle model.
00106      */
00107     p_model->SetBirthTime(mBirthTime);
00108     p_model->SetDimension(mDimension);
00109     p_model->SetMinimumGapDuration(mMinimumGapDuration);
00110     p_model->SetStemCellG1Duration(mStemCellG1Duration);
00111     p_model->SetTransitCellG1Duration(mTransitCellG1Duration);
00112     p_model->SetSDuration(mSDuration);
00113     p_model->SetG2Duration(mG2Duration);
00114     p_model->SetMDuration(mMDuration);
00115     p_model->SetHypoxicConcentration(mHypoxicConcentration);
00116     p_model->SetQuiescentConcentration(mQuiescentConcentration);
00117     p_model->SetCriticalHypoxicDuration(mCriticalHypoxicDuration);
00118     p_model->SetCurrentHypoxiaOnsetTime(mCurrentHypoxiaOnsetTime);
00119 
00120     return p_model;
00121 }
00122 
00123 void SimpleOxygenBasedCellCycleModel::UpdateHypoxicDuration()
00124 {
00125     assert(!(mpCell->HasCellProperty<ApoptoticCellProperty>()));
00126     assert(!mpCell->HasApoptosisBegun());
00127 
00128     // Get cell's oxygen concentration
00129     double oxygen_concentration = mpCell->GetCellData()->GetItem("oxygen");
00130 
00131     if (oxygen_concentration < mHypoxicConcentration)
00132     {
00133         // Update the duration of the current period of hypoxia
00134         mCurrentHypoxicDuration = (SimulationTime::Instance()->GetTime() - mCurrentHypoxiaOnsetTime);
00135 
00136         // Include a little bit of stochasticity here
00137         double prob_of_death = 0.9 - 0.5*(oxygen_concentration/mHypoxicConcentration);
00138         if (mCurrentHypoxicDuration > mCriticalHypoxicDuration && RandomNumberGenerator::Instance()->ranf() < prob_of_death)
00139         {
00140             /*
00141              * This method is usually called within a CellBasedSimulation, after the CellPopulation
00142              * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call
00143              * CellPropertyRegistry::Instance() here when adding the ApoptoticCellProperty, we would
00144              * be creating a new CellPropertyRegistry. In this case the ApoptoticCellProperty cell
00145              * count would be incorrect. We must therefore access the ApoptoticCellProperty via the
00146              * cell's CellPropertyCollection.
00147              */
00148             boost::shared_ptr<AbstractCellProperty> p_apoptotic_property =
00149                 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<ApoptoticCellProperty>();
00150             mpCell->AddCellProperty(p_apoptotic_property);
00151         }
00152     }
00153     else
00154     {
00155         // Reset the cell's hypoxic duration and update the time at which the onset of hypoxia occurs
00156         mCurrentHypoxicDuration = 0.0;
00157         mCurrentHypoxiaOnsetTime = SimulationTime::Instance()->GetTime();
00158     }
00159 }
00160 
00161 double SimpleOxygenBasedCellCycleModel::GetHypoxicConcentration()
00162 {
00163     return mHypoxicConcentration;
00164 }
00165 
00166 void SimpleOxygenBasedCellCycleModel::SetHypoxicConcentration(double hypoxicConcentration)
00167 {
00168     assert(hypoxicConcentration<=1.0);
00169     assert(hypoxicConcentration>=0.0);
00170     mHypoxicConcentration = hypoxicConcentration;
00171 }
00172 
00173 double SimpleOxygenBasedCellCycleModel::GetQuiescentConcentration()
00174 {
00175     return mQuiescentConcentration;
00176 }
00177 
00178 void SimpleOxygenBasedCellCycleModel::SetQuiescentConcentration(double quiescentConcentration)
00179 {
00180     assert(quiescentConcentration <= 1.0);
00181     assert(quiescentConcentration >= 0.0);
00182     mQuiescentConcentration = quiescentConcentration;
00183 }
00184 
00185 double SimpleOxygenBasedCellCycleModel::GetCriticalHypoxicDuration()
00186 {
00187     return mCriticalHypoxicDuration;
00188 }
00189 
00190 void SimpleOxygenBasedCellCycleModel::SetCriticalHypoxicDuration(double criticalHypoxicDuration)
00191 {
00192     assert(criticalHypoxicDuration >= 0.0);
00193     mCriticalHypoxicDuration = criticalHypoxicDuration;
00194 }
00195 
00196 void SimpleOxygenBasedCellCycleModel::SetCurrentHypoxiaOnsetTime(double currentHypoxiaOnsetTime)
00197 {
00198     assert(currentHypoxiaOnsetTime >= 0.0);
00199     mCurrentHypoxiaOnsetTime = currentHypoxiaOnsetTime;
00200 }
00201 
00202 void SimpleOxygenBasedCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
00203 {
00204     *rParamsFile << "\t\t\t<HypoxicConcentration>" << mHypoxicConcentration << "</HypoxicConcentration>\n";
00205     *rParamsFile << "\t\t\t<QuiescentConcentration>" << mQuiescentConcentration << "</QuiescentConcentration>\n";
00206     *rParamsFile << "\t\t\t<CriticalHypoxicDuration>" << mCriticalHypoxicDuration << "</CriticalHypoxicDuration>\n";
00207 
00208     // Call method on direct parent class
00209     AbstractSimpleCellCycleModel::OutputCellCycleModelParameters(rParamsFile);
00210 }
00211 
00212 // Serialization for Boost >= 1.36
00213 #include "SerializationExportWrapperForCpp.hpp"
00214 CHASTE_CLASS_EXPORT(SimpleOxygenBasedCellCycleModel)

Generated by  doxygen 1.6.2