SubcloneSeeker  1.0.0
Subclone deconvolution software framework
 All Classes Files Functions Variables Macros Pages
treemerge_p.h File Reference
#include "SomaticEvent.h"
#include "Subclone.h"

Go to the source code of this file.

Macros

#define BOUNDRY_RESOLUTION   20000000L
 

Functions

SomaticEventPtr_vec nodeEventsList (Subclone *node)
 
SomaticEventPtr_vec SomaticEventDifference (const SomaticEventPtr_vec &master, const SomaticEventPtr_vec &unwanted)
 
bool eventSetContains (const SomaticEventPtr_vec &v_container, const SomaticEventPtr_vec &v_containee)
 
bool resultSetComparator (const SomaticEventPtr_vec &v1, const SomaticEventPtr_vec &v2)
 
SomaticEventPtr_vec checkPlacement (Subclone *pnode, SomaticEventPtr_vec somaticEvents, bool *placeableOnSubtree, int *cp=NULL)
 
bool TreeMerge (Subclone *p, Subclone *q)
 

Detailed Description

The header file for the implementation part of 'treemerge', which compares two tree sets with implied relationship that treeset1 gave raise to treeset2 with extra mutations, and figures out which pairs are logically correct. The purpose for using a separate implementation source file is to decouple the logic from the command-line interface so that automated test cases can be constructed.

Author
Yi Qiao

Macro Definition Documentation

#define BOUNDRY_RESOLUTION   20000000L

The boundary resolution when comparing SomaticEvents

Function Documentation

SomaticEventPtr_vec checkPlacement ( Subclone pnode,
SomaticEventPtr_vec  somaticEvents,
bool *  placeableOnSubtree,
int *  cp = NULL 
)

Check if a node with certain somatic events can be placed on a subtree of a different subclonal structure.

Parameters
pnodeThe root of a subtree of the subclonal structure, to which the new node is being placed on.
somaticEventsThe somatic events found in the new node, containing all its parents' ones.
placeableOnSubtreeAn output boolean variable indicating whether the placement is successful or not.
cpThe number of children nodes that are able to contain the floating node. Used for debugging purpose.
Returns
A vector containing events not found on the subtree to the point the node is placed.
bool eventSetContains ( const SomaticEventPtr_vec &  v_container,
const SomaticEventPtr_vec &  v_containee 
)

Check if a somatic event vector contains all the events found in another vector.

Parameters
v_containerThe container vector
v_containeeThe containee vector
Returns
True if the container vector contains all the events found in the containee vector, false otherwise
SomaticEventPtr_vec nodeEventsList ( Subclone node)

Generate a list of events from a given subclone node. In the subclone data structure, events of a parent is not duplicated in the children nodes. This function will, from a given subclone node, trace back to the root of the tree, and returning all the events it encounters.

Parameters
nodeThe subclone node to generate event list from.
Returns
A vector of all the events explicitly or implicitly contained by the given node.
bool resultSetComparator ( const SomaticEventPtr_vec &  v1,
const SomaticEventPtr_vec &  v2 
)

Compare SomaticEvent vectors by size.

Parameters
v1The first SomaticEventPtr vector
v2The second SomaticEventPtr vector
Returns
True if v1 has less events than v2, false otherwise
SomaticEventPtr_vec SomaticEventDifference ( const SomaticEventPtr_vec &  master,
const SomaticEventPtr_vec &  unwanted 
)

Calculate the difference between two vectors of somatic events

Parameters
masterThe somatic event vector that contains the wanted events
unwantedThe somatic event vector that contains the unwanted events
Returns
A somatic event vector that contains all the events in 'master' that are not found in 'unwanted'
bool TreeMerge ( Subclone p,
Subclone q 
)

Check if two subclonal trees are compatible.

Parameters
pThe first subclone tree
qThe second subclone tree
Returns
True if the two trees are compatible, false otherwise