Egglib 2.1.11
C++ library reference manual
Public Member Functions | Public Attributes | List of all members
Arg Class Reference

Ancestral recombination graph. More...

#include <Arg.hpp>

Public Member Functions

 Arg ()
 Default constructor. More...
 
void set (Current *current, unsigned int numberOfSegments)
 Object initialization. More...
 
void reset (Current *current)
 Object reset method. More...
 
 Arg (Current *current, unsigned int numberOfSegments)
 Standard constructor. More...
 
virtual ~Arg ()
 Destructor. More...
 
double time () const
 Gets the current value of the time counter. More...
 
void addTime (double increment)
 Increments the time counter. More...
 
void coalescence (double incr, unsigned int pop, unsigned int index1, unsigned int index2)
 Performs a coalescence event. More...
 
void coalescence (double incr, unsigned int pop, Random *random)
 Performs a coalescence event. More...
 
void recombination (double incr, Random *random)
 Performs a recombination event. More...
 
Edgemute (unsigned int segment, double treePosition)
 Places a mutation. More...
 
double ageUltimateMRCA () const
 Age of the uMRCA. More...
 
double ageMRCA (unsigned int segmentIndex)
 Age of the MRCA for a given segment. More...
 
const EdgeMRCA (unsigned int segmentIndex)
 MRCA for each segment. More...
 
const EdgeuMRCA ()
 Ultimate MRCA.
 
std::string newick (unsigned int segment)
 Formats the newick-formatted tree for a segment. More...
 
void set_actualNumberOfSites (unsigned int actualNumberOfSites)
 Set the number of actual sites in all branches.
 

Public Attributes

unsigned int numberOfSegments
 the number of recombining segments
 
unsigned int numberOfSamples
 Number of initial lineages.
 
double totalLength
 Total tree length (summed over all segments) More...
 
double * segmentLengths
 Segment-specific tree length. More...
 
unsigned int numberOfEdges
 Current number of Edges in the tree (including the MRCA node)
 
unsigned int numberOfRecombinationEvents
 Total number of recombination events that occurred.
 

Detailed Description

Ancestral recombination graph.

This class stores the ARG (genealogical information). It is progressively built by appropriate (especially regarding to the timing) calls to coal() and recomb() methods. Then it can be used by a mutator class to generates data, or it can also generate newick trees (one tree by non-recombining segment).

Constructor & Destructor Documentation

Arg ( )

Default constructor.

Creates a null, useless, object.

Arg ( Current current,
unsigned int  numberOfSegments 
)

Standard constructor.

Parameters
currentaddress of the Current instance used by the simulator.
numberOfSegmentsnumber of recombining segments
~Arg ( )
virtual

Destructor.

Clears all Edge instances referenced in the object.

Member Function Documentation

void addTime ( double  increment)

Increments the time counter.

double ageMRCA ( unsigned int  segmentIndex)
inline

Age of the MRCA for a given segment.

The MRCA is the Most Recent Common Ancestor, that is the point where the coalescent process is over (all lineages have coalesced). This member will have a meaningful value only if the coalescent process is completed.

Note that the value is cached; it is computed only one upon first call and no again, even if the Arg is modified<

double ageUltimateMRCA ( ) const
inline

Age of the uMRCA.

The uMRCA is the ultimate Most Recent Common Ancestor, that is the point where the last segment finds its most recent common ancestor. This member will have a meaningful value only if the coalescent process is completed.

void coalescence ( double  incr,
unsigned int  pop,
unsigned int  index1,
unsigned int  index2 
)

Performs a coalescence event.

For this version, the two lineages to coalesce are predefined.

Parameters
incrincrement of the time counter.
popindex of the population.
index1first lineage to coalesce.
index2second lineage to coalesce.
void coalescence ( double  incr,
unsigned int  pop,
Random random 
)

Performs a coalescence event.

For this version, the two lineages to coalesce are randomly picked in the given population

Parameters
incrincrement of the time counter.
popindex of the population.
randompointer to simulator's random generator instance.
const Edge* MRCA ( unsigned int  segmentIndex)
inline

MRCA for each segment.

The MRCA is the Most Recent Common Ancestor, that is the point where the coalescent process is over (all lineages have coalesced). This member will have a meaningful value only if the coalescent process is completed.

Note that the value is cached; it is computed only one upon first call and no again, even if the Arg is modified

Edge * mute ( unsigned int  segment,
double  treePosition 
)

Places a mutation.

Parameters
segmentindex of the segment affected.
treePositiona random number placed on the interval defined by the tree length at this position.
Returns
the concerned Edge's address.

Another nerve-taking point: calling this method assume that all Edge of have previously undergone a call of branchLength(position) with intervalPosition - what should be done by the called (that is, Mutator) through my (Arg's) treeLength of something. BEWARE WHEN MODIFYING (enhancements should be directed to Edge in my view)

std::string newick ( unsigned int  segment)

Formats the newick-formatted tree for a segment.

void recombination ( double  incr,
Random random 
)

Performs a recombination event.

Parameters
incrincrement of the time counter.
randompointer to simulator's random generator instance.
void reset ( Current current)

Object reset method.

This method doesn't reset all parameters (the number of segments and associated tables are retained, as well as the Edge object pool).

Parameters
currentaddress of the Current instance used by the simulator.
void set ( Current current,
unsigned int  numberOfSegments 
)

Object initialization.

Parameters
currentaddress of the Current instance used by the simulator.
numberOfSegmentsnumber of recombining segments.
double time ( ) const

Gets the current value of the time counter.

Member Data Documentation

double* segmentLengths

Segment-specific tree length.

double totalLength

Total tree length (summed over all segments)


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

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads