Chaste Commit::f2ff7ee04e70ac9d06c57344df8d017dbb12b97b
Cell Class Reference

#include <Cell.hpp>

+ Inheritance diagram for Cell:
+ Collaboration diagram for Cell:

Public Member Functions

 Cell (boost::shared_ptr< AbstractCellProperty > pMutationState, AbstractCellCycleModel *pCellCycleModel, AbstractSrnModel *pSrnModel=nullptr, bool archiving=false, CellPropertyCollection cellPropertyCollection=CellPropertyCollection())
 
virtual ~Cell ()
 
boost::shared_ptr< AbstractCellProliferativeTypeGetCellProliferativeType () const
 
void SetCellProliferativeType (boost::shared_ptr< AbstractCellProperty > pProliferativeType)
 
void SetBirthTime (double birthTime)
 
void SetCellCycleModel (AbstractCellCycleModel *pCellCycleModel)
 
AbstractCellCycleModelGetCellCycleModel () const
 
void InitialiseCellCycleModel ()
 
void SetSrnModel (AbstractSrnModel *pSrnModel)
 
AbstractSrnModelGetSrnModel () const
 
void InitialiseSrnModel ()
 
double GetAge () const
 
double GetBirthTime () const
 
double GetStartOfApoptosisTime () const
 
double GetApoptosisTime () const
 
void SetApoptosisTime (double apoptosisTime)
 
boost::shared_ptr< AbstractCellMutationStateGetMutationState () const
 
boost::shared_ptr< CellDataGetCellData () const
 
boost::shared_ptr< CellEdgeDataGetCellEdgeData () const
 
bool HasCellVecData () const
 
boost::shared_ptr< CellVecDataGetCellVecData () const
 
void SetMutationState (boost::shared_ptr< AbstractCellProperty > pMutationState)
 
CellPropertyCollectionrGetCellPropertyCollection ()
 
const CellPropertyCollectionrGetCellPropertyCollection () const
 
void AddCellProperty (const boost::shared_ptr< AbstractCellProperty > &rProperty)
 
template<typename CLASS >
void RemoveCellProperty ()
 
template<typename CLASS >
bool HasCellProperty () const
 
bool ReadyToDivide ()
 
virtual CellPtr Divide ()
 
void StartApoptosis (bool setDeathTime=true)
 
void Kill ()
 
bool HasApoptosisBegun () const
 
double GetTimeUntilDeath () const
 
bool IsDead ()
 
void SetLogged ()
 
bool IsLogged ()
 
void SetAncestor (boost::shared_ptr< AbstractCellProperty > pCellAncestor)
 
unsigned GetAncestor () const
 
unsigned GetCellId () const
 
bool HasSrnModel () const
 

Protected Attributes

bool mCanDivide
 
CellPropertyCollection mCellPropertyCollection
 
AbstractCellCycleModelmpCellCycleModel
 
AbstractSrnModelmpSrnModel
 
double mDeathTime
 
double mStartOfApoptosisTime
 
double mApoptosisTime
 
bool mUndergoingApoptosis
 
bool mIsDead
 
bool mIsLogged
 
bool mHasSrnModel
 

Private Member Functions

template<class Archive >
void serialize (Archive &archive, const unsigned int version)
 

Friends

class boost::serialization::access
 

Detailed Description

Cell is the basic container for all the biological information about a cell. It contains the cell-cycle model and all other biological properties such as mutation state, cell type, whether it is undergoing apoptosis or not.

This class should not store any spatial information - cells are linked to space by the AbstractCellPopulation subclasses.

Definition at line 91 of file Cell.hpp.

Constructor & Destructor Documentation

◆ Cell()

Cell::Cell ( boost::shared_ptr< AbstractCellProperty pMutationState,
AbstractCellCycleModel pCellCycleModel,
AbstractSrnModel pSrnModel = nullptr,
bool  archiving = false,
CellPropertyCollection  cellPropertyCollection = CellPropertyCollection() 
)

Create a new cell.

Parameters
pMutationStatethe mutation state of the cell
pCellCycleModelthe cell-cycle model to use to decide when the cell divides. This MUST be allocated using new, and will be deleted when the cell is destroyed.
pSrnModelthe sub-cellular reaction network model. This MUST be allocated using new, and will be deleted when the cell is destroyed. (Defaults to NULL and is replcaed by a new NullSrnModel in the constructr)
archivingwhether this constructor is being called by the archiver - do things slightly differently! (defaults to false)
cellPropertyCollectionthe cell property collection (defaults to NULL)

