36 #include "Owen2011OxygenBasedCellCycleModel.hpp" 37 #include "WildTypeCellMutationState.hpp" 38 #include "CancerCellMutationState.hpp" 39 #include "QuiescentCancerCellMutationState.hpp" 40 #include "ApoptoticCellProperty.hpp" 41 #include "TipCellMutationState.hpp" 42 #include "StalkCellMutationState.hpp" 43 #include "CellPropertyRegistry.hpp" 44 #include "CellLabel.hpp" 45 #include "Exception.hpp" 46 #include "SimulationTime.hpp" 47 #include "CellCycleModelOdeHandler.hpp" 48 #include "CvodeAdaptor.hpp" 49 #include "RandomNumberGenerator.hpp" 50 #include "AbstractPhaseBasedCellCycleModel.hpp" 51 #include "Secomb04Parameters.hpp" 52 #include "GenericParameters.hpp" 53 #include "Owen11Parameters.hpp" 54 #include "BaseUnits.hpp" 58 mOdeIntegrationTimeStep(30.0*
unit::minutes),
62 mReferenceTimeScale(
BaseUnits::Instance()->GetReferenceTimeScale()),
63 mReferenceConcentrationScale(
BaseUnits::Instance()->GetReferenceConcentrationScale()),
64 mMaxRandInitialPhase(0.99),
65 mCurrentQuiescentDuration(0.0*
unit::seconds),
66 mCurrentQuiescenceOnsetTime(0.0*
unit::seconds),
67 mEnterQuiescenceOxygenConcentration(
Owen11Parameters::mpOxygenPartialPressureAtQuiescence->GetValue(
"Owen2011OxygenBasedCellCycleModel")),
68 mLeaveQuiescenceOxygenConcentration(
Owen11Parameters::mpOxygenPartialPressureLeaveQuiescence->GetValue(
"Owen2011OxygenBasedCellCycleModel")),
69 mCriticalQuiescentDuration(
Owen11Parameters::mpTimeToDeathDueToQuiescence->GetValue(
"Owen2011OxygenBasedCellCycleModel")),
70 mp53ThresholdForApoptosisOfNormalCellsInHealthyMicroenvironment(0.8),
71 mp53ThresholdForApoptosisOfNormalCellsInTumourMicroenvironment(0.08),
72 mthresholdFractionOfNormalCellNeighbours(0.75)
76 mpOdeSolver = CellCycleModelOdeSolver<Owen2011OxygenBasedCellCycleModel, CvodeAdaptor>::Instance();
77 mpOdeSolver->Initialise();
90 mpOdeSystem->rGetStateVariables()[3] = mpCell->GetCellData()->GetItem(
"oxygen");
98 assert(mpCell->GetMutationState()->IsType<
CancerCellMutationState>() || mpCell->GetMutationState()->IsType<WildTypeCellMutationState>());
106 mpCell->SetMutationState(CellPropertyRegistry::Instance()->Get<QuiescentCancerCellMutationState>());
110 mCurrentCellCyclePhase = G_ZERO_PHASE;
115 double p53_concentration = mpCell->GetCellData()->GetItem(
"p53");
116 double p53threshold = 0.0;
117 unsigned number_of_normal_neighbours = mpCell->GetCellData()->GetItem(
"Number_of_normal_neighbours");
118 unsigned number_of_cancerous_neighbours = mpCell->GetCellData()->GetItem(
"Number_of_cancerous_neighbours");
119 double normal_neighbour_fraction = double(number_of_normal_neighbours)/double(number_of_cancerous_neighbours+number_of_normal_neighbours);
128 if(p53_concentration > p53threshold)
130 assert(mpCell->GetMutationState()->IsType<WildTypeCellMutationState>());
131 mpCell->AddCellProperty(CellPropertyRegistry::Instance()->Get<ApoptoticCellProperty>());
152 p_model->SetBirthTime(mBirthTime);
153 p_model->SetDimension(mDimension);
154 p_model->SetMinimumGapDuration(mMinimumGapDuration);
155 p_model->SetStemCellG1Duration(mStemCellG1Duration);
156 p_model->SetTransitCellG1Duration(mTransitCellG1Duration);
157 p_model->SetSDuration(mSDuration);
158 p_model->SetG2Duration(mG2Duration);
159 p_model->SetMDuration(mMDuration);
160 p_model->SetLastTime(mLastTime);
175 mpCell->GetMutationState()));
176 p_model->SetStateVariables(mpOdeSystem->rGetStateVariables());
198 assert(mpOdeSystem != NULL);
199 double phi = mpOdeSystem->rGetStateVariables()[0];
205 assert(mpOdeSystem != NULL);
206 double VEGF = mpOdeSystem->rGetStateVariables()[2];
212 assert(mpOdeSystem != NULL);
213 double p53 = mpOdeSystem->rGetStateVariables()[1];
244 assert(mpOdeSystem == NULL);
245 assert(mpCell != NULL);
248 mpCell->GetMutationState());
250 mpCell->SetBirthTime(SimulationTime::Instance()->GetTime());
251 std::vector<double> init_conds = mpOdeSystem->GetInitialConditions();
253 init_conds[3] = mpCell->GetCellData()->GetItem(
"oxygen");
255 mpOdeSystem->SetStateVariables(init_conds);
260 mpOdeSystem->rGetStateVariables()[0] = mpOdeSystem->GetInitialConditions()[0];
261 mCurrentCellCyclePhase = G_ONE_PHASE;
271 AbstractOdeBasedPhaseBasedCellCycleModel::OutputCellCycleModelParameters(rParamsFile);
276 assert(mpOdeSystem != NULL);
277 assert(mFinishedRunningOdes);
278 assert(mReadyToDivide);
279 mReadyToDivide =
false;
280 mFinishedRunningOdes =
false;
283 mpOdeSystem->rGetStateVariables()[0] = mpOdeSystem->GetInitialConditions()[0];
284 mpOdeSystem->rGetStateVariables()[1] = mpOdeSystem->GetInitialConditions()[1];
285 mpOdeSystem->rGetStateVariables()[2] = mpOdeSystem->GetInitialConditions()[2];
288 mpCell->SetMutationState(mpCell->GetMutationState());
289 mCurrentCellCyclePhase = G_ONE_PHASE;
296 mReadyToDivide =
false;
300 if(!mpCell->HasApoptosisBegun() && !mpCell->IsDead())
303 if(mFinishedRunningOdes)
305 mReadyToDivide =
true;
309 mReadyToDivide =
false;
314 mReadyToDivide =
false;
317 return mReadyToDivide;
353 assert(rand_max_phase >= 0.0);
359 assert(enterQuiescenceOxygenConcentration>=0.0*unit::pascals);
365 assert(leaveQuiescenceOxygenConcentration >= 0.0*unit::pascals);
371 assert(criticalQuiescentDuration >= 0.0*unit::seconds);
377 assert(currentQuiescenceOnsetTime >= 0.0*unit::seconds);
388 assert(!mpCell->HasApoptosisBegun());
389 assert(!mpCell->IsDead());
398 if(mpCell->GetMutationState()->IsType<
CancerCellMutationState>() || mpCell->GetMutationState()->IsType<WildTypeCellMutationState>())
410 mpOdeSolver->CheckForStoppingEvents();
412 assert(mpOdeSystem != NULL);
413 double current_time = SimulationTime::Instance()->GetTime();
416 mFinishedRunningOdes = SolveOdeToTime(current_time);
419 for (
unsigned i=0; i<mpOdeSystem->GetNumberOfStateVariables(); i++)
421 if (mpOdeSystem->rGetStateVariables()[i] < -DBL_EPSILON)
423 EXCEPTION(
"A protein concentration " << i <<
" has gone negative (" << mpOdeSystem->rGetStateVariables()[i] <<
")\n" 424 <<
"A CellCycleModel numerical method is probably unstable.");
428 if(mCurrentCellCyclePhase != G_ZERO_PHASE)
430 if(mpOdeSystem->rGetStateVariables()[0]<
sOnset)
432 mCurrentCellCyclePhase = G_ONE_PHASE;
434 else if(mpOdeSystem->rGetStateVariables()[0]<
g2Onset)
436 mCurrentCellCyclePhase = S_PHASE;
438 else if(mpOdeSystem->rGetStateVariables()[0]<
mOnset)
440 mCurrentCellCyclePhase = G_TWO_PHASE;
444 mCurrentCellCyclePhase = M_PHASE;
452 assert(!(mpCell->HasCellProperty<ApoptoticCellProperty>()));
453 assert(!mpCell->HasApoptosisBegun());
463 mpCell->AddCellProperty(CellPropertyRegistry::Instance()->Get<ApoptoticCellProperty>());
471 mCurrentCellCyclePhase = G_ONE_PHASE;
472 mpCell->SetMutationState(CellPropertyRegistry::Instance()->Get<CancerCellMutationState>());
477 #include "SerializationExportWrapperForCpp.hpp" 479 #include "CellCycleModelOdeSolverExportWrapper.hpp" void SetReferenceConcentrationScale(units::quantity< unit::concentration > referenceConcentrationScale)
double GetSDuration() const
units::quantity< unit::time > GetCurrentQuiescenceOnsetTime()
void SetThresholdFractionOfNormalCellNeighbours(double value)
units::quantity< unit::solubility > mReferenceSolubility
double GetMDuration() const
void SetLeaveQuiescenceOxygenConcentration(units::quantity< unit::pressure > leaveQuiescenceOxygenConcentration)
void SetOdeSolverTimeStep(units::quantity< unit::time > timeStep)
units::quantity< unit::dimensionless > sOnset
units::quantity< unit::time > mCurrentQuiescentDuration
units::quantity< unit::concentration > mReferenceConcentrationScale
AbstractCellCycleModel * CreateCellCycleModel()
units::quantity< unit::time > mCurrentQuiescenceOnsetTime
units::quantity< unit::time > mOdeIntegrationTimeStep
void SetMOnset(units::quantity< unit::dimensionless > value)
units::quantity< unit::time > GetCurrentQuiescentDuration()
units::quantity< unit::dimensionless > mp53ThresholdForApoptosisOfNormalCellsInTumourMicroenvironment
void SetCriticalQuiescentDuration(units::quantity< unit::time > criticalQuiescentDuration)
virtual void OutputCellCycleModelParameters(out_stream &rParamsFile)
void SetEnterQuiescenceOxygenConcentration(units::quantity< unit::pressure > enterQuiescenceOxygenConcentration)
void UpdateCellCyclePhase()
void AdjustOdeParameters(double currentTime)
units::quantity< unit::pressure > GetEnterQuiescenceOxygenConcentration()
units::quantity< unit::dimensionless > g2Onset
units::quantity< unit::pressure > GetLeaveQuiescenceOxygenConcentration()
units::quantity< unit::dimensionless > mMaxRandInitialPhase
Owen2011OxygenBasedCellCycleModel(boost::shared_ptr< AbstractCellCycleModelOdeSolver > pOdeSolver=boost::shared_ptr< AbstractCellCycleModelOdeSolver >())
virtual void ResetForDivision()
void SetSOnset(units::quantity< unit::dimensionless > value)
units::quantity< unit::dimensionless > mthresholdFractionOfNormalCellNeighbours
units::quantity< unit::time > GetCriticalQuiescentDuration()
static const boost::shared_ptr< ParameterInstance< unit::volumetric_solubility > > mpOxygenVolumetricSolubility
void SetReferenceTimeScale(units::quantity< unit::time > referenceTimeScale)
void SetG2Onset(units::quantity< unit::dimensionless > value)
units::quantity< unit::dimensionless > mp53ThresholdForApoptosisOfNormalCellsInHealthyMicroenvironment
double GetG2Duration() const
void UpdateQuiescentDuration()
void SetCurrentQuiescenceOnsetTime(units::quantity< unit::time > currentQuiescenceOnsetTime)
units::quantity< unit::pressure > mEnterQuiescenceOxygenConcentration
units::quantity< unit::dimensionless > mOnset
units::quantity< unit::pressure > mLeaveQuiescenceOxygenConcentration
units::quantity< unit::time > mReferenceTimeScale
void SetMaxRandInitialPhase(units::quantity< unit::dimensionless > rand_max_phase)
units::quantity< unit::time > mCriticalQuiescentDuration
static const boost::shared_ptr< ParameterInstance< unit::concentration > > mpGasConcentrationAtStp
void InitialiseDaughterCell()