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

Edge of the ancestral recombination graph. More...

#include <Edge.hpp>

Public Member Functions

virtual ~Edge ()
 Destructor.
 
 Edge (unsigned int numberOfSegments)
 Constructor. More...
 
void reset ()
 Restore object to factory state.
 
void coalescence (double date, Edge *son1, Edge *son2, unsigned int *edgesPerSegments, Edge **MRCA, double &totalLength, double *segmentLengths)
 Builds for internal node. More...
 
void recombination (double date, Edge *dest1, Edge *dest2, Random *random, double &totalLength, double *segmentLengths)
 Generates a recombination event. More...
 
void set_terminal (unsigned int leaf_index)
 Define this edge to be terminal. More...
 
bool segment (unsigned int segmentIndex) const
 Checks if a given segment is covered.
 
unsigned int label () const
 leaf index (0 for internal nodes)
 
void set_actualNumberOfSites (unsigned int actualNumberOfSites)
 Sets the actual number of sites.
 

Public Attributes

double length
 Branch's raw length (doesn't take account segment coverage)
 
unsigned int coverage
 Number of covered segments.
 
double bottom
 Time position of the branch's bottom.
 
double top
 Time position of the branch's top.
 
Edgeson1
 Address of the first son.
 
Edgeson2
 Address of the second son.
 
unsigned int numberOfSons
 Number of sons (0, 1 or 2)
 
unsigned int * numberOfMutationsPerActualSite
 Number of mutations per segment.
 

Detailed Description

Edge of the ancestral recombination graph.

Each Edge instance provides access to its 0, 1 or 2 descendants (the former holds for a terminal node, the middle for the parent of a recombined node and the latter for the parent of a coalesced node (most classical node in the coalescent).The Edge also provides to the edge length. Note that the Edge instance must be understood as an ARG node and the branch above it (latter in the coalescence process). Edge instances also keep track of the list of descendants descending from this node (which may differ along recombining segment). Edge instances must be created through one of the "default" and "coalescence" constructors or through the recombination method. Edge instances should never be copied but manipulated by references.

Constructor & Destructor Documentation

Edge ( unsigned int  numberOfSegments)

Constructor.

Parameters
numberOfSegmentsthe number of recombining segments (one for a non-recombining region).

Use the Pool, instead. Objects are delivered with a complete coverage.

Member Function Documentation

void coalescence ( double  date,
Edge son1,
Edge son2,
unsigned int *  edgesPerSegments,
Edge **  MRCA,
double &  totalLength,
double *  segmentLengths 
)

Builds for internal node.

Parameters
datethe date of creation of the edge.
son1first edge descending from this edge.
son2second edge descending from this edge.
edgesPerSegmentscounts the current number of (non-coalesced lineages for each lineages); must have the appropriate size and will be updated.
MRCAthe list where to place the address of segment MRCA, if it occurs.
totalLengththe total length of the tree.
segmentLengthsthe table of tree lengths per segment.

Assumes the current object has the correct number of segments.

void recombination ( double  date,
Edge dest1,
Edge dest2,
Random random,
double &  totalLength,
double *  segmentLengths 
)

Generates a recombination event.

Parameters
datethe date of the event.
dest1destination for the first resulting edge.
dest2destination for the second resulting edge.
randompointer to the Random instance used by the simulator.
totalLengththe total length of the tree.
segmentLengthsthe table of tree lengths per segment.

dest1 and dest2 must be Edge address initialized with the appropriate number of segments.

void set_terminal ( unsigned int  leaf_index)

Define this edge to be terminal.

The edge have only non-covered 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