Definition at line 46 of file Cell.cpp.

References CellPropertyCollection::AddProperty(), CellPropertyCollection::Begin(), CellPropertyCollection::End(), EXCEPTION, CellPropertyCollection::HasProperty(), CellPropertyCollection::HasPropertyType(), CellPropertyRegistry::Instance(), SimulationTime::Instance(), MAKE_PTR, mCellPropertyCollection, mHasSrnModel, mpCellCycleModel, mpSrnModel, AbstractCellCycleModel::SetCell(), and AbstractSrnModel::SetCell().

◆ ~Cell()

Cell::~Cell ( )
virtual

Destructor, which frees the memory allocated for our cell-cycle model.

Definition at line 145 of file Cell.cpp.

References Kill(), mIsDead, mpCellCycleModel, and mpSrnModel.

Member Function Documentation

◆ AddCellProperty()

void Cell::AddCellProperty ( const boost::shared_ptr< AbstractCellProperty > &  rProperty)

Add a cell property to the cell. Use this method instead of calling rGetCellPropertyCollection().AddProperty() directly, to ensure that the cell property keeps correct track of the number of cells with it (if this is done).

Parameters
rPropertythe property to add

Definition at line 326 of file Cell.cpp.

References CellPropertyCollection::AddProperty(), CellPropertyCollection::HasProperty(), and mCellPropertyCollection.

Referenced by SetAncestor(), SetCellProliferativeType(), SetMutationState(), and StartApoptosis().

◆ Divide()

◆ GetAge()

double Cell::GetAge ( ) const
Returns
the cell's age from its cell-cycle model.

Definition at line 226 of file Cell.cpp.

References AbstractCellCycleModel::GetAge(), and mpCellCycleModel.

◆ GetAncestor()

unsigned Cell::GetAncestor ( ) const
Returns
The ancestor object, inherited from parents or set using the method above, used for monoclonality experiments.

Definition at line 444 of file Cell.cpp.

References CellPropertyCollection::GetPropertiesType(), CellPropertyCollection::GetProperty(), CellPropertyCollection::GetSize(), mCellPropertyCollection, and UNSIGNED_UNSET.

◆ GetApoptosisTime()

double Cell::GetApoptosisTime ( ) const
Returns
mApoptosisTime

Definition at line 377 of file Cell.cpp.

References mApoptosisTime.

◆ GetBirthTime()

double Cell::GetBirthTime ( ) const
Returns
the cell's birth time from its cell-cycle model.

Definition at line 231 of file Cell.cpp.

References AbstractCellCycleModel::GetBirthTime(), and mpCellCycleModel.

◆ GetCellCycleModel()

AbstractCellCycleModel * Cell::GetCellCycleModel ( ) const
Returns
a pointer to the Cell's cell-cycle model.

Definition at line 195 of file Cell.cpp.

References mpCellCycleModel.

◆ GetCellData()

boost::shared_ptr< CellData > Cell::GetCellData ( ) const

Get the CellData associated with the cell.

Returns
a pointer to the cell data

Definition at line 270 of file Cell.cpp.

References CellPropertyCollection::GetPropertiesType(), CellPropertyCollection::GetProperty(), CellPropertyCollection::GetSize(), and mCellPropertyCollection.

Referenced by Divide().

◆ GetCellEdgeData()

boost::shared_ptr< CellEdgeData > Cell::GetCellEdgeData ( ) const

Get the CellEdgeData associated with the cell.

Returns
a pointer to the cell edge data

Definition at line 283 of file Cell.cpp.

References CellPropertyCollection::GetPropertiesType(), CellPropertyCollection::GetProperty(), CellPropertyCollection::GetSize(), and mCellPropertyCollection.

Referenced by Divide().

◆ GetCellId()

unsigned Cell::GetCellId ( ) const

◆ GetCellProliferativeType()

boost::shared_ptr< AbstractCellProliferativeType > Cell::GetCellProliferativeType ( ) const

◆ GetCellVecData()

