00001 /* 00002 00003 Copyright (C) University of Oxford, 2005-2010 00004 00005 University of Oxford means the Chancellor, Masters and Scholars of the 00006 University of Oxford, having an administrative office at Wellington 00007 Square, Oxford OX1 2JD, UK. 00008 00009 This file is part of Chaste. 00010 00011 Chaste is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU Lesser General Public License as published 00013 by the Free Software Foundation, either version 2.1 of the License, or 00014 (at your option) any later version. 00015 00016 Chaste is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00019 License for more details. The offer of Chaste under the terms of the 00020 License is subject to the License being interpreted in accordance with 00021 English Law and subject to any action against the University of Oxford 00022 being under the jurisdiction of the English Courts. 00023 00024 You should have received a copy of the GNU Lesser General Public License 00025 along with Chaste. If not, see <http://www.gnu.org/licenses/>. 00026 00027 */ 00028 #include "SimpleWntCellCycleModel.hpp" 00029 #include "PetscTools.hpp" 00030 00031 SimpleWntCellCycleModel::SimpleWntCellCycleModel() 00032 : mUseCellProliferativeTypeDependentG1Duration(false), 00033 mWntStemThreshold(0.8), 00034 mWntTransitThreshold(0.65), 00035 mWntLabelledThreshold(0.65) 00036 { 00037 } 00038 00039 00040 AbstractCellCycleModel* SimpleWntCellCycleModel::CreateCellCycleModel() 00041 { 00042 // Create a new cell cycle model 00043 SimpleWntCellCycleModel* p_model = new SimpleWntCellCycleModel(); 00044 00045 // Set the values of the new cell cycle model's member variables 00046 p_model->SetDimension(mDimension); 00047 p_model->SetCellProliferativeType(mCellProliferativeType); 00048 00049 return p_model; 00050 } 00051 00052 00053 void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration) 00054 { 00055 mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration; 00056 } 00057 00058 00059 void SimpleWntCellCycleModel::SetG1Duration() 00060 { 00061 assert(mpCell != NULL); 00062 00063 RandomNumberGenerator* p_gen = RandomNumberGenerator::Instance(); 00064 00065 switch (mCellProliferativeType) 00066 { 00067 case STEM: 00068 if (mUseCellProliferativeTypeDependentG1Duration) 00069 { 00070 mG1Duration = p_gen->NormalRandomDeviate(GetStemCellG1Duration(), 1.0); 00071 } 00072 else 00073 { 00074 // Normally stem cells should behave just like transit cells in a Wnt simulation 00075 mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0); 00076 } 00077 break; 00078 case TRANSIT: 00079 mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0); 00080 break; 00081 case DIFFERENTIATED: 00082 mG1Duration = DBL_MAX; 00083 break; 00084 default: 00085 NEVER_REACHED; 00086 } 00087 00088 // Check that the normal random deviate has not returned a small or negative G1 duration 00089 if (mG1Duration < mMinimumGapDuration) 00090 { 00091 mG1Duration = mMinimumGapDuration; 00092 } 00093 } 00094 00095 00096 double SimpleWntCellCycleModel::GetWntLevel() 00097 { 00098 assert(mpCell != NULL); 00099 double level = 0; 00100 00101 switch (mDimension) 00102 { 00103 case 1: 00104 { 00105 const unsigned DIM = 1; 00106 level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell); 00107 break; 00108 } 00109 case 2: 00110 { 00111 const unsigned DIM = 2; 00112 level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell); 00113 break; 00114 } 00115 case 3: 00116 { 00117 const unsigned DIM = 3; 00118 level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell); 00119 break; 00120 } 00121 default: 00122 NEVER_REACHED; 00123 } 00124 return level; 00125 } 00126 00127 00128 WntConcentrationType SimpleWntCellCycleModel::GetWntType() 00129 { 00130 WntConcentrationType wnt_type; 00131 switch (mDimension) 00132 { 00133 case 1: 00134 { 00135 const unsigned DIM = 1; 00136 wnt_type = WntConcentration<DIM>::Instance()->GetType(); 00137 break; 00138 } 00139 case 2: 00140 { 00141 const unsigned DIM = 2; 00142 wnt_type = WntConcentration<DIM>::Instance()->GetType(); 00143 break; 00144 } 00145 case 3: 00146 { 00147 const unsigned DIM = 3; 00148 wnt_type = WntConcentration<DIM>::Instance()->GetType(); 00149 break; 00150 } 00151 default: 00152 NEVER_REACHED; 00153 } 00154 return wnt_type; 00155 } 00156 00157 00158 void SimpleWntCellCycleModel::UpdateCellCyclePhase() 00159 { 00160 // The cell can divide if the Wnt concentration >= wnt_division_threshold 00161 double wnt_division_threshold = DBL_MAX; 00162 00163 // Set up under what level of Wnt stimulus a cell will divide 00164 double healthy_threshold = mWntTransitThreshold; 00165 double labelled_threshold = mWntLabelledThreshold; 00166 00167 if (mpCell->GetMutationState()->IsType<WildTypeCellMutationState>()) 00168 { 00169 wnt_division_threshold = healthy_threshold; 00170 } 00171 else if (mpCell->GetMutationState()->IsType<ApcOneHitCellMutationState>()) 00172 { 00173 // should be less than healthy values 00174 wnt_division_threshold = 0.77*healthy_threshold; 00175 } 00176 else if (mpCell->GetMutationState()->IsType<BetaCateninOneHitCellMutationState>()) 00177 { 00178 // less than above value 00179 wnt_division_threshold = 0.155*healthy_threshold; 00180 } 00181 else if (mpCell->GetMutationState()->IsType<ApcTwoHitCellMutationState>()) 00182 { 00183 // should be zero (no Wnt-dependence) 00184 wnt_division_threshold = 0.0; 00185 } 00186 else 00187 { 00188 NEVER_REACHED; 00189 } 00190 00191 if (mpCell->HasCellProperty<CellLabel>()) 00192 { 00193 wnt_division_threshold = labelled_threshold; 00194 } 00195 00196 double wnt_level = GetWntLevel(); 00197 WntConcentrationType wnt_type = GetWntType(); 00198 00199 // Set the cell type to TRANSIT if the Wnt stimulus exceeds wnt_division_threshold 00200 if (wnt_level >= wnt_division_threshold) 00201 { 00202 CellProliferativeType cell_type = TRANSIT; 00203 00204 // For a RADIAL Wnt type, override the cell type to STEM if the Wnt stimulus exceeds a higher threshold 00205 if ( (wnt_type == RADIAL) && (wnt_level > mWntStemThreshold) ) 00206 { 00207 cell_type = STEM; 00208 } 00209 00210 mCellProliferativeType = cell_type; 00211 } 00212 else 00213 { 00214 // The cell is DIFFERENTIATED and so in G0 phase 00215 mCellProliferativeType = DIFFERENTIATED; 00216 } 00217 AbstractSimpleCellCycleModel::UpdateCellCyclePhase(); 00218 } 00219 00220 void SimpleWntCellCycleModel::InitialiseDaughterCell() 00221 { 00222 WntConcentrationType wnt_type = GetWntType(); 00223 00224 if (wnt_type == RADIAL) 00225 { 00226 mCellProliferativeType = TRANSIT; 00227 } 00228 00229 AbstractSimpleCellCycleModel::InitialiseDaughterCell(); 00230 } 00231 00232 bool SimpleWntCellCycleModel::CanCellTerminallyDifferentiate() 00233 { 00234 return false; 00235 } 00236 00237 double SimpleWntCellCycleModel::GetWntStemThreshold() 00238 { 00239 return mWntStemThreshold; 00240 } 00241 00242 void SimpleWntCellCycleModel::SetWntStemThreshold(double wntStemThreshold) 00243 { 00244 assert(wntStemThreshold <= 1.0); 00245 assert(wntStemThreshold >= 0.0); 00246 mWntStemThreshold = wntStemThreshold; 00247 } 00248 00249 double SimpleWntCellCycleModel::GetWntTransitThreshold() 00250 { 00251 return mWntTransitThreshold; 00252 } 00253 00254 void SimpleWntCellCycleModel::SetWntTransitThreshold(double wntTransitThreshold) 00255 { 00256 assert(wntTransitThreshold <= 1.0); 00257 assert(wntTransitThreshold >= 0.0); 00258 mWntTransitThreshold = wntTransitThreshold; 00259 } 00260 00261 double SimpleWntCellCycleModel::GetWntLabelledThreshold() 00262 { 00263 return mWntLabelledThreshold; 00264 } 00265 00266 void SimpleWntCellCycleModel::SetWntLabelledThreshold(double wntLabelledThreshold) 00267 { 00268 assert(wntLabelledThreshold <= 1.0); 00269 assert(wntLabelledThreshold >= 0.0); 00270 mWntLabelledThreshold = wntLabelledThreshold; 00271 } 00272 00273 // Serialization for Boost >= 1.36 00274 #include "SerializationExportWrapperForCpp.hpp" 00275 CHASTE_CLASS_EXPORT(SimpleWntCellCycleModel)