Chaste Commit::baa90ac2819b962188b7562f2326be23c47859a7
SimpleWntCellCycleModel.cpp
1/*
2
3Copyright (c) 2005-2024, University of Oxford.
4All rights reserved.
5
6University of Oxford means the Chancellor, Masters and Scholars of the
7University of Oxford, having an administrative office at Wellington
8Square, Oxford OX1 2JD, UK.
9
10This file is part of Chaste.
11
12Redistribution and use in source and binary forms, with or without
13modification, 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
23THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
27LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
32OF 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#include "CellLabel.hpp"
42#include "WildTypeCellMutationState.hpp"
43#include "ApcOneHitCellMutationState.hpp"
44#include "ApcTwoHitCellMutationState.hpp"
45#include "BetaCateninOneHitCellMutationState.hpp"
46
48 : mUseCellProliferativeTypeDependentG1Duration(false),
49 mWntStemThreshold(0.8),
50 mWntTransitThreshold(0.65),
51 mWntLabelledThreshold(0.65)
52{
53}
54
57 mUseCellProliferativeTypeDependentG1Duration(rModel.mUseCellProliferativeTypeDependentG1Duration),
58 mWntStemThreshold(rModel.mWntStemThreshold),
59 mWntTransitThreshold(rModel.mWntTransitThreshold),
60 mWntLabelledThreshold(rModel.mWntLabelledThreshold)
61{
62 /*
63 * Initialize only those member variables defined in this class.
64 *
65 * The member variables mCurrentCellCyclePhase, mG1Duration,
66 * mMinimumGapDuration, mStemCellG1Duration, mTransitCellG1Duration,
67 * mSDuration, mG2Duration and mMDuration are initialized in the
68 * AbstractPhaseBasedCellCycleModel constructor.
69 *
70 * The member variables mBirthTime, mReadyToDivide and mDimension
71 * are initialized in the AbstractCellCycleModel constructor.
72 *
73 * Note that mG1Duration and the cell's proliferative type are
74 * (re)set as soon as InitialiseDaughterCell() is called on the
75 * new cell-cycle model.
76 */
77}
78
83
88
89void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration)
90{
91 mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration;
92}
93
95{
96 assert(mpCell != nullptr);
97
99
100 if (mpCell->GetCellProliferativeType()->IsType<StemCellProliferativeType>())
101 {
103 {
105 }
106 else
107 {
108 // Normally stem cells should behave just like transit cells in a Wnt simulation
110 }
111 }
112 else if (mpCell->GetCellProliferativeType()->IsType<TransitCellProliferativeType>())
113 {
115 }
116 else if (mpCell->GetCellProliferativeType()->IsType<DifferentiatedCellProliferativeType>())
117 {
118 mG1Duration = DBL_MAX;
119 }
120 else
121 {
123 }
124
125 // Check that the normal random deviate has not returned a small or negative G1 duration
127 {
129 }
130}
131
133{
134 assert(mpCell != nullptr);
135 double level = 0;
136
137 switch (mDimension)
138 {
139 case 1:
140 {
141 const unsigned DIM = 1;
143 break;
144 }
145 case 2:
146 {
147 const unsigned DIM = 2;
149 break;
150 }
151 case 3:
152 {
153 const unsigned DIM = 3;
155 break;
156 }
157 default:
159 }
160 return level;
161}
162
164{
165 WntConcentrationType wnt_type;
166 switch (mDimension)
167 {
168 case 1:
169 {
170 const unsigned DIM = 1;
172 break;
173 }
174 case 2:
175 {
176 const unsigned DIM = 2;
178 break;
179 }
180 case 3:
181 {
182 const unsigned DIM = 3;
184 break;
185 }
186 case UNSIGNED_UNSET: // LCOV_EXCL_LINE
187 {
188 // If you trip this you have tried to use a simulation without setting the dimension.
190 }
191 default:
193 }
194 return wnt_type;
195}
196
198{
199 // The cell can divide if the Wnt concentration >= wnt_division_threshold
200 double wnt_division_threshold = DBL_MAX;
201
202 // Set up under what level of Wnt stimulus a cell will divide
203 if (mpCell->GetMutationState()->IsType<WildTypeCellMutationState>())
204 {
205 wnt_division_threshold = mWntTransitThreshold;
206 }
207 else if (mpCell->GetMutationState()->IsType<ApcOneHitCellMutationState>())
208 {
209 // should be less than healthy values
210 wnt_division_threshold = 0.77*mWntTransitThreshold;
211 }
212 else if (mpCell->GetMutationState()->IsType<BetaCateninOneHitCellMutationState>())
213 {
214 // less than above value
215 wnt_division_threshold = 0.155*mWntTransitThreshold;
216 }
217 else if (mpCell->GetMutationState()->IsType<ApcTwoHitCellMutationState>())
218 {
219 // should be zero (no Wnt-dependence)
220 wnt_division_threshold = 0.0;
221 }
222 else
223 {
225 }
226
227 if (mpCell->HasCellProperty<CellLabel>())
228 {
229 wnt_division_threshold = mWntLabelledThreshold;
230 }
231
232 double wnt_level = GetWntLevel();
233 WntConcentrationType wnt_type = GetWntType();
234
235 // Set the cell type to TransitCellProliferativeType if the Wnt stimulus exceeds wnt_division_threshold
236 if (wnt_level >= wnt_division_threshold)
237 {
238 // For a RADIAL Wnt type, override the cell type to StemCellProliferativeType if the Wnt stimulus exceeds a higher threshold
239 if ((wnt_type == RADIAL) && (wnt_level > mWntStemThreshold))
240 {
241 /*
242 * This method is usually called within a CellBasedSimulation, after the CellPopulation
243 * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call
244 * CellPropertyRegistry::Instance() here when setting the CellProliferativeType, we
245 * would be creating a new CellPropertyRegistry. In this case the cell proliferative
246 * type counts, as returned by AbstractCellPopulation::GetCellProliferativeTypeCount(),
247 * would be incorrect. We must therefore access the CellProliferativeType via the cell's
248 * CellPropertyCollection.
249 */
250 boost::shared_ptr<AbstractCellProperty> p_stem_type =
251 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<StemCellProliferativeType>();
252 mpCell->SetCellProliferativeType(p_stem_type);
253 }
254 else
255 {
256 boost::shared_ptr<AbstractCellProperty> p_transit_type =
257 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<TransitCellProliferativeType>();
258 mpCell->SetCellProliferativeType(p_transit_type);
259 }
260 }
261 else
262 {
263 // The cell is set to have DifferentiatedCellProliferativeType and so in G0 phase
264 boost::shared_ptr<AbstractCellProperty> p_diff_type =
265 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<DifferentiatedCellProliferativeType>();
266 mpCell->SetCellProliferativeType(p_diff_type);
267 }
269}
270
272{
273 WntConcentrationType wnt_type = GetWntType();
274
275 if (wnt_type == RADIAL)
276 {
277 boost::shared_ptr<AbstractCellProperty> p_transit_type =
278 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<TransitCellProliferativeType>();
279 mpCell->SetCellProliferativeType(p_transit_type);
280 }
281
283}
284
289
294
296{
297 assert(wntStemThreshold <= 1.0);
298 assert(wntStemThreshold >= 0.0);
299 mWntStemThreshold = wntStemThreshold;
300}
301
306
308{
309 //assert(wntTransitThreshold <= 1.0);
310 //assert(wntTransitThreshold >= 0.0);
311 mWntTransitThreshold = wntTransitThreshold;
312}
313
318
320{
321// assert(wntLabelledThreshold <= 1.0);
322// assert(wntLabelledThreshold >= 0.0);
323 mWntLabelledThreshold = wntLabelledThreshold;
324}
325
327{
328 *rParamsFile << "\t\t\t<UseCellProliferativeTypeDependentG1Duration>" << mUseCellProliferativeTypeDependentG1Duration << "</UseCellProliferativeTypeDependentG1Duration>\n";
329 *rParamsFile << "\t\t\t<WntStemThreshold>" << mWntStemThreshold << "</WntStemThreshold>\n";
330 *rParamsFile << "\t\t\t<WntTransitThreshold>" << mWntTransitThreshold << "</WntTransitThreshold>\n";
331 *rParamsFile << "\t\t\t<WntLabelledThreshold>" << mWntLabelledThreshold << "</WntLabelledThreshold>\n";
332
333 // Call method on direct parent class
335}
336
337// Serialization for Boost >= 1.36
#define NEVER_REACHED
const unsigned UNSIGNED_UNSET
Definition Exception.hpp:53
#define CHASTE_CLASS_EXPORT(T)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
double NormalRandomDeviate(double mean, double stdDev)
static RandomNumberGenerator * Instance()
void SetWntStemThreshold(double wntStemThreshold)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
void SetWntTransitThreshold(double wntTransitThreshold)
virtual AbstractCellCycleModel * CreateCellCycleModel()
void SetWntLabelledThreshold(double wntLabelledThreshold)
void SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration=true)
WntConcentrationType GetWntType()
bool GetUseCellProliferativeTypeDependentG1Duration() const
static WntConcentration * Instance()
WntConcentrationType GetType()
double GetWntLevel(double height)