TissueConfig.cpp

00001 /*
00002 
00003 Copyright (C) University of Oxford, 2005-2010
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 "TissueConfig.hpp"
00029 
00030 TissueConfig* TissueConfig::mpInstance = NULL;
00031 
00032 TissueConfig* TissueConfig::Instance()
00033 {
00034     if (mpInstance == NULL)
00035     {
00036         mpInstance = new TissueConfig;
00037     }
00038     return mpInstance;
00039 }
00040 
00041 TissueConfig::TissueConfig()
00042 {
00043     // Make sure there's only one instance - enforces correct serialization
00044     assert(mpInstance == NULL);
00045 
00046     Reset();
00047 }
00048 
00090 void TissueConfig::Reset()
00091 {
00092     // Default parameter values
00093     mStemCellG1Duration = 14.0;
00094     mTransitCellG1Duration = 2.0;
00095     mHepaOneCellG1Duration = 8.0;   // taken from Owen et al, 2004 (doi:10.1016/j.jtbi.2003.09.004)
00096     mMinimumGapDuration = 0.01;     // educated guess
00097     mSDuration = 5.0;               // apparently between 5-6 hours normally
00098     mG2Duration = 4.0;              // apparently 3-4 hours normally
00099     mMDuration = 1.0;               // taken from Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
00100 
00101     mMaxTransitGenerations = 3u;    // taken from Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
00102     mCryptWidth = 10.0;
00103     mCryptLength = 22.0;            // this is MOUSE (small intestine)
00104     mSpringStiffness = 15.0;        // denoted by mu in Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
00105     mMechanicsCutOffLength = DBL_MAX; // This needs to be set by a caller
00106     mDampingConstantNormal = 1.0;   // denoted by nu in Meineke et al, 2001 (doi:10.1046/j.0960-7722.2001.00216.x)
00107     mDampingConstantMutant = 1.0;
00108     mBetaCatSpringScaler = 18.14 / 6.0; // this scales the spring constant with the amount of beta-catenin
00109                                         // (divided by 6 as a cell normally is a hexagon)
00110     mApoptosisTime = 0.25;          // cell takes 15 min to fully undergo apoptosis
00111     mDivisionRestingSpringLength = 0.5;
00112     mDivisionSeparation = 0.3;
00113     mHepaOneCellHypoxicConcentration = 0.4;
00114     mHepaOneCellQuiescentConcentration = 1.0;
00115     mWntStemThreshold = 0.8;
00116     mWntTransitThreshold = 0.65;
00117     mWntLabelledThreshold = 0.65;
00118     mWntConcentrationParameter = 1.0;
00119     mCriticalHypoxicDuration = 2.0;
00120     mCryptProjectionParameterA = 0.5;
00121     mCryptProjectionParameterB = 2.0;
00122 
00123     mApoptoticSpringTensionStiffness = 0.25*mSpringStiffness;
00124     mApoptoticSpringCompressionStiffness = 0.75*mSpringStiffness;
00125 
00126     mWntChemotaxisStrength = 100.0;
00127     mSymmetricDivisionProbability = 0.0;
00128 
00129     mAreaBasedDampingConstantParameter = 0.1;
00130 
00131     mMatureCellTargetArea = 1.0; //0.785398163;//pi/4.0; used to be 1
00132 
00133     /*
00134      * The following four parameters are used in vertex-based tissue simulations
00135      * based on the mechanical model proposed by T. Nagai and H. Honda ("A dynamic
00136      * cell model for the formation of epithelial tissues", Philosophical Magazine
00137      * Part B 81:699-719). They are rescaled such that mDampingConstantNormal takes
00138      * the default value 1, whereas Nagai and Honda (who denote the parameter by nu)
00139      * take the value 0.01.
00140      */
00141     mDeformationEnergyParameter = 100.0; // This is 1.0 in the Nagai & Honda paper
00142     mMembraneSurfaceEnergyParameter = 10.0;  // This is 0.1 the Nagai & Honda paper
00143     mCellCellAdhesionEnergyParameter = 1.0; // This is 0.01 the Nagai & Honda paper
00144     mCellBoundaryAdhesionEnergyParameter = 1.0; // This is 0.01 the Nagai & Honda paper
00145 
00153     mWelikyOsterAreaParameter = 1.0;
00154     mWelikyOsterPerimeterParameter = 1.0;
00155 
00156     mOutputCellIdData = false;
00157     mOutputCellMutationStates = false;
00158     mOutputCellAncestors = false;
00159     mOutputCellProliferativeTypes = false;
00160     mOutputCellVariables = false;
00161     mOutputCellCyclePhases = false;
00162     mOutputCellAges = false;
00163     mOutputCellAreas = false;
00164     mOutputVoronoiData = false;
00165     mOutputTissueAreas = false;
00166     mOutputNodeVelocities = false;
00167 }
00168 
00170 // Getter methods
00172 
00173 double TissueConfig::GetStemCellG1Duration()
00174 {
00175     return mStemCellG1Duration;
00176 }
00177 double TissueConfig::GetTransitCellG1Duration()
00178 {
00179     return mTransitCellG1Duration;
00180 }
00181 double TissueConfig::GetHepaOneCellG1Duration()
00182 {
00183     return mHepaOneCellG1Duration;
00184 }
00185 double TissueConfig::GetMinimumGapDuration()
00186 {
00187     return mMinimumGapDuration;
00188 }
00189 double TissueConfig::GetSG2MDuration()
00190 {
00191     return mSDuration + mG2Duration + mMDuration;
00192 }
00193 double TissueConfig::GetSDuration()
00194 {
00195     return mSDuration;
00196 }
00197 double TissueConfig::GetG2Duration()
00198 {
00199     return mG2Duration;
00200 }
00201 double TissueConfig::GetMDuration()
00202 {
00203     return mMDuration;
00204 }
00205 unsigned TissueConfig::GetMaxTransitGenerations()
00206 {
00207     return mMaxTransitGenerations;
00208 }
00209 double TissueConfig::GetCryptLength()
00210 {
00211     return mCryptLength;
00212 }
00213 double TissueConfig::GetCryptWidth()
00214 {
00215     return mCryptWidth;
00216 }
00217 double TissueConfig::GetSpringStiffness()
00218 {
00219     return mSpringStiffness;
00220 }
00221 double TissueConfig::GetMechanicsCutOffLength()
00222 {
00223     return mMechanicsCutOffLength;
00224 }
00225 double TissueConfig::GetDampingConstantNormal()
00226 {
00227     return mDampingConstantNormal;
00228 }
00229 double TissueConfig::GetDampingConstantMutant()
00230 {
00231     return mDampingConstantMutant;
00232 }
00233 double TissueConfig::GetBetaCatSpringScaler()
00234 {
00235     return mBetaCatSpringScaler;
00236 }
00237 double TissueConfig::GetApoptosisTime()
00238 {
00239     return mApoptosisTime;
00240 }
00241 double TissueConfig::GetDivisionRestingSpringLength()
00242 {
00243     return mDivisionRestingSpringLength;
00244 }
00245 double TissueConfig::GetDivisionSeparation()
00246 {
00247     return mDivisionSeparation;
00248 }
00249 double TissueConfig::GetHepaOneCellHypoxicConcentration()
00250 {
00251     return mHepaOneCellHypoxicConcentration;
00252 }
00253 double TissueConfig::GetHepaOneCellQuiescentConcentration()
00254 {
00255     return mHepaOneCellQuiescentConcentration;
00256 }
00257 double TissueConfig::GetWntTransitThreshold()
00258 {
00259     return mWntTransitThreshold;
00260 }
00261 double TissueConfig::GetWntStemThreshold()
00262 {
00263     return mWntStemThreshold;
00264 }
00265 double TissueConfig::GetWntLabelledThreshold()
00266 {
00267     return mWntLabelledThreshold;
00268 }
00269 double TissueConfig::GetWntConcentrationParameter()
00270 {
00271     return mWntConcentrationParameter;
00272 }
00273 double TissueConfig::GetCriticalHypoxicDuration()
00274 {
00275     return mCriticalHypoxicDuration;
00276 }
00277 double TissueConfig::GetCryptProjectionParameterA()
00278 {
00279     return mCryptProjectionParameterA;
00280 }
00281 double TissueConfig::GetCryptProjectionParameterB()
00282 {
00283     return mCryptProjectionParameterB;
00284 }
00285 double TissueConfig::GetApoptoticSpringTensionStiffness()
00286 {
00287     return mApoptoticSpringTensionStiffness;
00288 }
00289 double TissueConfig::GetApoptoticSpringCompressionStiffness()
00290 {
00291     return mApoptoticSpringCompressionStiffness;
00292 }
00293 double TissueConfig::GetWntChemotaxisStrength()
00294 {
00295     return mWntChemotaxisStrength;
00296 }
00297 double TissueConfig::GetSymmetricDivisionProbability()
00298 {
00299     return mSymmetricDivisionProbability;
00300 }
00301 double TissueConfig::GetAreaBasedDampingConstantParameter()
00302 {
00303     return mAreaBasedDampingConstantParameter;
00304 }
00305 double TissueConfig::GetMatureCellTargetArea()
00306 {
00307     return mMatureCellTargetArea;
00308 }
00309 double TissueConfig::GetDeformationEnergyParameter()
00310 {
00311     return mDeformationEnergyParameter;
00312 }
00313 double TissueConfig::GetMembraneSurfaceEnergyParameter()
00314 {
00315     return mMembraneSurfaceEnergyParameter;
00316 }
00317 double TissueConfig::GetCellCellAdhesionEnergyParameter()
00318 {
00319     return mCellCellAdhesionEnergyParameter;
00320 }
00321 double TissueConfig::GetCellBoundaryAdhesionEnergyParameter()
00322 {
00323     return mCellBoundaryAdhesionEnergyParameter;
00324 }
00325 double TissueConfig::GetWelikyOsterAreaParameter()
00326 {
00327     return mWelikyOsterAreaParameter;
00328 }
00329 double TissueConfig::GetWelikyOsterPerimeterParameter()
00330 {
00331     return mWelikyOsterPerimeterParameter;
00332 }
00333 bool TissueConfig::GetOutputCellIdData()
00334 {
00335     return mOutputCellIdData;
00336 }
00337 bool TissueConfig::GetOutputCellMutationStates()
00338 {
00339     return mOutputCellMutationStates;
00340 }
00341 bool TissueConfig::GetOutputCellAncestors()
00342 {
00343     return mOutputCellAncestors;
00344 }
00345 bool TissueConfig::GetOutputCellProliferativeTypes()
00346 {
00347     return mOutputCellProliferativeTypes;
00348 }
00349 bool TissueConfig::GetOutputCellVariables()
00350 {
00351     return mOutputCellVariables;
00352 }
00353 bool TissueConfig::GetOutputCellCyclePhases()
00354 {
00355     return mOutputCellCyclePhases;
00356 }
00357 bool TissueConfig::GetOutputCellAges()
00358 {
00359     return mOutputCellAges;
00360 }
00361 bool TissueConfig::GetOutputCellAreas()
00362 {
00363     return mOutputCellAreas;
00364 }
00365 bool TissueConfig::GetOutputVoronoiData()
00366 {
00367     return mOutputVoronoiData;
00368 }
00369 bool TissueConfig::GetOutputTissueAreas()
00370 {
00371     return mOutputTissueAreas;
00372 }
00373 bool TissueConfig::GetOutputNodeVelocities()
00374 {
00375     return mOutputNodeVelocities;
00376 }
00377 
00379 // Setter methods
00381 
00382 void TissueConfig::SetStemCellG1Duration(double stemCellG1Duration)
00383 {
00384     assert(stemCellG1Duration > 0.0);
00385     mStemCellG1Duration = stemCellG1Duration;
00386 }
00387 void TissueConfig::SetTransitCellG1Duration(double transitCellG1Duration)
00388 {
00389     assert(transitCellG1Duration > 0.0);
00390     mTransitCellG1Duration = transitCellG1Duration;
00391 }
00392 void TissueConfig::SetHepaOneCellG1Duration(double hepaOneCellG1Duration)
00393 {
00394     assert(hepaOneCellG1Duration > 0.0);
00395     mHepaOneCellG1Duration = hepaOneCellG1Duration;
00396 }
00397 void TissueConfig::SetMinimumGapDuration(double minimumGapDuration)
00398 {
00399     assert(minimumGapDuration > 0.0);
00400     mMinimumGapDuration = minimumGapDuration;
00401 }
00402 void TissueConfig::SetSDuration(double SDuration)
00403 {
00404     assert(SDuration > 0.0);
00405     mSDuration = SDuration;
00406 }
00407 void TissueConfig::SetG2Duration(double G2Duration)
00408 {
00409     assert(G2Duration > 0.0);
00410     mG2Duration = G2Duration;
00411 }
00412 void TissueConfig::SetMDuration(double MDuration)
00413 {
00414     assert(MDuration > 0.0);
00415     mMDuration = MDuration;
00416 }
00417 void TissueConfig::SetMaxTransitGenerations(unsigned maxTransitGens)
00418 {
00419     mMaxTransitGenerations = maxTransitGens;
00420 }
00421 void TissueConfig::SetCryptLength(double cryptLength)
00422 {
00423     assert(cryptLength > 0.0);
00424     mCryptLength = cryptLength;
00425 }
00426 void TissueConfig::SetCryptWidth(double cryptWidth)
00427 {
00428     assert(cryptWidth > 0.0);
00429     mCryptWidth = cryptWidth;
00430 }
00431 void TissueConfig::SetSpringStiffness(double springStiffness)
00432 {
00433     assert(springStiffness > 0.0);
00434     mSpringStiffness = springStiffness;
00435 }
00436 void TissueConfig::SetMechanicsCutOffLength(double mechanicsCutOffLength)
00437 {
00438     assert(mechanicsCutOffLength > 0.0);
00439     mMechanicsCutOffLength = mechanicsCutOffLength;
00440 }
00441 
00442 void TissueConfig::SetDampingConstantNormal(double dampingConstantNormal)
00443 {
00444     assert(dampingConstantNormal > 0.0);
00445     mDampingConstantNormal = dampingConstantNormal;
00446 }
00447 void TissueConfig::SetDampingConstantMutant(double dampingConstantMutant)
00448 {
00449     assert(dampingConstantMutant > 0.0);
00450     mDampingConstantMutant = dampingConstantMutant;
00451 }
00452 void TissueConfig::SetBetaCatSpringScaler(double betaCatSpringScaler)
00453 {
00454     assert(betaCatSpringScaler > 0.0);
00455     mBetaCatSpringScaler = betaCatSpringScaler;
00456 }
00457 void TissueConfig::SetApoptosisTime(double apoptosisTime)
00458 {
00459     assert(apoptosisTime > 0.0);
00460     mApoptosisTime = apoptosisTime;
00461 }
00462 void TissueConfig::SetDivisionRestingSpringLength(double divisionRestingSpringLength)
00463 {
00464     assert(divisionRestingSpringLength<=1.0);
00465     assert(divisionRestingSpringLength>=0.0);
00466 
00467     mDivisionRestingSpringLength = divisionRestingSpringLength;
00468 }
00469 void TissueConfig::SetDivisionSeparation(double divisionSeparation)
00470 {
00471     assert(divisionSeparation<=1.0);
00472     assert(divisionSeparation>=0.0);
00473     mDivisionSeparation = divisionSeparation;
00474 }
00475 void TissueConfig::SetHepaOneCellHypoxicConcentration(double hepaOneCellHypoxicConcentration)
00476 {
00477     assert(hepaOneCellHypoxicConcentration<=1.0);
00478     assert(hepaOneCellHypoxicConcentration>=0.0);
00479     mHepaOneCellHypoxicConcentration = hepaOneCellHypoxicConcentration;
00480 }
00481 void TissueConfig::SetHepaOneCellQuiescentConcentration(double hepaOneCellQuiescentConcentration)
00482 {
00483     assert(hepaOneCellQuiescentConcentration<=1.0);
00484     assert(hepaOneCellQuiescentConcentration>=0.0);
00485     mHepaOneCellQuiescentConcentration = hepaOneCellQuiescentConcentration;
00486 }
00487 void TissueConfig::SetWntTransitThreshold(double wntThreshold)
00488 {
00489     assert(wntThreshold<=1.0);
00490     assert(wntThreshold>=0.0);
00491     mWntTransitThreshold = wntThreshold;
00492 }
00493 void TissueConfig::SetWntStemThreshold(double wntThreshold)
00494 {
00495     assert(wntThreshold<=1.0);
00496     assert(wntThreshold>=0.0);
00497     mWntStemThreshold = wntThreshold;
00498 }
00499 void TissueConfig::SetWntLabelledThreshold(double wntThreshold)
00500 {
00501     assert(wntThreshold<=1.0);
00502     assert(wntThreshold>=0.0);
00503     mWntLabelledThreshold = wntThreshold;
00504 }
00505 void TissueConfig::SetWntConcentrationParameter(double top)
00506 {
00507     assert(top > 0.0);
00508     //assert(top <= 1.0); This doesn't apply for exponential Wnt gradients.
00509     mWntConcentrationParameter = top;
00510 }
00511 void TissueConfig::SetCriticalHypoxicDuration(double criticalHypoxicDuration)
00512 {
00513     assert(criticalHypoxicDuration>=0.0);
00514     mCriticalHypoxicDuration = criticalHypoxicDuration;
00515 }
00516 void TissueConfig::SetHepaOneParameters()
00517 {
00518     mStemCellG1Duration = mHepaOneCellG1Duration;
00519 }
00520 void TissueConfig::SetCryptProjectionParameterA(double cryptProjectionParameterA)
00521 {
00522     assert(cryptProjectionParameterA>=0.0);
00523     mCryptProjectionParameterA = cryptProjectionParameterA;
00524 }
00525 void TissueConfig::SetCryptProjectionParameterB(double cryptProjectionParameterB)
00526 {
00527     assert(cryptProjectionParameterB>=0.0);
00528     mCryptProjectionParameterB = cryptProjectionParameterB;
00529 }
00530 void TissueConfig::SetApoptoticSpringTensionStiffness(double apoptoticSpringTensionStiffness)
00531 {
00532     assert(apoptoticSpringTensionStiffness>=0.0);
00533     mApoptoticSpringTensionStiffness = apoptoticSpringTensionStiffness;
00534 }
00535 void TissueConfig::SetApoptoticSpringCompressionStiffness(double apoptoticSpringCompressionStiffness)
00536 {
00537     assert(apoptoticSpringCompressionStiffness>=0.0);
00538     mApoptoticSpringCompressionStiffness = apoptoticSpringCompressionStiffness;
00539 }
00540 void TissueConfig::SetWntChemotaxisStrength(double wntChemotaxisStrength)
00541 {
00542     assert(wntChemotaxisStrength>=0.0);
00543     mWntChemotaxisStrength = wntChemotaxisStrength;
00544 }
00545 void TissueConfig::SetSymmetricDivisionProbability(double symmetricDivisionProbability)
00546 {
00547     assert(symmetricDivisionProbability<=1.0);
00548     assert(symmetricDivisionProbability>=0.0);
00549     mSymmetricDivisionProbability = symmetricDivisionProbability;
00550 }
00551 void TissueConfig::SetAreaBasedDampingConstantParameter(double areaBasedDampingConstantParameter)
00552 {
00553     assert(areaBasedDampingConstantParameter>=0.0);
00554     mAreaBasedDampingConstantParameter = areaBasedDampingConstantParameter;
00555 }
00556 void TissueConfig::SetMatureCellTargetArea(double matureCellTargetArea)
00557 {
00558     assert(matureCellTargetArea>=0.0);
00559     mMatureCellTargetArea = matureCellTargetArea;
00560 }
00561 void TissueConfig::SetDeformationEnergyParameter(double deformationEnergyParameter)
00562 {
00563     mDeformationEnergyParameter = deformationEnergyParameter;
00564 }
00565 void TissueConfig::SetMembraneSurfaceEnergyParameter(double membraneSurfaceEnergyParameter)
00566 {
00567     mMembraneSurfaceEnergyParameter = membraneSurfaceEnergyParameter;
00568 }
00569 void TissueConfig::SetCellCellAdhesionEnergyParameter(double cellCellAdhesionEnergyParameter)
00570 {
00571     mCellCellAdhesionEnergyParameter = cellCellAdhesionEnergyParameter;
00572 }
00573 void TissueConfig::SetCellBoundaryAdhesionEnergyParameter(double cellBoundaryAdhesionEnergyParameter)
00574 {
00575     mCellBoundaryAdhesionEnergyParameter = cellBoundaryAdhesionEnergyParameter;
00576 }
00577 void TissueConfig::SetWelikyOsterAreaParameter(double welikyOsterAreaParameter)
00578 {
00579     mWelikyOsterAreaParameter = welikyOsterAreaParameter;
00580 }
00581 void TissueConfig::SetWelikyOsterPerimeterParameter(double welikyOsterPerimeterParameter)
00582 {
00583     mWelikyOsterPerimeterParameter = welikyOsterPerimeterParameter;
00584 }
00585 void TissueConfig::SetOutputCellIdData(bool writeCellIdData)
00586 {
00587     mOutputCellIdData = writeCellIdData;
00588 }
00589 void TissueConfig::SetOutputCellMutationStates(bool outputCellMutationStates)
00590 {
00591     mOutputCellMutationStates = outputCellMutationStates;
00592 }
00593 void TissueConfig::SetOutputCellAncestors(bool outputCellAncestors)
00594 {
00595     mOutputCellAncestors = outputCellAncestors;
00596 }
00597 void TissueConfig::SetOutputCellProliferativeTypes(bool outputCellProliferativeTypes)
00598 {
00599     mOutputCellProliferativeTypes = outputCellProliferativeTypes;
00600 }
00601 void TissueConfig::SetOutputCellVariables(bool outputCellVariables)
00602 {
00603     mOutputCellVariables = outputCellVariables;
00604 }
00605 void TissueConfig::SetOutputCellCyclePhases(bool outputCellCyclePhases)
00606 {
00607     mOutputCellCyclePhases = outputCellCyclePhases;
00608 }
00609 void TissueConfig::SetOutputCellAges(bool outputCellAges)
00610 {
00611     mOutputCellAges = outputCellAges;
00612 }
00613 void TissueConfig::SetOutputCellAreas(bool outputCellAreas)
00614 {
00615     mOutputCellAreas = outputCellAreas;
00616 }
00617 void TissueConfig::SetOutputVoronoiData(bool outputVoronoiData)
00618 {
00619     mOutputVoronoiData = outputVoronoiData;
00620 }
00621 void TissueConfig::SetOutputTissueAreas(bool outputTissueAreas)
00622 {
00623     mOutputTissueAreas = outputTissueAreas;
00624 }
00625 void TissueConfig::SetOutputNodeVelocities(bool outputNodeVelocities)
00626 {
00627     mOutputNodeVelocities = outputNodeVelocities;
00628 }

Generated by  doxygen 1.6.2