SimpleWntCellCycleModel.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2011
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     /*
00046      * Set each member variable of the new cell-cycle model that inherits
00047      * its value from the parent.
00048      * 
00049      * Note 1: some of the new cell-cycle model's member variables (namely
00050      * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide) will already have been
00051      * correctly initialized in its constructor.
00052      * 
00053      * Note 2: one or more of the new cell-cycle model's member variables
00054      * may be set/overwritten as soon as InitialiseDaughterCell() is called on
00055      * the new cell-cycle model.
00056      */
00057     p_model->SetBirthTime(mBirthTime);
00058     p_model->SetDimension(mDimension);
00059     p_model->SetCellProliferativeType(mCellProliferativeType);
00060     p_model->SetMinimumGapDuration(mMinimumGapDuration);
00061     p_model->SetStemCellG1Duration(mStemCellG1Duration);
00062     p_model->SetTransitCellG1Duration(mTransitCellG1Duration);
00063     p_model->SetSDuration(mSDuration);
00064     p_model->SetG2Duration(mG2Duration);
00065     p_model->SetMDuration(mMDuration);
00066     p_model->SetUseCellProliferativeTypeDependentG1Duration(mUseCellProliferativeTypeDependentG1Duration);
00067     p_model->SetWntStemThreshold(mWntStemThreshold);
00068     p_model->SetWntTransitThreshold(mWntTransitThreshold);
00069     p_model->SetWntLabelledThreshold(mWntLabelledThreshold);
00070 
00071     return p_model;
00072 }
00073 
00074 
00075 void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration)
00076 {
00077     mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration;
00078 }
00079 
00080 
00081 void SimpleWntCellCycleModel::SetG1Duration()
00082 {
00083     assert(mpCell != NULL);
00084 
00085     RandomNumberGenerator* p_gen = RandomNumberGenerator::Instance();
00086 
00087     switch (mCellProliferativeType)
00088     {
00089         case STEM:
00090             if (mUseCellProliferativeTypeDependentG1Duration)
00091             {
00092                 mG1Duration = p_gen->NormalRandomDeviate(GetStemCellG1Duration(), 1.0);
00093             }
00094             else
00095             {
00096                 // Normally stem cells should behave just like transit cells in a Wnt simulation
00097                 mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0);
00098             }
00099             break;
00100         case TRANSIT:
00101             mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0);
00102             break;
00103         case DIFFERENTIATED:
00104             mG1Duration = DBL_MAX;
00105             break;
00106         default:
00107             NEVER_REACHED;
00108     }
00109 
00110     // Check that the normal random deviate has not returned a small or negative G1 duration
00111     if (mG1Duration < mMinimumGapDuration)
00112     {
00113         mG1Duration = mMinimumGapDuration;
00114     }
00115 }
00116 
00117 
00118 double SimpleWntCellCycleModel::GetWntLevel()
00119 {
00120     assert(mpCell != NULL);
00121     double level = 0;
00122 
00123     switch (mDimension)
00124     {
00125         case 1:
00126         {
00127             const unsigned DIM = 1;
00128             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00129             break;
00130         }
00131         case 2:
00132         {
00133             const unsigned DIM = 2;
00134             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00135             break;
00136         }
00137         case 3:
00138         {
00139             const unsigned DIM = 3;
00140             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00141             break;
00142         }
00143         default:
00144             NEVER_REACHED;
00145     }
00146     return level;
00147 }
00148 
00149 
00150 WntConcentrationType SimpleWntCellCycleModel::GetWntType()
00151 {
00152     WntConcentrationType wnt_type;
00153     switch (mDimension)
00154     {
00155         case 1:
00156         {
00157             const unsigned DIM = 1;
00158             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00159             break;
00160         }
00161         case 2:
00162         {
00163             const unsigned DIM = 2;
00164             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00165             break;
00166         }
00167         case 3:
00168         {
00169             const unsigned DIM = 3;
00170             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00171             break;
00172         }
00173         default:
00174             NEVER_REACHED;
00175     }
00176     return wnt_type;
00177 }
00178 
00179 
00180 void SimpleWntCellCycleModel::UpdateCellCyclePhase()
00181 {
00182     // The cell can divide if the Wnt concentration >= wnt_division_threshold
00183     double wnt_division_threshold = DBL_MAX;
00184 
00185     // Set up under what level of Wnt stimulus a cell will divide
00186     double healthy_threshold = mWntTransitThreshold;
00187     double labelled_threshold = mWntLabelledThreshold;
00188 
00189     if (mpCell->GetMutationState()->IsType<WildTypeCellMutationState>())
00190     {
00191         wnt_division_threshold = healthy_threshold;
00192     }
00193     else if (mpCell->GetMutationState()->IsType<ApcOneHitCellMutationState>())
00194     {
00195         // should be less than healthy values
00196         wnt_division_threshold = 0.77*healthy_threshold;
00197     }
00198     else if (mpCell->GetMutationState()->IsType<BetaCateninOneHitCellMutationState>())
00199     {
00200         // less than above value
00201         wnt_division_threshold = 0.155*healthy_threshold;
00202     }
00203     else if (mpCell->GetMutationState()->IsType<ApcTwoHitCellMutationState>())
00204     {
00205         // should be zero (no Wnt-dependence)
00206         wnt_division_threshold = 0.0;
00207     }
00208     else
00209     {
00210         NEVER_REACHED;
00211     }
00212 
00213     if (mpCell->HasCellProperty<CellLabel>())
00214     {
00215         wnt_division_threshold = labelled_threshold;
00216     }
00217 
00218     double wnt_level = GetWntLevel();
00219     WntConcentrationType wnt_type = GetWntType();
00220 
00221     // Set the cell type to TRANSIT if the Wnt stimulus exceeds wnt_division_threshold
00222     if (wnt_level >= wnt_division_threshold)
00223     {
00224         CellProliferativeType cell_type = TRANSIT;
00225 
00226         // For a RADIAL Wnt type, override the cell type to STEM if the Wnt stimulus exceeds a higher threshold
00227         if ( (wnt_type == RADIAL) && (wnt_level > mWntStemThreshold) )
00228         {
00229             cell_type = STEM;
00230         }
00231 
00232         mCellProliferativeType = cell_type;
00233     }
00234     else
00235     {
00236         // The cell is DIFFERENTIATED and so in G0 phase
00237         mCellProliferativeType = DIFFERENTIATED;
00238     }
00239     AbstractSimpleCellCycleModel::UpdateCellCyclePhase();
00240 }
00241 
00242 void SimpleWntCellCycleModel::InitialiseDaughterCell()
00243 {
00244     WntConcentrationType wnt_type = GetWntType();
00245 
00246     if (wnt_type == RADIAL)
00247     {
00248         mCellProliferativeType = TRANSIT;
00249     }
00250 
00251     AbstractSimpleCellCycleModel::InitialiseDaughterCell();
00252 }
00253 
00254 bool SimpleWntCellCycleModel::CanCellTerminallyDifferentiate()
00255 {
00256     return false;
00257 }
00258 
00259 double SimpleWntCellCycleModel::GetWntStemThreshold()
00260 {
00261     return mWntStemThreshold;
00262 }
00263 
00264 void SimpleWntCellCycleModel::SetWntStemThreshold(double wntStemThreshold)
00265 {
00266     assert(wntStemThreshold <= 1.0);
00267     assert(wntStemThreshold >= 0.0);
00268     mWntStemThreshold = wntStemThreshold;
00269 }
00270 
00271 double SimpleWntCellCycleModel::GetWntTransitThreshold()
00272 {
00273     return mWntTransitThreshold;
00274 }
00275 
00276 void SimpleWntCellCycleModel::SetWntTransitThreshold(double wntTransitThreshold)
00277 {
00278     assert(wntTransitThreshold <= 1.0);
00279     assert(wntTransitThreshold >= 0.0);
00280     mWntTransitThreshold = wntTransitThreshold;
00281 }
00282 
00283 double SimpleWntCellCycleModel::GetWntLabelledThreshold()
00284 {
00285     return mWntLabelledThreshold;
00286 }
00287 
00288 void SimpleWntCellCycleModel::SetWntLabelledThreshold(double wntLabelledThreshold)
00289 {
00290     assert(wntLabelledThreshold <= 1.0);
00291     assert(wntLabelledThreshold >= 0.0);
00292     mWntLabelledThreshold = wntLabelledThreshold;
00293 }
00294 
00295 void SimpleWntCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
00296 {
00297     *rParamsFile << "\t\t\t<UseCellProliferativeTypeDependentG1Duration>" << mUseCellProliferativeTypeDependentG1Duration << "</UseCellProliferativeTypeDependentG1Duration>\n";
00298     *rParamsFile << "\t\t\t<WntStemThreshold>" << mWntStemThreshold << "</WntStemThreshold>\n";
00299     *rParamsFile << "\t\t\t<WntTransitThreshold>" << mWntTransitThreshold << "</WntTransitThreshold>\n";
00300     *rParamsFile << "\t\t\t<WntLabelledThreshold>" << mWntLabelledThreshold << "</WntLabelledThreshold>\n";
00301 
00302     // Call method on direct parent class
00303     AbstractSimpleCellCycleModel::OutputCellCycleModelParameters(rParamsFile);
00304 }
00305 
00306 // Serialization for Boost >= 1.36
00307 #include "SerializationExportWrapperForCpp.hpp"
00308 CHASTE_CLASS_EXPORT(SimpleWntCellCycleModel)

Generated on Tue May 31 14:31:41 2011 for Chaste by  doxygen 1.5.5