Chaste  Release::3.4
SimpleWntCellCycleModel.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 "SimpleWntCellCycleModel.hpp"
37 #include "Exception.hpp"
38 #include "StemCellProliferativeType.hpp"
39 #include "TransitCellProliferativeType.hpp"
40 #include "DifferentiatedCellProliferativeType.hpp"
41 
43  : mUseCellProliferativeTypeDependentG1Duration(false),
44  mWntStemThreshold(0.8),
45  mWntTransitThreshold(0.65),
46  mWntLabelledThreshold(0.65)
47 {
48 }
49 
51 {
52  // Create a new cell-cycle model
54 
55  /*
56  * Set each member variable of the new cell-cycle model that inherits
57  * its value from the parent.
58  *
59  * Note 1: some of the new cell-cycle model's member variables (namely
60  * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide) will already have been
61  * correctly initialized in its constructor.
62  *
63  * Note 2: one or more of the new cell-cycle model's member variables
64  * may be set/overwritten as soon as InitialiseDaughterCell() is called on
65  * the new cell-cycle model.
66  */
67  p_model->SetBirthTime(mBirthTime);
68  p_model->SetDimension(mDimension);
72  p_model->SetSDuration(mSDuration);
73  p_model->SetG2Duration(mG2Duration);
74  p_model->SetMDuration(mMDuration);
79 
80  return p_model;
81 }
82 
83 void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration)
84 {
85  mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration;
86 }
87 
89 {
90  assert(mpCell != NULL);
91 
93 
94  if (mpCell->GetCellProliferativeType()->IsType<StemCellProliferativeType>())
95  {
97  {
99  }
100  else
101  {
102  // Normally stem cells should behave just like transit cells in a Wnt simulation
104  }
105  }
106  else if (mpCell->GetCellProliferativeType()->IsType<TransitCellProliferativeType>())
107  {
109  }
110  else if (mpCell->GetCellProliferativeType()->IsType<DifferentiatedCellProliferativeType>())
111  {
112  mG1Duration = DBL_MAX;
113  }
114  else
115  {
117  }
118 
119  // Check that the normal random deviate has not returned a small or negative G1 duration
121  {
123  }
124 }
125 
127 {
128  assert(mpCell != NULL);
129  double level = 0;
130 
131  switch (mDimension)
132  {
133  case 1:
134  {
135  const unsigned DIM = 1;
137  break;
138  }
139  case 2:
140  {
141  const unsigned DIM = 2;
143  break;
144  }
145  case 3:
146  {
147  const unsigned DIM = 3;
149  break;
150  }
151  default:
153  }
154  return level;
155 }
156 
158 {
159  WntConcentrationType wnt_type;
160  switch (mDimension)
161  {
162  case 1:
163  {
164  const unsigned DIM = 1;
166  break;
167  }
168  case 2:
169  {
170  const unsigned DIM = 2;
172  break;
173  }
174  case 3:
175  {
176  const unsigned DIM = 3;
178  break;
179  }
180  default:
182  }
183  return wnt_type;
184 }
185 
187 {
188  // The cell can divide if the Wnt concentration >= wnt_division_threshold
189  double wnt_division_threshold = DBL_MAX;
190 
191  // Set up under what level of Wnt stimulus a cell will divide
192  if (mpCell->GetMutationState()->IsType<WildTypeCellMutationState>())
193  {
194  wnt_division_threshold = mWntTransitThreshold;
195  }
196  else if (mpCell->GetMutationState()->IsType<ApcOneHitCellMutationState>())
197  {
198  // should be less than healthy values
199  wnt_division_threshold = 0.77*mWntTransitThreshold;
200  }
201  else if (mpCell->GetMutationState()->IsType<BetaCateninOneHitCellMutationState>())
202  {
203  // less than above value
204  wnt_division_threshold = 0.155*mWntTransitThreshold;
205  }
206  else if (mpCell->GetMutationState()->IsType<ApcTwoHitCellMutationState>())
207  {
208  // should be zero (no Wnt-dependence)
209  wnt_division_threshold = 0.0;
210  }
211  else
212  {
214  }
215 
216  if (mpCell->HasCellProperty<CellLabel>())
217  {
218  wnt_division_threshold = mWntLabelledThreshold;
219  }
220 
221  double wnt_level = GetWntLevel();
222  WntConcentrationType wnt_type = GetWntType();
223 
224  // Set the cell type to TransitCellProliferativeType if the Wnt stimulus exceeds wnt_division_threshold
225  if (wnt_level >= wnt_division_threshold)
226  {
227  // For a RADIAL Wnt type, override the cell type to StemCellProliferativeType if the Wnt stimulus exceeds a higher threshold
228  if ((wnt_type == RADIAL) && (wnt_level > mWntStemThreshold))
229  {
230  /*
231  * This method is usually called within a CellBasedSimulation, after the CellPopulation
232  * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call
233  * CellPropertyRegistry::Instance() here when setting the CellProliferativeType, we
234  * would be creating a new CellPropertyRegistry. In this case the cell proliferative
235  * type counts, as returned by AbstractCellPopulation::GetCellProliferativeTypeCount(),
236  * would be incorrect. We must therefore access the CellProliferativeType via the cell's
237  * CellPropertyCollection.
238  */
239  boost::shared_ptr<AbstractCellProperty> p_stem_type =
240  mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<StemCellProliferativeType>();
241  mpCell->SetCellProliferativeType(p_stem_type);
242  }
243  else
244  {
245  boost::shared_ptr<AbstractCellProperty> p_transit_type =
246  mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<TransitCellProliferativeType>();
247  mpCell->SetCellProliferativeType(p_transit_type);
248  }
249  }
250  else
251  {
252  // The cell is set to have DifferentiatedCellProliferativeType and so in G0 phase
253  boost::shared_ptr<AbstractCellProperty> p_diff_type =
254  mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<DifferentiatedCellProliferativeType>();
255  mpCell->SetCellProliferativeType(p_diff_type);
256  }
258 }
259 
261 {
262  WntConcentrationType wnt_type = GetWntType();
263 
264  if (wnt_type == RADIAL)
265  {
266  boost::shared_ptr<AbstractCellProperty> p_transit_type =
267  mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<TransitCellProliferativeType>();
268  mpCell->SetCellProliferativeType(p_transit_type);
269  }
270 
272 }
273 
275 {
276  return false;
277 }
278 
280 {
281  return mWntStemThreshold;
282 }
283 
284 void SimpleWntCellCycleModel::SetWntStemThreshold(double wntStemThreshold)
285 {
286  assert(wntStemThreshold <= 1.0);
287  assert(wntStemThreshold >= 0.0);
288  mWntStemThreshold = wntStemThreshold;
289 }
290 
292 {
293  return mWntTransitThreshold;
294 }
295 
296 void SimpleWntCellCycleModel::SetWntTransitThreshold(double wntTransitThreshold)
297 {
298  //assert(wntTransitThreshold <= 1.0);
299  //assert(wntTransitThreshold >= 0.0);
300  mWntTransitThreshold = wntTransitThreshold;
301 }
302 
304 {
305  return mWntLabelledThreshold;
306 }
307 
308 void SimpleWntCellCycleModel::SetWntLabelledThreshold(double wntLabelledThreshold)
309 {
310 // assert(wntLabelledThreshold <= 1.0);
311 // assert(wntLabelledThreshold >= 0.0);
312  mWntLabelledThreshold = wntLabelledThreshold;
313 }
314 
316 {
317  *rParamsFile << "\t\t\t<UseCellProliferativeTypeDependentG1Duration>" << mUseCellProliferativeTypeDependentG1Duration << "</UseCellProliferativeTypeDependentG1Duration>\n";
318  *rParamsFile << "\t\t\t<WntStemThreshold>" << mWntStemThreshold << "</WntStemThreshold>\n";
319  *rParamsFile << "\t\t\t<WntTransitThreshold>" << mWntTransitThreshold << "</WntTransitThreshold>\n";
320  *rParamsFile << "\t\t\t<WntLabelledThreshold>" << mWntLabelledThreshold << "</WntLabelledThreshold>\n";
321 
322  // Call method on direct parent class
324 }
325 
326 // Serialization for Boost >= 1.36
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
virtual void SetBirthTime(double birthTime)
virtual void SetStemCellG1Duration(double stemCellG1Duration)
void SetMinimumGapDuration(double minimumGapDuration)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
double GetWntLevel(double height)
void SetMDuration(double mDuration)
WntConcentrationType GetWntType()
void SetG2Duration(double g2Duration)
virtual AbstractCellCycleModel * CreateCellCycleModel()
double NormalRandomDeviate(double mean, double stdDev)
WntConcentrationType GetType()
#define NEVER_REACHED
Definition: Exception.hpp:206
void SetDimension(unsigned dimension)
void SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration=true)
static WntConcentration * Instance()
void SetWntTransitThreshold(double wntTransitThreshold)
static RandomNumberGenerator * Instance()
void SetWntLabelledThreshold(double wntLabelledThreshold)
virtual void SetTransitCellG1Duration(double transitCellG1Duration)
#define CHASTE_CLASS_EXPORT(T)
void SetWntStemThreshold(double wntStemThreshold)
void SetSDuration(double sDuration)