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 "UblasIncludes.hpp"
00029 #include "IngeWntSwatCellCycleModel.hpp"
00030
00031
00032 IngeWntSwatCellCycleModel::IngeWntSwatCellCycleModel(unsigned hypothesis, unsigned dimension)
00033 : AbstractWntOdeBasedCellCycleModel(dimension),
00034 mHypothesis(hypothesis)
00035 {
00036 if ( !(mHypothesis==1u || mHypothesis==2u) )
00037 {
00038 EXCEPTION("Model must be set up with argument(hypothesis) = 1u or 2u");
00039 }
00040 }
00041
00042
00043 IngeWntSwatCellCycleModel::IngeWntSwatCellCycleModel(const IngeWntSwatCellCycleModel& rOtherModel)
00044 : AbstractWntOdeBasedCellCycleModel(rOtherModel),
00045 mHypothesis(rOtherModel.mHypothesis)
00046 {
00047 if (rOtherModel.mpOdeSystem != NULL)
00048 {
00049 mpOdeSystem = new IngeWntSwatCellCycleOdeSystem(*static_cast<IngeWntSwatCellCycleOdeSystem*>(rOtherModel.mpOdeSystem));
00050 }
00051 }
00052
00053
00054 IngeWntSwatCellCycleModel::IngeWntSwatCellCycleModel(const unsigned& rHypothesis,
00055 const std::vector<double>& rParentProteinConcentrations,
00056 const CellMutationState& rMutationState,
00057 const unsigned& rDimension)
00058 : AbstractWntOdeBasedCellCycleModel(rDimension)
00059 {
00060 mHypothesis = rHypothesis;
00061 mpOdeSystem = new IngeWntSwatCellCycleOdeSystem(rHypothesis, rParentProteinConcentrations[21], rMutationState);
00062
00063
00064 mpOdeSystem->rGetStateVariables() = rParentProteinConcentrations;
00065 }
00066
00067
00068 AbstractCellCycleModel* IngeWntSwatCellCycleModel::CreateCellCycleModel()
00069 {
00070 return new IngeWntSwatCellCycleModel(*this);
00071 }
00072
00073
00074 void IngeWntSwatCellCycleModel::ChangeCellTypeDueToCurrentBetaCateninLevel()
00075 {
00076 assert(mpOdeSystem!=NULL);
00077 assert(mpCell!=NULL);
00078 double beta_catenin_level = mpOdeSystem->rGetStateVariables()[16]
00079 + mpOdeSystem->rGetStateVariables()[17]
00080 + mpOdeSystem->rGetStateVariables()[18]
00081 + mpOdeSystem->rGetStateVariables()[19];
00082
00083 CellType cell_type = TRANSIT;
00084
00085
00086 if (beta_catenin_level < 10.188)
00087 {
00088 cell_type = DIFFERENTIATED;
00089 }
00090
00091 mpCell->SetCellType(cell_type);
00092 }
00093
00094
00095 void IngeWntSwatCellCycleModel::Initialise()
00096 {
00097 assert(mpOdeSystem==NULL);
00098 assert(mpCell!=NULL);
00099
00100 double wnt_level = GetWntLevel();
00101
00102 mpOdeSystem = new IngeWntSwatCellCycleOdeSystem(mHypothesis, wnt_level, mpCell->GetMutationState());
00103 mpOdeSystem->SetStateVariables(mpOdeSystem->GetInitialConditions());
00104
00105 ChangeCellTypeDueToCurrentBetaCateninLevel();
00106 }
00107
00108
00109 bool IngeWntSwatCellCycleModel::SolveOdeToTime(double currentTime)
00110 {
00111
00112 #ifdef CHASTE_CVODE
00113 const double dt = SimulationTime::Instance()->GetTimeStep();
00114 #else
00115 double dt = 0.00005;
00116 #endif // CHASTE_CVODE
00117
00118
00119 mpOdeSystem->rGetStateVariables()[21] = GetWntLevel();
00120
00121
00122 static_cast<IngeWntSwatCellCycleOdeSystem*>(mpOdeSystem)->SetMutationState(mpCell->GetMutationState());
00123
00124 msSolver.SolveAndUpdateStateVariable(mpOdeSystem, mLastTime, currentTime, dt);
00125
00126 mLastTime = currentTime;
00127 UpdateCellType();
00128 return msSolver.StoppingEventOccurred();
00129 }
00130
00131
00132 double IngeWntSwatCellCycleModel::GetMembraneBoundBetaCateninLevel()
00133 {
00134 return mpOdeSystem->rGetStateVariables()[13] + mpOdeSystem->rGetStateVariables()[14];
00135 }
00136
00137
00138 double IngeWntSwatCellCycleModel::GetCytoplasmicBetaCateninLevel()
00139 {
00140 return mpOdeSystem->rGetStateVariables()[7] + mpOdeSystem->rGetStateVariables()[8]
00141 + mpOdeSystem->rGetStateVariables()[9] + mpOdeSystem->rGetStateVariables()[10]
00142 + mpOdeSystem->rGetStateVariables()[11];
00143 }
00144
00145
00146 double IngeWntSwatCellCycleModel::GetNuclearBetaCateninLevel()
00147 {
00148 return mpOdeSystem->rGetStateVariables()[16] +
00149 mpOdeSystem->rGetStateVariables()[17] +
00150 mpOdeSystem->rGetStateVariables()[18] +
00151 mpOdeSystem->rGetStateVariables()[19];
00152 }
00153
00154
00155 unsigned IngeWntSwatCellCycleModel::GetHypothesis() const
00156 {
00157 return mHypothesis;
00158 }