00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #include "IngeWntSwatCellCycleModel.hpp"
00029 #include "WntConcentration.hpp"
00030
00031
00032 IngeWntSwatCellCycleModel::IngeWntSwatCellCycleModel(const unsigned& rHypothesis,
00033 AbstractOdeSystem* pParentOdeSystem,
00034 const CellMutationState& rMutationState,
00035 double birthTime,
00036 double lastTime,
00037 bool inSG2MPhase,
00038 bool readyToDivide,
00039 double divideTime)
00040 : AbstractWntOdeBasedCellCycleModel(lastTime)
00041 {
00042 if (pParentOdeSystem !=NULL)
00043 {
00044 std::vector<double> parent_protein_concs = pParentOdeSystem->rGetStateVariables();
00045 mpOdeSystem = new IngeWntSwatCellCycleOdeSystem(rHypothesis, parent_protein_concs[8], rMutationState);
00046
00047
00048 mpOdeSystem->rGetStateVariables() = parent_protein_concs;
00049 }
00050 else
00051 {
00052 mpOdeSystem = NULL;
00053 }
00054
00055 if (SimulationTime::Instance()->IsStartTimeSetUp()==false)
00056 {
00057 #define COVERAGE_IGNORE
00058 EXCEPTION("IngeWntSwatCellCycleModel is being created but SimulationTime has not been set up");
00059 #undef COVERAGE_IGNORE
00060 }
00061 mBirthTime = birthTime;
00062 mFinishedRunningOdes = inSG2MPhase;
00063 mReadyToDivide = readyToDivide;
00064 mDivideTime = divideTime;
00065 mHypothesis = rHypothesis;
00066 }
00067
00068
00069 IngeWntSwatCellCycleModel::IngeWntSwatCellCycleModel(const unsigned& rHypothesis,
00070 const std::vector<double>& rParentProteinConcentrations,
00071 const CellMutationState& rMutationState)
00072 {
00073 mHypothesis = rHypothesis;
00074 mpOdeSystem = new IngeWntSwatCellCycleOdeSystem(rHypothesis, rParentProteinConcentrations[21], rMutationState);
00075
00076
00077 mpOdeSystem->rGetStateVariables() = rParentProteinConcentrations;
00078 }
00079
00080
00081 AbstractCellCycleModel* IngeWntSwatCellCycleModel::CreateDaughterCellCycleModel()
00082 {
00083 assert(mpCell!=NULL);
00084
00090 return new IngeWntSwatCellCycleModel(mHypothesis,
00091 mpOdeSystem,
00092 mpCell->GetMutationState(),
00093 mBirthTime,
00094 mLastTime,
00095 mFinishedRunningOdes,
00096 mReadyToDivide,
00097 mDivideTime);
00098 }
00099
00100
00101 void IngeWntSwatCellCycleModel::ChangeCellTypeDueToCurrentBetaCateninLevel()
00102 {
00103 assert(mpOdeSystem!=NULL);
00104 assert(mpCell!=NULL);
00105 double beta_catenin_level = mpOdeSystem->rGetStateVariables()[16]
00106 + mpOdeSystem->rGetStateVariables()[17]
00107 + mpOdeSystem->rGetStateVariables()[18]
00108 + mpOdeSystem->rGetStateVariables()[19];
00109
00110 CellType cell_type = TRANSIT;
00111
00112
00113 if (beta_catenin_level < 10.188)
00114 {
00115 cell_type = DIFFERENTIATED;
00116 }
00117
00118 mpCell->SetCellType(cell_type);
00119 }
00120
00121
00122 void IngeWntSwatCellCycleModel::Initialise()
00123 {
00124 assert(mpOdeSystem==NULL);
00125 assert(mpCell!=NULL);
00126
00127 mpOdeSystem = new IngeWntSwatCellCycleOdeSystem(mHypothesis, WntConcentration::Instance()->GetWntLevel(mpCell), mpCell->GetMutationState());
00128 mpOdeSystem->SetStateVariables(mpOdeSystem->GetInitialConditions());
00129 ChangeCellTypeDueToCurrentBetaCateninLevel();
00130 }
00131
00132
00133 bool IngeWntSwatCellCycleModel::SolveOdeToTime(double currentTime)
00134 {
00135
00136 #ifdef CHASTE_CVODE
00137 const double dt = SimulationTime::Instance()->GetTimeStep();
00138 #else
00139 double dt = 0.00005;
00140 #endif // CHASTE_CVODE
00141
00142
00143 mpOdeSystem->rGetStateVariables()[21] = WntConcentration::Instance()->GetWntLevel(mpCell);
00144
00145
00146 static_cast<IngeWntSwatCellCycleOdeSystem*>(mpOdeSystem)->SetMutationState(mpCell->GetMutationState());
00147
00148 msSolver.SolveAndUpdateStateVariable(mpOdeSystem, mLastTime, currentTime, dt);
00149
00150 mLastTime = currentTime;
00151 UpdateCellType();
00152 return msSolver.StoppingEventOccurred();
00153 }
00154
00155
00156 double IngeWntSwatCellCycleModel::GetMembraneBoundBetaCateninLevel()
00157 {
00158 return mpOdeSystem->rGetStateVariables()[13] + mpOdeSystem->rGetStateVariables()[14];
00159 }
00160
00161
00162 double IngeWntSwatCellCycleModel::GetCytoplasmicBetaCateninLevel()
00163 {
00164 return mpOdeSystem->rGetStateVariables()[7] + mpOdeSystem->rGetStateVariables()[8]
00165 + mpOdeSystem->rGetStateVariables()[9] + mpOdeSystem->rGetStateVariables()[10]
00166 + mpOdeSystem->rGetStateVariables()[11];
00167 }
00168
00169
00170 double IngeWntSwatCellCycleModel::GetNuclearBetaCateninLevel()
00171 {
00172 return mpOdeSystem->rGetStateVariables()[16] +
00173 mpOdeSystem->rGetStateVariables()[17] +
00174 mpOdeSystem->rGetStateVariables()[18] +
00175 mpOdeSystem->rGetStateVariables()[19];
00176 }
00177
00178
00179 unsigned IngeWntSwatCellCycleModel::GetHypothesis() const
00180 {
00181 return mHypothesis;
00182 }