AbstractCellCycleModel.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 "AbstractCellCycleModel.hpp"
00030 
00031 AbstractCellCycleModel::AbstractCellCycleModel()
00032     : mBirthTime(SimulationTime::Instance()->GetTime()),
00033       mCurrentCellCyclePhase(M_PHASE),
00034       mG1Duration(DOUBLE_UNSET),
00035       mReadyToDivide(false),
00036       mDimension(UNSIGNED_UNSET),
00037       mMinimumGapDuration(0.01), // an educated guess
00038       // Default parameter values all have units of hours.
00039       mStemCellG1Duration(14.0),
00040       mTransitCellG1Duration(2.0),
00041       mSDuration(5.0),               // apparently between 5-6 hours normally
00042       mG2Duration(4.0),              // apparently 3-4 hours normally
00043       mMDuration(1.0)               // taken from Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
00044 {
00045 }
00046 
00047 AbstractCellCycleModel::~AbstractCellCycleModel()
00048 {
00049 }
00050 
00051 void AbstractCellCycleModel::Initialise()
00052 {
00053 }
00054 
00055 void AbstractCellCycleModel::InitialiseDaughterCell()
00056 {
00057 }
00058 
00059 void AbstractCellCycleModel::SetCell(CellPtr pCell)
00060 {
00061     mpCell = pCell;
00062 }
00063 
00064 CellPtr AbstractCellCycleModel::GetCell()
00065 {
00066     assert(mpCell != NULL);
00067     return mpCell;
00068 }
00069 
00070 void AbstractCellCycleModel::SetBirthTime(double birthTime)
00071 {
00072     mBirthTime = birthTime;
00073 }
00074 
00075 double AbstractCellCycleModel::GetBirthTime() const
00076 {
00077     return mBirthTime;
00078 }
00079 
00080 double AbstractCellCycleModel::GetAge()
00081 {
00082     return SimulationTime::Instance()->GetTime() - mBirthTime;
00083 }
00084 
00085 CellCyclePhase AbstractCellCycleModel::GetCurrentCellCyclePhase()
00086 {
00087     return mCurrentCellCyclePhase;
00088 }
00089 
00090 void AbstractCellCycleModel::ResetForDivision()
00091 {
00092     assert(mReadyToDivide);
00093     mCurrentCellCyclePhase = M_PHASE;
00094     mReadyToDivide = false;
00095 }
00096 
00097 double AbstractCellCycleModel::GetG1Duration()
00098 {
00099     return mG1Duration;
00100 }
00101 
00103 // Getter methods
00105 
00106 double AbstractCellCycleModel::GetStemCellG1Duration()
00107 {
00108     return mStemCellG1Duration;
00109 }
00110 
00111 double AbstractCellCycleModel::GetTransitCellG1Duration()
00112 {
00113     return mTransitCellG1Duration;
00114 }
00115 
00116 double AbstractCellCycleModel::GetSG2MDuration()
00117 {
00118     return mSDuration + mG2Duration + mMDuration;
00119 }
00120 
00121 double AbstractCellCycleModel::GetSDuration()
00122 {
00123     return mSDuration;
00124 }
00125 
00126 double AbstractCellCycleModel::GetG2Duration()
00127 {
00128     return mG2Duration;
00129 }
00130 
00131 double AbstractCellCycleModel::GetMDuration()
00132 {
00133     return mMDuration;
00134 }
00135 
00137 // Setter methods
00139 
00140 void AbstractCellCycleModel::SetStemCellG1Duration(double stemCellG1Duration)
00141 {
00142     assert(stemCellG1Duration > 0.0);
00143     mStemCellG1Duration = stemCellG1Duration;
00144 }
00145 void AbstractCellCycleModel::SetTransitCellG1Duration(double transitCellG1Duration)
00146 {
00147     assert(transitCellG1Duration > 0.0);
00148     mTransitCellG1Duration = transitCellG1Duration;
00149 }
00150 void AbstractCellCycleModel::SetSDuration(double SDuration)
00151 {
00152     assert(SDuration > 0.0);
00153     mSDuration = SDuration;
00154 }
00155 void AbstractCellCycleModel::SetG2Duration(double G2Duration)
00156 {
00157     assert(G2Duration > 0.0);
00158     mG2Duration = G2Duration;
00159 }
00160 void AbstractCellCycleModel::SetMDuration(double MDuration)
00161 {
00162     assert(MDuration > 0.0);
00163     mMDuration = MDuration;
00164 }
00165 
00166 bool AbstractCellCycleModel::ReadyToDivide()
00167 {
00168     assert(mpCell != NULL);
00169 
00170     if (!mReadyToDivide)
00171     {
00172         UpdateCellCyclePhase();
00173         if ( (mCurrentCellCyclePhase != G_ZERO_PHASE) &&
00174              (GetAge() >= GetMDuration() + GetG1Duration() + GetSDuration() + GetG2Duration()) )
00175         {
00176             mReadyToDivide = true;
00177         }
00178     }
00179     return mReadyToDivide;
00180 }
00181 
00182 void AbstractCellCycleModel::SetDimension(unsigned dimension)
00183 {
00184     if (dimension != 1 && dimension !=2 && dimension != 3)
00185     {
00186         EXCEPTION("Dimension must be 1, 2 or 3");
00187     }
00188     mDimension = dimension;
00189 }
00190 
00191 unsigned AbstractCellCycleModel::GetDimension()
00192 {
00193     return mDimension;
00194 }
00195 
00196 double AbstractCellCycleModel::GetAverageTransitCellCycleTime()
00197 {
00198     return mTransitCellG1Duration + GetSG2MDuration();
00199 }
00200 
00201 double AbstractCellCycleModel::GetAverageStemCellCycleTime()
00202 {
00203     return mStemCellG1Duration + GetSG2MDuration();
00204 }
00205 
00206 bool AbstractCellCycleModel::CanCellTerminallyDifferentiate()
00207 {
00208     return true;
00209 }
00210 
00211 void AbstractCellCycleModel::SetCellProliferativeType(CellProliferativeType cellType)
00212 {
00213     mCellProliferativeType = cellType;
00214 }
00215 
00216 CellProliferativeType AbstractCellCycleModel::GetCellProliferativeType() const
00217 {
00218     return mCellProliferativeType;
00219 }
00220 
00221 void AbstractCellCycleModel::SetMinimumGapDuration(double minimumGapDuration)
00222 {
00223     assert(minimumGapDuration > 0.0);
00224     mMinimumGapDuration = minimumGapDuration;
00225 }
00226 
00227 double AbstractCellCycleModel::GetMinimumGapDuration()
00228 {
00229     return mMinimumGapDuration;
00230 }
00231 
00232 void AbstractCellCycleModel::OutputCellCycleModelInfo(out_stream& rParamsFile)
00233 {
00234     std::string cell_cycle_model_type = GetIdentifier();
00235 
00236     *rParamsFile << "\t\t<" << cell_cycle_model_type << ">\n";
00237     OutputCellCycleModelParameters(rParamsFile);
00238     *rParamsFile << "\t\t</" << cell_cycle_model_type << ">\n";
00239 }
00240 
00241 void AbstractCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile)
00242 {
00243     *rParamsFile << "\t\t\t<StemCellG1Duration>" << mStemCellG1Duration << "</StemCellG1Duration>\n";
00244     *rParamsFile << "\t\t\t<TransitCellG1Duration>" << mTransitCellG1Duration << "</TransitCellG1Duration>\n";
00245     *rParamsFile << "\t\t\t<SDuration>" << mSDuration << "</SDuration>\n";
00246     *rParamsFile << "\t\t\t<G2Duration>" << mG2Duration << "</G2Duration>\n";
00247     *rParamsFile << "\t\t\t<MDuration>" << mMDuration << "</MDuration>\n";
00248 }
Generated on Thu Dec 22 13:00:04 2011 for Chaste by  doxygen 1.6.3