boost::shared_ptr< CellVecData > Cell::GetCellVecData ( ) const

Get the CellVecData associated with the cell.

Returns
a pointer to the cell Vec data

Definition at line 301 of file Cell.cpp.

References CellPropertyCollection::GetPropertiesType(), CellPropertyCollection::GetProperty(), CellPropertyCollection::GetSize(), HasCellVecData(), and mCellPropertyCollection.

Referenced by Divide().

◆ GetMutationState()

boost::shared_ptr< AbstractCellMutationState > Cell::GetMutationState ( ) const
Returns
the cell's current mutation state.

Definition at line 255 of file Cell.cpp.

References CellPropertyCollection::GetPropertiesType(), CellPropertyCollection::GetProperty(), CellPropertyCollection::GetSize(), and mCellPropertyCollection.

Referenced by Divide(), and SetMutationState().

◆ GetSrnModel()

AbstractSrnModel * Cell::GetSrnModel ( ) const
Returns
a pointer to the Cell's SRN model.

Definition at line 216 of file Cell.cpp.

References mpSrnModel.

◆ GetStartOfApoptosisTime()

double Cell::GetStartOfApoptosisTime ( ) const
Returns
the time at which apoptosis was commanded to start.

Definition at line 372 of file Cell.cpp.

References mStartOfApoptosisTime.

◆ GetTimeUntilDeath()

double Cell::GetTimeUntilDeath ( ) const
Returns
How long until the cell dies (if it is in apoptosis, throws an exception if not)

Definition at line 388 of file Cell.cpp.

References EXCEPTION, SimulationTime::GetTime(), SimulationTime::Instance(), mDeathTime, and mUndergoingApoptosis.

◆ HasApoptosisBegun()

bool Cell::HasApoptosisBegun ( ) const
Returns
whether the cell is undergoing apoptosis or not.

Definition at line 367 of file Cell.cpp.

References mUndergoingApoptosis.

◆ HasCellProperty()

template<typename CLASS >
bool Cell::HasCellProperty ( ) const
inline
Returns
whether the cell property collection contains a property that has the exact type CLASS. Just calls mCellPropertyCollection.HasProperty().

Definition at line 357 of file Cell.hpp.

References CellPropertyCollection::HasProperty(), and mCellPropertyCollection.

◆ HasCellVecData()

bool Cell::HasCellVecData ( ) const

Checks whether there is CellVecData associated with this cell

Returns
whether the current cell stores CellVecData

Definition at line 296 of file Cell.cpp.

References CellPropertyCollection::HasPropertyType(), and mCellPropertyCollection.

Referenced by GetCellVecData().

◆ HasSrnModel()

bool Cell::HasSrnModel ( ) const
Returns
Whether the cell has a sub-cellular reaction network (SRN) system of ODEs associated with it

Definition at line 548 of file Cell.cpp.

References mHasSrnModel.

◆ InitialiseCellCycleModel()

void Cell::InitialiseCellCycleModel ( )

Calls Initialise on the cell-cycle model associated with this cell.

Definition at line 200 of file Cell.cpp.

References AbstractCellCycleModel::Initialise(), and mpCellCycleModel.

◆ InitialiseSrnModel()

void Cell::InitialiseSrnModel ( )

Calls Initialise on the SRN model associated with this cell.

Definition at line 221 of file Cell.cpp.

References AbstractSrnModel::Initialise(), and mpSrnModel.

◆ IsDead()

bool Cell::IsDead ( )
Returns
whether the cell is dead or undergoing apoptosis.

Definition at line 398 of file Cell.cpp.

References SimulationTime::Instance(), Kill(), mApoptosisTime, mDeathTime, mIsDead, and mUndergoingApoptosis.

Referenced by Divide(), ReadyToDivide(), and StartApoptosis().

◆ IsLogged()

bool Cell::IsLogged ( )
Returns
Whether the cell is being tracked.

Definition at line 341 of file Cell.cpp.

References mIsLogged.

◆ Kill()

void Cell::Kill ( )

This labels the cell as dead, it does not delete the cell, it remains in the CellPopulation until AbstractCellPopulation::RemoveDeadCells() is called.

Definition at line 411 of file Cell.cpp.

References CellPropertyCollection::Begin(), CellPropertyCollection::End(), mCellPropertyCollection, and mIsDead.

