Chaste  Release::2018.1
SimpleOxygenBasedCellCycleModel.cpp
1 /*
2 
3 Copyright (c) 2005-2018, University of Oxford.
4 All rights reserved.
5 
6 University of Oxford means the Chancellor, Masters and Scholars of the
7 University of Oxford, having an administrative office at Wellington
8 Square, Oxford OX1 2JD, UK.
9 
10 This file is part of Chaste.
11 
12 Redistribution and use in source and binary forms, with or without
13 modification, are permitted provided that the following conditions are met:
14  * Redistributions of source code must retain the above copyright notice,
15  this list of conditions and the following disclaimer.
16  * Redistributions in binary form must reproduce the above copyright notice,
17  this list of conditions and the following disclaimer in the documentation
18  and/or other materials provided with the distribution.
19  * Neither the name of the University of Oxford nor the names of its
20  contributors may be used to endorse or promote products derived from this
21  software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 
34 */
35 
36 #include "SimpleOxygenBasedCellCycleModel.hpp"
37 #include "RandomNumberGenerator.hpp"
38 #include "ApoptoticCellProperty.hpp"
39 
41  : mCurrentHypoxicDuration(0.0),
42  mHypoxicConcentration(0.4),
43  mQuiescentConcentration(1.0),
44  mCriticalHypoxicDuration(2.0)
45 {
47 }
48 
50 {
52 }
53 
55 {
57 }
58 
60 {
61  // mG1Duration is set when the cell-cycle model is given a cell
62 
63  bool cell_is_apoptotic = mpCell->HasCellProperty<ApoptoticCellProperty>();
64 
65  if (!cell_is_apoptotic)
66  {
68 
69  // Get cell's oxygen concentration
70  double oxygen_concentration = mpCell->GetCellData()->GetItem("oxygen");
71 
73 
74  if (mCurrentCellCyclePhase == G_ONE_PHASE)
75  {
76  // Update G1 duration based on oxygen concentration
77  double dt = SimulationTime::Instance()->GetTimeStep();
78 
79  if (oxygen_concentration < mQuiescentConcentration)
80  {
81  mG1Duration += (1 - std::max(oxygen_concentration, 0.0)/mQuiescentConcentration)*dt;
82  }
83  }
84  }
85 }
86 
89  mCurrentHypoxicDuration(rModel.mCurrentHypoxicDuration),
90  mCurrentHypoxiaOnsetTime(rModel.mCurrentHypoxiaOnsetTime),
91  mHypoxicConcentration(rModel.mHypoxicConcentration),
92  mQuiescentConcentration(rModel.mQuiescentConcentration),
93  mCriticalHypoxicDuration(rModel.mCriticalHypoxicDuration)
94 {
95  /*
96  * Initialize only those member variables defined in this class.
97  *
98  * The member variables mCurrentCellCyclePhase, mG1Duration,
99  * mMinimumGapDuration, mStemCellG1Duration, mTransitCellG1Duration,
100  * mSDuration, mG2Duration and mMDuration are initialized in the
101  * AbstractPhaseBasedCellCycleModel constructor.
102  *
103  * The member variables mBirthTime, mReadyToDivide and mDimension
104  * are initialized in the AbstractCellCycleModel constructor.
105  *
106  * Note that mG1Duration is (re)set as soon as InitialiseDaughterCell()
107  * is called on the new cell-cycle model.
108  */
109 }
110 
112 {
113  return new SimpleOxygenBasedCellCycleModel(*this);
114 }
115 
117 {
118  assert(!(mpCell->HasCellProperty<ApoptoticCellProperty>()));
119  assert(!mpCell->HasApoptosisBegun());
120 
121  // Get cell's oxygen concentration
122  double oxygen_concentration = mpCell->GetCellData()->GetItem("oxygen");
123 
124  if (oxygen_concentration < mHypoxicConcentration)
125  {
126  // Update the duration of the current period of hypoxia
128 
129  // Include a little bit of stochasticity here
130  double prob_of_death = 0.9 - 0.5*(oxygen_concentration/mHypoxicConcentration);
132  {
133  /*
134  * This method is usually called within a CellBasedSimulation, after the CellPopulation
135  * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call
136  * CellPropertyRegistry::Instance() here when adding the ApoptoticCellProperty, we would
137  * be creating a new CellPropertyRegistry. In this case the ApoptoticCellProperty cell
138  * count would be incorrect. We must therefore access the ApoptoticCellProperty via the
139  * cell's CellPropertyCollection.
140  */
141  boost::shared_ptr<AbstractCellProperty> p_apoptotic_property =
142  mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<ApoptoticCellProperty>();
143  mpCell->AddCellProperty(p_apoptotic_property);
144  }
145  }
146  else
147  {
148  // Reset the cell's hypoxic duration and update the time at which the onset of hypoxia occurs
151  }
152 }
153 
155 {
156  return mHypoxicConcentration;
157 }
158 
160 {
161  assert(hypoxicConcentration<=1.0);
162  assert(hypoxicConcentration>=0.0);
163  mHypoxicConcentration = hypoxicConcentration;
164 }
165 
167 {
169 }
170 
172 {
173  assert(quiescentConcentration <= 1.0);
174  assert(quiescentConcentration >= 0.0);
175  mQuiescentConcentration = quiescentConcentration;
176 }
177 
179 {
181 }
182 
184 {
185  assert(criticalHypoxicDuration >= 0.0);
186  mCriticalHypoxicDuration = criticalHypoxicDuration;
187 }
188 
190 {
191  assert(currentHypoxiaOnsetTime >= 0.0);
192  mCurrentHypoxiaOnsetTime = currentHypoxiaOnsetTime;
193 }
194 
196 {
197  *rParamsFile << "\t\t\t<HypoxicConcentration>" << mHypoxicConcentration << "</HypoxicConcentration>\n";
198  *rParamsFile << "\t\t\t<QuiescentConcentration>" << mQuiescentConcentration << "</QuiescentConcentration>\n";
199  *rParamsFile << "\t\t\t<CriticalHypoxicDuration>" << mCriticalHypoxicDuration << "</CriticalHypoxicDuration>\n";
200 
201  // Call method on direct parent class
203 }
204 
205 // Serialization for Boost >= 1.36
void SetCurrentHypoxiaOnsetTime(double currentHypoxiaOnsetTime)
static SimulationTime * Instance()
double GetTimeStep() const
void SetQuiescentConcentration(double quiescentConcentration)
void SetCriticalHypoxicDuration(double criticalHypoxicDuration)
static RandomNumberGenerator * Instance()
double GetTime() const
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
#define CHASTE_CLASS_EXPORT(T)
void SetHypoxicConcentration(double hypoxicConcentration)