Chaste  Release::3.4
SimpleOxygenBasedCellCycleModel.cpp
1 /*
2 
3 Copyright (c) 2005-2016, 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 #include "CellPropertyRegistry.hpp"
40 #include "Exception.hpp"
41 
43  : mCurrentHypoxicDuration(0.0),
44  mHypoxicConcentration(0.4),
45  mQuiescentConcentration(1.0),
46  mCriticalHypoxicDuration(2.0)
47 {
49 }
50 
52 {
54 }
55 
57 {
59 }
60 
62 {
63  // mG1Duration is set when the cell-cycle model is given a cell
64 
65  bool cell_is_apoptotic = mpCell->HasCellProperty<ApoptoticCellProperty>();
66 
67  if (!cell_is_apoptotic)
68  {
70 
71  // Get cell's oxygen concentration
72  double oxygen_concentration = mpCell->GetCellData()->GetItem("oxygen");
73 
75 
76  if (mCurrentCellCyclePhase == G_ONE_PHASE)
77  {
78  // Update G1 duration based on oxygen concentration
79  double dt = SimulationTime::Instance()->GetTimeStep();
80 
81  if (oxygen_concentration < mQuiescentConcentration)
82  {
83  mG1Duration += (1 - std::max(oxygen_concentration, 0.0)/mQuiescentConcentration)*dt;
84  }
85  }
86  }
87 }
88 
90 {
91  // Create a new cell-cycle model
93 
94  /*
95  * Set each member variable of the new cell-cycle model that inherits
96  * its value from the parent.
97  *
98  * Note 1: some of the new cell-cycle model's member variables (namely
99  * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide,
100  * mCurrentHypoxicDuration, mCurrentHypoxiaOnsetTime) will already have been
101  * correctly initialized in its constructor.
102  *
103  * Note 2: one or more of the new cell-cycle model's member variables
104  * may be set/overwritten as soon as InitialiseDaughterCell() is called on
105  * the new cell-cycle model.
106  */
107  p_model->SetBirthTime(mBirthTime);
108  p_model->SetDimension(mDimension);
112  p_model->SetSDuration(mSDuration);
113  p_model->SetG2Duration(mG2Duration);
114  p_model->SetMDuration(mMDuration);
119 
120  return p_model;
121 }
122 
124 {
125  assert(!(mpCell->HasCellProperty<ApoptoticCellProperty>()));
126  assert(!mpCell->HasApoptosisBegun());
127 
128  // Get cell's oxygen concentration
129  double oxygen_concentration = mpCell->GetCellData()->GetItem("oxygen");
130 
131  if (oxygen_concentration < mHypoxicConcentration)
132  {
133  // Update the duration of the current period of hypoxia
135 
136  // Include a little bit of stochasticity here
137  double prob_of_death = 0.9 - 0.5*(oxygen_concentration/mHypoxicConcentration);
139  {
140  /*
141  * This method is usually called within a CellBasedSimulation, after the CellPopulation
142  * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call
143  * CellPropertyRegistry::Instance() here when adding the ApoptoticCellProperty, we would
144  * be creating a new CellPropertyRegistry. In this case the ApoptoticCellProperty cell
145  * count would be incorrect. We must therefore access the ApoptoticCellProperty via the
146  * cell's CellPropertyCollection.
147  */
148  boost::shared_ptr<AbstractCellProperty> p_apoptotic_property =
149  mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<ApoptoticCellProperty>();
150  mpCell->AddCellProperty(p_apoptotic_property);
151  }
152  }
153  else
154  {
155  // Reset the cell's hypoxic duration and update the time at which the onset of hypoxia occurs
158  }
159 }
160 
162 {
163  return mHypoxicConcentration;
164 }
165 
167 {
168  assert(hypoxicConcentration<=1.0);
169  assert(hypoxicConcentration>=0.0);
170  mHypoxicConcentration = hypoxicConcentration;
171 }
172 
174 {
176 }
177 
179 {
180  assert(quiescentConcentration <= 1.0);
181  assert(quiescentConcentration >= 0.0);
182  mQuiescentConcentration = quiescentConcentration;
183 }
184 
186 {
188 }
189 
191 {
192  assert(criticalHypoxicDuration >= 0.0);
193  mCriticalHypoxicDuration = criticalHypoxicDuration;
194 }
195 
197 {
198  assert(currentHypoxiaOnsetTime >= 0.0);
199  mCurrentHypoxiaOnsetTime = currentHypoxiaOnsetTime;
200 }
201 
203 {
204  *rParamsFile << "\t\t\t<HypoxicConcentration>" << mHypoxicConcentration << "</HypoxicConcentration>\n";
205  *rParamsFile << "\t\t\t<QuiescentConcentration>" << mQuiescentConcentration << "</QuiescentConcentration>\n";
206  *rParamsFile << "\t\t\t<CriticalHypoxicDuration>" << mCriticalHypoxicDuration << "</CriticalHypoxicDuration>\n";
207 
208  // Call method on direct parent class
210 }
211 
212 // Serialization for Boost >= 1.36
virtual void SetBirthTime(double birthTime)
virtual void SetStemCellG1Duration(double stemCellG1Duration)
void SetCurrentHypoxiaOnsetTime(double currentHypoxiaOnsetTime)
void SetMinimumGapDuration(double minimumGapDuration)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
void SetMDuration(double mDuration)
static SimulationTime * Instance()
void SetG2Duration(double g2Duration)
double GetTimeStep() const
void SetDimension(unsigned dimension)
void SetQuiescentConcentration(double quiescentConcentration)
void SetCriticalHypoxicDuration(double criticalHypoxicDuration)
static RandomNumberGenerator * Instance()
virtual void SetTransitCellG1Duration(double transitCellG1Duration)
double GetTime() const
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
#define CHASTE_CLASS_EXPORT(T)
void SetHypoxicConcentration(double hypoxicConcentration)
void SetSDuration(double sDuration)