Referenced by ~Cell(), and IsDead().

◆ ReadyToDivide()

bool Cell::ReadyToDivide ( )
Returns
whether this cell is ready to divide at the present simulation time. MUST be called before calling Divide().

Definition at line 470 of file Cell.cpp.

References IsDead(), mCanDivide, mpCellCycleModel, mpSrnModel, mUndergoingApoptosis, AbstractCellCycleModel::ReadyToDivide(), and AbstractSrnModel::SimulateToCurrentTime().

◆ RemoveCellProperty()

template<typename CLASS >
void Cell::RemoveCellProperty ( )
inline

Remove a cell property of the given type. Use this method instead of calling rGetCellPropertyCollection().AddProperty() directly, to ensure that the cell property keeps correct track of the number of cells with it (if this is done).

Definition at line 330 of file Cell.hpp.

References CellPropertyCollection::Begin(), CellPropertyCollection::End(), mCellPropertyCollection, and CellPropertyCollection::RemoveProperty().

◆ rGetCellPropertyCollection() [1/2]

CellPropertyCollection & Cell::rGetCellPropertyCollection ( )
Returns
reference to mCellPropertyCollection.

Definition at line 316 of file Cell.cpp.

References mCellPropertyCollection.

◆ rGetCellPropertyCollection() [2/2]

const CellPropertyCollection & Cell::rGetCellPropertyCollection ( ) const
Returns
reference to mCellPropertyCollection (used in archiving).

Definition at line 321 of file Cell.cpp.

References mCellPropertyCollection.

◆ serialize()

template<class Archive >
void Cell::serialize ( Archive &  archive,
const unsigned int  version 
)
inlineprivate

Archive the member variables.

Parameters
archivethe archive
versionthe current version of this class

Definition at line 104 of file Cell.hpp.

References mApoptosisTime, mCanDivide, mDeathTime, mHasSrnModel, mIsDead, mIsLogged, mpCellCycleModel, mpSrnModel, mStartOfApoptosisTime, and mUndergoingApoptosis.

◆ SetAncestor()

void Cell::SetAncestor ( boost::shared_ptr< AbstractCellProperty pCellAncestor)

Give the cell an index which it passes to its children.

Parameters
pCellAncestorthe cell's ancestor

Definition at line 423 of file Cell.cpp.

References AddCellProperty(), EXCEPTION, CellPropertyCollection::GetPropertiesType(), CellPropertyCollection::GetSize(), and mCellPropertyCollection.

◆ SetApoptosisTime()

void Cell::SetApoptosisTime ( double  apoptosisTime)

Set mApoptosisTime.

Parameters
apoptosisTimethe new value of mApoptosisTime

Definition at line 382 of file Cell.cpp.

References mApoptosisTime.

◆ SetBirthTime()

void Cell::SetBirthTime ( double  birthTime)

Set the birth time of the cell - can be negative so that your cells have an age when a simulation begins

Parameters
birthTimeThe time the cell was born (in hours)

Definition at line 236 of file Cell.cpp.

References mpCellCycleModel, and AbstractCellCycleModel::SetBirthTime().

◆ SetCellCycleModel()

void Cell::SetCellCycleModel ( AbstractCellCycleModel pCellCycleModel)

Change the cell-cycle model used. This takes effect immediately.

Parameters
pCellCycleModelpointer to the cell-cycle model to use

Definition at line 185 of file Cell.cpp.

References mpCellCycleModel, and AbstractCellCycleModel::SetCell().

◆ SetCellProliferativeType()

void Cell::SetCellProliferativeType ( boost::shared_ptr< AbstractCellProperty pProliferativeType)

Set the cell's proliferative type.

Parameters
pProliferativeTypethe cell's new proliferative type

Definition at line 155 of file Cell.cpp.

References AddCellProperty(), EXCEPTION, GetCellProliferativeType(), mCellPropertyCollection, and CellPropertyCollection::RemoveProperty().

◆ SetLogged()

void Cell::SetLogged ( )

Sets a flag to perform special output on this cell only.

Definition at line 336 of file Cell.cpp.

References mIsLogged.

◆ SetMutationState()

void Cell::SetMutationState ( boost::shared_ptr< AbstractCellProperty pMutationState)

