Chaste Release::3.1
SimpleWntCellCycleModel.cpp
00001 /*
00002 
00003 Copyright (c) 2005-2012, University of Oxford.
00004 All rights reserved.
00005 
00006 University of Oxford means the Chancellor, Masters and Scholars of the
00007 University of Oxford, having an administrative office at Wellington
00008 Square, Oxford OX1 2JD, UK.
00009 
00010 This file is part of Chaste.
00011 
00012 Redistribution and use in source and binary forms, with or without
00013 modification, are permitted provided that the following conditions are met:
00014  * Redistributions of source code must retain the above copyright notice,
00015    this list of conditions and the following disclaimer.
00016  * Redistributions in binary form must reproduce the above copyright notice,
00017    this list of conditions and the following disclaimer in the documentation
00018    and/or other materials provided with the distribution.
00019  * Neither the name of the University of Oxford nor the names of its
00020    contributors may be used to endorse or promote products derived from this
00021    software without specific prior written permission.
00022 
00023 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00025 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00026 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
00027 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00028 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
00029 GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00030 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00031 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
00032 OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00033 
00034 */
00035 
00036 #include "SimpleWntCellCycleModel.hpp"
00037 #include "Exception.hpp"
00038 
00039 SimpleWntCellCycleModel::SimpleWntCellCycleModel()
00040     : mUseCellProliferativeTypeDependentG1Duration(false),
00041       mWntStemThreshold(0.8),
00042       mWntTransitThreshold(0.65),
00043       mWntLabelledThreshold(0.65)
00044 {
00045 }
00046 
00047 AbstractCellCycleModel* SimpleWntCellCycleModel::CreateCellCycleModel()
00048 {
00049     // Create a new cell-cycle model
00050     SimpleWntCellCycleModel* p_model = new SimpleWntCellCycleModel();
00051 
00052     /*
00053      * Set each member variable of the new cell-cycle model that inherits
00054      * its value from the parent.
00055      *
00056      * Note 1: some of the new cell-cycle model's member variables (namely
00057      * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide) will already have been
00058      * correctly initialized in its constructor.
00059      *
00060      * Note 2: one or more of the new cell-cycle model's member variables
00061      * may be set/overwritten as soon as InitialiseDaughterCell() is called on
00062      * the new cell-cycle model.
00063      */
00064     p_model->SetBirthTime(mBirthTime);
00065     p_model->SetDimension(mDimension);
00066     p_model->SetMinimumGapDuration(mMinimumGapDuration);
00067     p_model->SetStemCellG1Duration(mStemCellG1Duration);
00068     p_model->SetTransitCellG1Duration(mTransitCellG1Duration);
00069     p_model->SetSDuration(mSDuration);
00070     p_model->SetG2Duration(mG2Duration);
00071     p_model->SetMDuration(mMDuration);
00072     p_model->SetUseCellProliferativeTypeDependentG1Duration(mUseCellProliferativeTypeDependentG1Duration);
00073     p_model->SetWntStemThreshold(mWntStemThreshold);
00074     p_model->SetWntTransitThreshold(mWntTransitThreshold);
00075     p_model->SetWntLabelledThreshold(mWntLabelledThreshold);
00076 
00077     return p_model;
00078 }
00079 
00080 void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration)
00081 {
00082     mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration;
00083 }
00084 
00085 void SimpleWntCellCycleModel::SetG1Duration()
00086 {
00087     assert(mpCell != NULL);
00088 
00089     RandomNumberGenerator* p_gen = RandomNumberGenerator::Instance();
00090 
00091     switch (mpCell->GetCellProliferativeType())
00092     {
00093         case STEM:
00094             if (mUseCellProliferativeTypeDependentG1Duration)
00095             {
00096                 mG1Duration = p_gen->NormalRandomDeviate(GetStemCellG1Duration(), 1.0);
00097             }
00098             else
00099             {
00100                 // Normally stem cells should behave just like transit cells in a Wnt simulation
00101                 mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0);
00102             }
00103             break;
00104         case TRANSIT:
00105             mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0);
00106             break;
00107         case DIFFERENTIATED:
00108             mG1Duration = DBL_MAX;
00109             break;
00110         default:
00111             NEVER_REACHED;
00112     }
00113 
00114     // Check that the normal random deviate has not returned a small or negative G1 duration
00115     if (mG1Duration < mMinimumGapDuration)
00116     {
00117         mG1Duration = mMinimumGapDuration;
00118     }
00119 }
00120 
00121 double SimpleWntCellCycleModel::GetWntLevel()
00122 {
00123     assert(mpCell != NULL);
00124     double level = 0;
00125 
00126     switch (mDimension)
00127     {
00128         case 1:
00129         {
00130             const unsigned DIM = 1;
00131             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00132             break;
00133         }
00134         case 2:
00135         {
00136             const unsigned DIM = 2;
00137             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00138             break;
00139         }
00140         case 3:
00141         {
00142             const unsigned DIM = 3;
00143             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00144             break;
00145         }
00146         default:
00147             NEVER_REACHED;
00148     }
00149     return level;
00150 }
00151 
00152 WntConcentrationType SimpleWntCellCycleModel::GetWntType()
00153 {
00154     WntConcentrationType wnt_type;
00155     switch (mDimension)
00156     {
00157         case 1:
00158         {
00159             const unsigned DIM = 1;
00160             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00161             break;
00162         }
00163         case 2:
00164         {
00165             const unsigned DIM = 2;
00166             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00167             break;
00168         }
00169         case 3:
00170         {
00171             const unsigned DIM = 3;
00172             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00173             break;
00174         }
00175         default:
00176             NEVER_REACHED;
00177     }
00178     return wnt_type;
00179 }
00180 
00181 void SimpleWntCellCycleModel::UpdateCellCyclePhase()
00182 {
00183     // The cell can divide if the Wnt concentration >= wnt_division_threshold
00184     double wnt_division_threshold = DBL_MAX;
00185 
00186     // Set up under what level of Wnt stimulus a cell will divide
00187     if (mpCell->GetMutationState()->IsType<WildTypeCellMutationState>())
00188     {
00189         wnt_division_threshold = mWntTransitThreshold;
00190     }
00191     else if (mpCell->GetMutationState()->IsType<ApcOneHitCellMutationState>())
00192     {
00193         // should be less than healthy values
00194         wnt_division_threshold = 0.77*mWntTransitThreshold;
00195     }
00196     else if (mpCell->GetMutationState()->IsType<BetaCateninOneHitCellMutationState>())
00197     {
00198         // less than above value
00199         wnt_division_threshold = 0.155*mWntTransitThreshold;
00200     }
00201     else if (mpCell->GetMutationState()->IsType<ApcTwoHitCellMutationState>())
00202     {
00203         // should be zero (no Wnt-dependence)
00204         wnt_division_threshold = 0.0;
00205     }
00206     else
00207     {
00208         NEVER_REACHED;
00209     }
00210 
00211     if (mpCell->HasCellProperty<CellLabel>())
00212     {
00213         wnt_division_threshold = mWntLabelledThreshold;
00214     }
00215 
00216     double wnt_level = GetWntLevel();
00217     WntConcentrationType wnt_type = GetWntType();
00218 
00219     // Set the cell type to TRANSIT if the Wnt stimulus exceeds wnt_division_threshold
00220     if (wnt_level >= wnt_division_threshold)
00221     {
00222         CellProliferativeType cell_type = TRANSIT;
00223 
00224         // For a RADIAL Wnt type, override the cell type to STEM if the Wnt stimulus exceeds a higher threshold
00225         if ((wnt_type == RADIAL) && (wnt_level > mWntStemThreshold))
00226         {
00227             cell_type = STEM;
00228         }
00229 
00230         mpCell->SetCellProliferativeType(cell_type);
00231     }
00232     else
00233     {
00234         // The cell is DIFFERENTIATED and so in G0 phase
00235         mpCell->SetCellProliferativeType(DIFFERENTIATED);
00236     }
00237     AbstractSimpleCellCycleModel::UpdateCellCyclePhase();
00238 }
00239 
00240 void SimpleWntCellCycleModel::InitialiseDaughterCell()
00241 {
00242     WntConcentrationType wnt_type = GetWntType();
00243 
00244     if (wnt_type == RADIAL)
00245     {
00246         mpCell->SetCellProliferativeType(TRANSIT);
00247     }
00248 
00249     AbstractSimpleCellCycleModel::InitialiseDaughterCell();
00250 }
00251 
00252 bool SimpleWntCellCycleModel::CanCellTerminallyDifferentiate()
00253 {
00254     return false;
00255 }
00256 
00257 double SimpleWntCellCycleModel::GetWntStemThreshold()
00258 {
00259     return mWntStemThreshold;
00260 }
00261 
00262 void SimpleWntCellCycleModel::SetWntStemThreshold(double wntStemThreshold)
00263 {
00264     assert(wntStemThreshold <= 1.0);
00265     assert(wntStemThreshold >= 0.0);
00266     mWntStemThreshold = wntStemThreshold;
00267 }
00268 
00269 double SimpleWntCellCycleModel::GetWntTransitThreshold()
00270 {
00271     return mWntTransitThreshold;
00272 }
00273 
00274 void SimpleWntCellCycleModel::SetWntTransitThreshold(double wntTransitThreshold)
00275 {
00276     //assert(wntTransitThreshold <= 1.0);
00277     //assert(wntTransitThreshold >= 0.0);
00278     mWntTransitThreshold = wntTransitThreshold;
00279 }
00280 
00281 double SimpleWntCellCycleModel::GetWntLabelledThreshold()
00282 {
00283     return mWntLabelledThreshold;
00284 }
00285 
00286 void SimpleWntCellCycleModel::SetWntLabelledThreshold(double wntLabelledThreshold)
00287 {
00288 //    assert(wntLabelledThreshold <= 1.0);
00289 //    assert(wntLabelledThreshold >= 0.0);
00290     mWntLabelledThreshold = wntLabelledThreshold;
00291 }
00292 
00293 void SimpleWntCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
00294 {
00295     *rParamsFile << "\t\t\t<UseCellProliferativeTypeDependentG1Duration>" << mUseCellProliferativeTypeDependentG1Duration << "</UseCellProliferativeTypeDependentG1Duration>\n";
00296     *rParamsFile << "\t\t\t<WntStemThreshold>" << mWntStemThreshold << "</WntStemThreshold>\n";
00297     *rParamsFile << "\t\t\t<WntTransitThreshold>" << mWntTransitThreshold << "</WntTransitThreshold>\n";
00298     *rParamsFile << "\t\t\t<WntLabelledThreshold>" << mWntLabelledThreshold << "</WntLabelledThreshold>\n";
00299 
00300     // Call method on direct parent class
00301     AbstractSimpleCellCycleModel::OutputCellCycleModelParameters(rParamsFile);
00302 }
00303 
00304 // Serialization for Boost >= 1.36
00305 #include "SerializationExportWrapperForCpp.hpp"
00306 CHASTE_CLASS_EXPORT(SimpleWntCellCycleModel)