00001 /* 00002 00003 Copyright (c) 2005-2015, 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 "ContactInhibitionCellCycleModel.hpp" 00037 #include "CellLabel.hpp" 00038 #include "DifferentiatedCellProliferativeType.hpp" 00039 00040 ContactInhibitionCellCycleModel::ContactInhibitionCellCycleModel() 00041 : AbstractSimpleCellCycleModel(), 00042 mQuiescentVolumeFraction(DOUBLE_UNSET), 00043 mEquilibriumVolume(DOUBLE_UNSET), 00044 mCurrentQuiescentOnsetTime(SimulationTime::Instance()->GetTime()), 00045 mCurrentQuiescentDuration(0.0) 00046 { 00047 } 00048 00049 void ContactInhibitionCellCycleModel::UpdateCellCyclePhase() 00050 { 00051 if ((mQuiescentVolumeFraction == DOUBLE_UNSET) || (mEquilibriumVolume == DOUBLE_UNSET)) 00052 { 00053 EXCEPTION("The member variables mQuiescentVolumeFraction and mEquilibriumVolume have not yet been set."); 00054 } 00055 00056 // Get cell volume 00057 double cell_volume = mpCell->GetCellData()->GetItem("volume"); 00058 00059 // Removes the cell label 00060 mpCell->RemoveCellProperty<CellLabel>(); 00061 00062 if (mCurrentCellCyclePhase == G_ONE_PHASE) 00063 { 00064 // Update G1 duration based on cell volume 00065 double dt = SimulationTime::Instance()->GetTimeStep(); 00066 double quiescent_volume = mEquilibriumVolume * mQuiescentVolumeFraction; 00067 00068 if (cell_volume < quiescent_volume) 00069 { 00070 // Update the duration of the current period of contact inhibition. 00071 mCurrentQuiescentDuration = SimulationTime::Instance()->GetTime() - mCurrentQuiescentOnsetTime; 00072 mG1Duration += dt; 00073 00074 /* 00075 * This method is usually called within a CellBasedSimulation, after the CellPopulation 00076 * has called CellPropertyRegistry::TakeOwnership(). This means that were we to call 00077 * CellPropertyRegistry::Instance() here when adding the CellLabel, we would be creating 00078 * a new CellPropertyRegistry. In this case the CellLabel's cell count would be incorrect. 00079 * We must therefore access the CellLabel via the cell's CellPropertyCollection. 00080 */ 00081 boost::shared_ptr<AbstractCellProperty> p_label = 00082 mpCell->rGetCellPropertyCollection().GetCellPropertyRegistry()->Get<CellLabel>(); 00083 mpCell->AddCellProperty(p_label); 00084 } 00085 else 00086 { 00087 // Reset the cell's quiescent duration and update the time at which the onset of quiescent occurs 00088 mCurrentQuiescentDuration = 0.0; 00089 mCurrentQuiescentOnsetTime = SimulationTime::Instance()->GetTime(); 00090 } 00091 } 00092 00093 double time_since_birth = GetAge(); 00094 assert(time_since_birth >= 0); 00095 00096 if (mpCell->GetCellProliferativeType()->IsType<DifferentiatedCellProliferativeType>()) 00097 { 00098 mCurrentCellCyclePhase = G_ZERO_PHASE; 00099 } 00100 else if ( time_since_birth < GetMDuration() ) 00101 { 00102 mCurrentCellCyclePhase = M_PHASE; 00103 } 00104 else if ( time_since_birth < GetMDuration() + mG1Duration) 00105 { 00106 mCurrentCellCyclePhase = G_ONE_PHASE; 00107 } 00108 else if ( time_since_birth < GetMDuration() + mG1Duration + GetSDuration()) 00109 { 00110 mCurrentCellCyclePhase = S_PHASE; 00111 } 00112 else if ( time_since_birth < GetMDuration() + mG1Duration + GetSDuration() + GetG2Duration()) 00113 { 00114 mCurrentCellCyclePhase = G_TWO_PHASE; 00115 } 00116 } 00117 00118 AbstractCellCycleModel* ContactInhibitionCellCycleModel::CreateCellCycleModel() 00119 { 00120 // Create a new cell-cycle model 00121 ContactInhibitionCellCycleModel* p_model = new ContactInhibitionCellCycleModel(); 00122 00123 /* 00124 * Set each member variable of the new cell-cycle model that inherits 00125 * its value from the parent. 00126 * 00127 * Note 1: some of the new cell-cycle model's member variables (namely 00128 * mBirthTime, mCurrentCellCyclePhase, mReadyToDivide, mTimeSpentInG1Phase, 00129 * mCurrentHypoxicDuration, mCurrentHypoxiaOnsetTime) will already have been 00130 * correctly initialized in its constructor. 00131 * 00132 * Note 2: one or more of the new cell-cycle model's member variables 00133 * may be set/overwritten as soon as InitialiseDaughterCell() is called on 00134 * the new cell-cycle model. 00135 */ 00136 p_model->SetBirthTime(mBirthTime); 00137 p_model->SetDimension(mDimension); 00138 p_model->SetMinimumGapDuration(mMinimumGapDuration); 00139 p_model->SetStemCellG1Duration(mStemCellG1Duration); 00140 p_model->SetTransitCellG1Duration(mTransitCellG1Duration); 00141 p_model->SetSDuration(mSDuration); 00142 p_model->SetG2Duration(mG2Duration); 00143 p_model->SetMDuration(mMDuration); 00144 p_model->SetQuiescentVolumeFraction(mQuiescentVolumeFraction); 00145 p_model->SetEquilibriumVolume(mEquilibriumVolume); 00146 p_model->SetCurrentQuiescentOnsetTime(mCurrentQuiescentOnsetTime); 00147 p_model->SetCurrentQuiescentDuration(mCurrentQuiescentDuration); 00148 00149 return p_model; 00150 } 00151 00152 void ContactInhibitionCellCycleModel::SetQuiescentVolumeFraction(double quiescentVolumeFraction) 00153 { 00154 mQuiescentVolumeFraction = quiescentVolumeFraction; 00155 } 00156 00157 double ContactInhibitionCellCycleModel::GetQuiescentVolumeFraction() 00158 { 00159 return mQuiescentVolumeFraction; 00160 } 00161 00162 void ContactInhibitionCellCycleModel::SetEquilibriumVolume(double equilibriumVolume) 00163 { 00164 mEquilibriumVolume = equilibriumVolume; 00165 } 00166 00167 double ContactInhibitionCellCycleModel::GetEquilibriumVolume() 00168 { 00169 return mEquilibriumVolume; 00170 } 00171 00172 void ContactInhibitionCellCycleModel::SetCurrentQuiescentDuration(double currentQuiescentDuration) 00173 { 00174 mCurrentQuiescentDuration = currentQuiescentDuration; 00175 } 00176 00177 double ContactInhibitionCellCycleModel::GetCurrentQuiescentDuration() 00178 { 00179 return mCurrentQuiescentDuration; 00180 } 00181 00182 void ContactInhibitionCellCycleModel::SetCurrentQuiescentOnsetTime(double currentQuiescentOnsetTime) 00183 { 00184 mCurrentQuiescentOnsetTime = currentQuiescentOnsetTime; 00185 } 00186 00187 double ContactInhibitionCellCycleModel::GetCurrentQuiescentOnsetTime() 00188 { 00189 return mCurrentQuiescentOnsetTime; 00190 } 00191 00192 void ContactInhibitionCellCycleModel::OutputCellCycleModelParameters(out_stream& rParamsFile) 00193 { 00194 *rParamsFile << "\t\t\t<QuiescentVolumeFraction>" << mQuiescentVolumeFraction << "</QuiescentVolumeFraction>\n"; 00195 *rParamsFile << "\t\t\t<EquilibriumVolume>" << mEquilibriumVolume << "</EquilibriumVolume>\n"; 00196 00197 // Call method on direct parent class 00198 AbstractSimpleCellCycleModel::OutputCellCycleModelParameters(rParamsFile); 00199 } 00200 00201 // Serialization for Boost >= 1.36 00202 #include "SerializationExportWrapperForCpp.hpp" 00203 CHASTE_CLASS_EXPORT(ContactInhibitionCellCycleModel)