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 
00029 #include "SimpleWntCellCycleModel.hpp"
00030 #include "Exception.hpp"
00031 
00032 SimpleWntCellCycleModel::SimpleWntCellCycleModel()
00033     : mUseCellProliferativeTypeDependentG1Duration(false),
00034       mWntStemThreshold(0.8),
00035       mWntTransitThreshold(0.65),
00036       mWntLabelledThreshold(0.65)
00037 {
00038 }
00039 
00040 
00041 AbstractCellCycleModel* SimpleWntCellCycleModel::CreateCellCycleModel()
00042 {
00043     // Create a new cell-cycle model
00044     SimpleWntCellCycleModel* p_model = new SimpleWntCellCycleModel();
00045 
00046     /*
00047      * Set each member variable of the new cell-cycle model that inherits
00048      * its value from the parent.
00049      *
00050      * Note 1: some of the new cell-cycle model's member variables (namely
00051      * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide) will already have been
00052      * correctly initialized in its constructor.
00053      *
00054      * Note 2: one or more of the new cell-cycle model's member variables
00055      * may be set/overwritten as soon as InitialiseDaughterCell() is called on
00056      * the new cell-cycle model.
00057      */
00058     p_model->SetBirthTime(mBirthTime);
00059     p_model->SetDimension(mDimension);
00060     p_model->SetCellProliferativeType(mCellProliferativeType);
00061     p_model->SetMinimumGapDuration(mMinimumGapDuration);
00062     p_model->SetStemCellG1Duration(mStemCellG1Duration);
00063     p_model->SetTransitCellG1Duration(mTransitCellG1Duration);
00064     p_model->SetSDuration(mSDuration);
00065     p_model->SetG2Duration(mG2Duration);
00066     p_model->SetMDuration(mMDuration);
00067     p_model->SetUseCellProliferativeTypeDependentG1Duration(mUseCellProliferativeTypeDependentG1Duration);
00068     p_model->SetWntStemThreshold(mWntStemThreshold);
00069     p_model->SetWntTransitThreshold(mWntTransitThreshold);
00070     p_model->SetWntLabelledThreshold(mWntLabelledThreshold);
00071 
00072     return p_model;
00073 }
00074 
00075 
00076 void SimpleWntCellCycleModel::SetUseCellProliferativeTypeDependentG1Duration(bool useCellProliferativeTypeDependentG1Duration)
00077 {
00078     mUseCellProliferativeTypeDependentG1Duration = useCellProliferativeTypeDependentG1Duration;
00079 }
00080 
00081 
00082 void SimpleWntCellCycleModel::SetG1Duration()
00083 {
00084     assert(mpCell != NULL);
00085 
00086     RandomNumberGenerator* p_gen = RandomNumberGenerator::Instance();
00087 
00088     switch (mCellProliferativeType)
00089     {
00090         case STEM:
00091             if (mUseCellProliferativeTypeDependentG1Duration)
00092             {
00093                 mG1Duration = p_gen->NormalRandomDeviate(GetStemCellG1Duration(), 1.0);
00094             }
00095             else
00096             {
00097                 // Normally stem cells should behave just like transit cells in a Wnt simulation
00098                 mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0);
00099             }
00100             break;
00101         case TRANSIT:
00102             mG1Duration = p_gen->NormalRandomDeviate(GetTransitCellG1Duration(), 1.0);
00103             break;
00104         case DIFFERENTIATED:
00105             mG1Duration = DBL_MAX;
00106             break;
00107         default:
00108             NEVER_REACHED;
00109     }
00110 
00111     // Check that the normal random deviate has not returned a small or negative G1 duration
00112     if (mG1Duration < mMinimumGapDuration)
00113     {
00114         mG1Duration = mMinimumGapDuration;
00115     }
00116 }
00117 
00118 
00119 double SimpleWntCellCycleModel::GetWntLevel()
00120 {
00121     assert(mpCell != NULL);
00122     double level = 0;
00123 
00124     switch (mDimension)
00125     {
00126         case 1:
00127         {
00128             const unsigned DIM = 1;
00129             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00130             break;
00131         }
00132         case 2:
00133         {
00134             const unsigned DIM = 2;
00135             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00136             break;
00137         }
00138         case 3:
00139         {
00140             const unsigned DIM = 3;
00141             level = WntConcentration<DIM>::Instance()->GetWntLevel(mpCell);
00142             break;
00143         }
00144         default:
00145             NEVER_REACHED;
00146     }
00147     return level;
00148 }
00149 
00150 
00151 WntConcentrationType SimpleWntCellCycleModel::GetWntType()
00152 {
00153     WntConcentrationType wnt_type;
00154     switch (mDimension)
00155     {
00156         case 1:
00157         {
00158             const unsigned DIM = 1;
00159             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00160             break;
00161         }
00162         case 2:
00163         {
00164             const unsigned DIM = 2;
00165             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00166             break;
00167         }
00168         case 3:
00169         {
00170             const unsigned DIM = 3;
00171             wnt_type = WntConcentration<DIM>::Instance()->GetType();
00172             break;
00173         }
00174         default:
00175             NEVER_REACHED;
00176     }
00177     return wnt_type;
00178 }
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         mCellProliferativeType = cell_type;
00231     }
00232     else
00233     {
00234         // The cell is DIFFERENTIATED and so in G0 phase
00235         mCellProliferativeType = 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         mCellProliferativeType = 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)
Generated on Thu Dec 22 13:00:05 2011 for Chaste by  doxygen 1.6.3