Set the cell's mutation state.

Parameters
pMutationStatethe cell's new mutation state

Definition at line 241 of file Cell.cpp.

References AddCellProperty(), EXCEPTION, GetMutationState(), mCellPropertyCollection, and CellPropertyCollection::RemoveProperty().

◆ SetSrnModel()

void Cell::SetSrnModel ( AbstractSrnModel pSrnModel)

Change the SRN model used. This takes effect immediately.

Parameters
pSrnModelpointer to the SRN model to use

Definition at line 205 of file Cell.cpp.

References mHasSrnModel, mpSrnModel, and AbstractSrnModel::SetCell().

◆ StartApoptosis()

void Cell::StartApoptosis ( bool  setDeathTime = true)

Make the cell enter apoptosis and sets mDeathTime using the apoptosis time as defined by mApoptosisTime.

Parameters
setDeathTimewhether we tell the cell exactly when to die (defaults to true)

Definition at line 346 of file Cell.cpp.

References AddCellProperty(), EXCEPTION, CellPropertyRegistry::Get(), CellPropertyCollection::GetCellPropertyRegistry(), SimulationTime::GetTime(), SimulationTime::Instance(), IsDead(), mApoptosisTime, mCellPropertyCollection, mDeathTime, mStartOfApoptosisTime, and mUndergoingApoptosis.

Friends And Related Symbol Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Needed for serialization.

Definition at line 96 of file Cell.hpp.

Member Data Documentation

◆ mApoptosisTime

double Cell::mApoptosisTime
protected

The time it takes for a cell to fully undergo apoptosis. Has units of hours.

Definition at line 140 of file Cell.hpp.

Referenced by Divide(), GetApoptosisTime(), IsDead(), serialize(), SetApoptosisTime(), and StartApoptosis().

◆ mCanDivide

bool Cell::mCanDivide
protected

Caches the result of ReadyToDivide() so Divide() can look at it.

Definition at line 122 of file Cell.hpp.

Referenced by Divide(), ReadyToDivide(), and serialize().

◆ mCellPropertyCollection

◆ mDeathTime

double Cell::mDeathTime
protected

When the cell will/did die.

Definition at line 134 of file Cell.hpp.

Referenced by GetTimeUntilDeath(), IsDead(), serialize(), and StartApoptosis().

◆ mHasSrnModel

bool Cell::mHasSrnModel
protected

Whether the cell has a sub-cellular reaction network (SRN) system of ODEs associated with it.

Definition at line 155 of file Cell.hpp.

Referenced by Cell(), HasSrnModel(), serialize(), and SetSrnModel().

◆ mIsDead

bool Cell::mIsDead
protected

Whether the cell is dead or not (they exist in the CellPopulation until they are removed by AbstractCellPopulation::RemoveDeadCells().

Definition at line 149 of file Cell.hpp.

Referenced by ~Cell(), IsDead(), Kill(), and serialize().

◆ mIsLogged

bool Cell::mIsLogged
protected

Whether the cell is being tracked specially.

Definition at line 152 of file Cell.hpp.

Referenced by IsLogged(), serialize(), and SetLogged().

◆ mpCellCycleModel

AbstractCellCycleModel* Cell::mpCellCycleModel
protected

◆ mpSrnModel

AbstractSrnModel* Cell::mpSrnModel
protected

The cell's sub-cellular reaction network (SRN) model.

Definition at line 131 of file Cell.hpp.

Referenced by Cell(), ~Cell(), Divide(), GetSrnModel(), InitialiseSrnModel(), ReadyToDivide(), serialize(), and SetSrnModel().

◆ mStartOfApoptosisTime

double Cell::mStartOfApoptosisTime
protected

When the cell was commanded to start apoptosis.

Definition at line 137 of file Cell.hpp.

Referenced by GetStartOfApoptosisTime(), serialize(), and StartApoptosis().

◆ mUndergoingApoptosis

bool Cell::mUndergoingApoptosis
protected

Whether the cell is currently in apoptosis - don't divide.

Definition at line 143 of file Cell.hpp.

Referenced by GetTimeUntilDeath(), HasApoptosisBegun(), IsDead(), ReadyToDivide(), serialize(), and StartApoptosis().


The documentation for this class was generated from the following files: