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 00030 SimpleWntCellCycleModel::SimpleWntCellCycleModel() 00031 : mUseCellProliferativeTypeDependentG1Duration(false) 00032 { 00033 } 00034 00035 00036 AbstractCellCycleModel* SimpleWntCellCycleModel::CreateCellCycleModel() 00037 { 00038 return new SimpleWntCellCycleModel(*this); 00039 } 00040 00041 00042 void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration) 00043 { 00044 mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration; 00045 } 00046 00047 00048 void SimpleWntCellCycleModel::SetG1Duration() 00049 { 00050 assert(mpCell!=NULL); 00051 00052 TissueConfig* p_params = TissueConfig::Instance(); 00053 RandomNumberGenerator* p_gen = RandomNumberGenerator::Instance(); 00054 00055 switch (mpCell->GetCellProliferativeType()) 00056 { 00057 case STEM: 00058 if (mUseCellProliferativeTypeDependentG1Duration) 00059 { 00060 mG1Duration = p_gen->NormalRandomDeviate(p_params->GetStemCellG1Duration(), 1.0); 00061 } 00062 else 00063 { 00064 // Normally stem cells should behave just like transit cells in a Wnt simulation 00065 mG1Duration = p_gen->NormalRandomDeviate(p_params->GetTransitCellG1Duration(), 1.0); 00066 } 00067 break; 00068 case TRANSIT: 00069 mG1Duration = p_gen->NormalRandomDeviate(p_params->GetTransitCellG1Duration(), 1.0); 00070 break; 00071 case DIFFERENTIATED: 00072 mG1Duration = DBL_MAX; 00073 break; 00074 default: 00075 NEVER_REACHED; 00076 } 00077 00078 // Check that the normal random deviate has not returned a small or negative G1 duration 00079 if (mG1Duration < p_params->GetMinimumGapDuration()) 00080 { 00081 mG1Duration = p_params->GetMinimumGapDuration(); 00082 } 00083 } 00084 00085 00086 double SimpleWntCellCycleModel::GetWntLevel() 00087 { 00088 assert(mpCell != NULL); 00089 double level = 0; 00090 00091 switch (mDimension) 00092 { 00093 case 1: 00094 { 00095 const unsigned DIM = 1; 00096 level = WntConcentration<DIM>::Instance()->GetWntLevel(*mpCell); 00097 break; 00098 } 00099 case 2: 00100 { 00101 const unsigned DIM = 2; 00102 level = WntConcentration<DIM>::Instance()->GetWntLevel(*mpCell); 00103 break; 00104 } 00105 case 3: 00106 { 00107 const unsigned DIM = 3; 00108 level = WntConcentration<DIM>::Instance()->GetWntLevel(*mpCell); 00109 break; 00110 } 00111 default: 00112 NEVER_REACHED; 00113 } 00114 return level; 00115 } 00116 00117 00118 WntConcentrationType SimpleWntCellCycleModel::GetWntType() 00119 { 00120 WntConcentrationType wnt_type; 00121 switch (mDimension) 00122 { 00123 case 1: 00124 { 00125 const unsigned DIM = 1; 00126 wnt_type = WntConcentration<DIM>::Instance()->GetType(); 00127 break; 00128 } 00129 case 2: 00130 { 00131 const unsigned DIM = 2; 00132 wnt_type = WntConcentration<DIM>::Instance()->GetType(); 00133 break; 00134 } 00135 case 3: 00136 { 00137 const unsigned DIM = 3; 00138 wnt_type = WntConcentration<DIM>::Instance()->GetType(); 00139 break; 00140 } 00141 default: 00142 NEVER_REACHED; 00143 } 00144 return wnt_type; 00145 } 00146 00147 00148 void SimpleWntCellCycleModel::UpdateCellCyclePhase() 00149 { 00150 TissueConfig* p_params = TissueConfig::Instance(); 00151 00152 // The cell can divide if the Wnt concentration >= wnt_division_threshold 00153 double wnt_division_threshold = DBL_MAX; 00154 00155 // Set up under what level of Wnt stimulus a cell will divide 00156 double healthy_threshold = p_params->GetWntTransitThreshold(); 00157 double labelled_threshold = p_params->GetWntLabelledThreshold(); 00158 00159 if (mpCell->GetMutationState()->IsType<WildTypeCellMutationState>()) 00160 { 00161 wnt_division_threshold = healthy_threshold; 00162 } 00163 else if (mpCell->GetMutationState()->IsType<LabelledCellMutationState>()) 00164 { 00165 wnt_division_threshold = labelled_threshold; 00166 } 00167 else if (mpCell->GetMutationState()->IsType<ApcOneHitCellMutationState>()) 00168 { 00169 // should be less than healthy values 00170 wnt_division_threshold = 0.77*healthy_threshold; 00171 } 00172 else if (mpCell->GetMutationState()->IsType<BetaCateninOneHitCellMutationState>()) 00173 { 00174 // less than above value 00175 wnt_division_threshold = 0.155*healthy_threshold; 00176 } 00177 else if (mpCell->GetMutationState()->IsType<ApcTwoHitCellMutationState>()) 00178 { 00179 // should be zero (no Wnt-dependence) 00180 wnt_division_threshold = 0.0; 00181 } 00182 else 00183 { 00184 NEVER_REACHED; 00185 } 00186 00187 double wnt_level = GetWntLevel(); 00188 WntConcentrationType wnt_type = GetWntType(); 00189 00190 // Set the cell type to TRANSIT if the Wnt stimulus exceeds wnt_division_threshold 00191 if (wnt_level >= wnt_division_threshold) 00192 { 00193 CellProliferativeType cell_type = TRANSIT; 00194 00195 // For a RADIAL Wnt type, override the cell type to STEM if the Wnt stimulus exceeds a higher threshold 00196 if ( (wnt_type == RADIAL) && (wnt_level > p_params->GetWntStemThreshold()) ) 00197 { 00198 cell_type = STEM; 00199 } 00200 00201 mpCell->SetCellProliferativeType(cell_type); 00202 } 00203 else 00204 { 00205 // The cell is DIFFERENTIATED and so in G0 phase 00206 mpCell->SetCellProliferativeType(DIFFERENTIATED); 00207 } 00208 AbstractSimpleCellCycleModel::UpdateCellCyclePhase(); 00209 } 00210 00211 void SimpleWntCellCycleModel::InitialiseDaughterCell() 00212 { 00213 WntConcentrationType wnt_type = GetWntType(); 00214 00215 if (wnt_type == RADIAL) 00216 { 00217 mpCell->SetCellProliferativeType(TRANSIT); 00218 } 00219 00220 AbstractSimpleCellCycleModel::InitialiseDaughterCell(); 00221 } 00222 00223 bool SimpleWntCellCycleModel::CanCellTerminallyDifferentiate() 00224 { 00225 return false; 00226 } 00227 00228 // Serialization for Boost >= 1.36 00229 #include "SerializationExportWrapperForCpp.hpp" 00230 CHASTE_CLASS_EXPORT(SimpleWntCellCycleModel)