SubcloneSeeker  1.0.0
Subclone deconvolution software framework
 All Classes Files Functions Variables Macros Pages
SubcloneSeeker::Subclone Class Reference

The class that represents a subclone in a subclonal structure tree. More...

#include <Subclone.h>

Inheritance diagram for SubcloneSeeker::Subclone:
SubcloneSeeker::TreeNode SubcloneSeeker::Archivable

Public Member Functions

 Subclone ()
 
void setParentId (sqlite3_int64 pid)
 
double fraction () const
 
void setFraction (double fraction)
 
double treeFraction () const
 
void setTreeFraction (double fraction)
 
std::vector< EventCluster * > & vecEventCluster ()
 
void addEventCluster (EventCluster *cluster)
 
- Public Member Functions inherited from SubcloneSeeker::TreeNode
 TreeNode ()
 
virtual ~TreeNode ()
 
TreeNodeVec_t & getVecChildren ()
 
TreeNodegetParent ()
 
void addChild (TreeNode *child)
 
void removeChild (TreeNode *child)
 
bool isLeaf () const
 
bool isRoot () const
 
- Public Member Functions inherited from SubcloneSeeker::Archivable
 Archivable ()
 
sqlite3_int64 getId ()
 
void setId (sqlite3_int64 nid)
 
bool createTableInDB (sqlite3 *database)
 
sqlite3_int64 archiveObjectToDB (sqlite3 *database)
 
bool unarchiveObjectFromDB (sqlite3 *database, sqlite3_int64 id)
 
DBObjectID_vec vecAllObjectsID (sqlite3 *database)
 

Protected Member Functions

virtual std::string getTableName ()
 
virtual std::string createTableStatementStr ()
 
virtual std::string createObjectStatementStr ()
 
virtual std::string updateObjectStatementStr ()
 
virtual std::string selectObjectColumnListStr ()
 
virtual int bindObjectToStatement (sqlite3_stmt *statement)
 
virtual void updateObjectFromStatement (sqlite3_stmt *statement)
 

Protected Attributes

double _fraction
 
double _treeFraction
 
std::vector< EventCluster * > _eventClusters
 
sqlite3_int64 parentId
 
- Protected Attributes inherited from SubcloneSeeker::TreeNode
TreeNodeVec_t children
 
TreeNodeparent
 
- Protected Attributes inherited from SubcloneSeeker::Archivable
sqlite3_int64 id
 

Additional Inherited Members

- Static Public Member Functions inherited from SubcloneSeeker::TreeNode
static void PreOrderTraverse (TreeNode *root, TreeTraverseDelegate &traverseDelegate)
 
static void PostOrderTraverse (TreeNode *root, TreeTraverseDelegate &traverseDelegate)
 

Detailed Description

The class that represents a subclone in a subclonal structure tree.

This class implements both the TreeNode and Archivable interfaces, so that it can be a node in a tree structure, and at the same time be archived into a sqlite3 database. This is the fundamental building block of subclonal deconvoution solutions.

Constructor & Destructor Documentation

SubcloneSeeker::Subclone::Subclone ( )
inline

Minimal constructor to reset all member variables

Member Function Documentation

void Subclone::addEventCluster ( EventCluster cluster)

Add a given EventCluster into the subclone

Parameters
clusterThe EventCluster to be added to the subclone
int Subclone::bindObjectToStatement ( sqlite3_stmt *  statement)
protectedvirtual

Bind archivable properties to a prepared, unbound sqlite3 statement

Parameters
statementA prepared, unbound sqlite3 statement instance
Returns
How many parameters are bound to the statement + 1

Implements SubcloneSeeker::Archivable.

std::string Subclone::createObjectStatementStr ( )
protectedvirtual

return the unbound statement for record creation

Returns
unbound statement for record creation

Implements SubcloneSeeker::Archivable.

std::string Subclone::createTableStatementStr ( )
protectedvirtual

return the table definition when creating the table in a sqlite3 database

Imagine a generic SQL create statement: CREATE TABLE <tableName> (id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT <other-columns>); Notice that the returned string must be prefixed with a comma ",", to separate any custom columns from the id column

Returns
The extra column definitions, prefixed with ","

Implements SubcloneSeeker::Archivable.

double SubcloneSeeker::Subclone::fraction ( ) const
inline

return the fraction

Returns
percentage of this subclone
std::string Subclone::getTableName ( )
protectedvirtual

returns the name of the table in which all object of a specific class are stored

Returns
Table name

Implements SubcloneSeeker::Archivable.

std::string Subclone::selectObjectColumnListStr ( )
protectedvirtual

return the list of columns to be used in select statement for getting data from the database

Imagine the generic SQL select statement: SELECT <col1>, <col2>, ... FROM <tableName> WHERE id=?; The method should return the <col1>,<col2>,... part

Returns
the list of columns as string

Implements SubcloneSeeker::Archivable.

void SubcloneSeeker::Subclone::setFraction ( double  fraction)
inline

update the fraction

Parameters
fractionThe new fraction value
void SubcloneSeeker::Subclone::setParentId ( sqlite3_int64  pid)
inline

set parent id

Parameters
pidThe new parent id
void SubcloneSeeker::Subclone::setTreeFraction ( double  fraction)
inline

update the tree fraction

Parameters
fractionThe new tree fraction value
double SubcloneSeeker::Subclone::treeFraction ( ) const
inline

return the tree fraction

Returns
percentage of the subtree rooted by this subclone
void Subclone::updateObjectFromStatement ( sqlite3_stmt *  statement)
protectedvirtual

Populate archivable properties from a prepared statement during unarchiving

Parameters
statementA prepared statement contains the retrieved row

Implements SubcloneSeeker::Archivable.

std::string Subclone::updateObjectStatementStr ( )
protectedvirtual

return the unbound statement for record update

Returns
unbound statement for record update

Implements SubcloneSeeker::Archivable.

std::vector<EventCluster *>& SubcloneSeeker::Subclone::vecEventCluster ( )
inline

retreve a vector of all EventClusters this subclone has

Returns
member EventCluster vector

Member Data Documentation

std::vector<EventCluster *> SubcloneSeeker::Subclone::_eventClusters
protected

the event clusters this subclone contains

double SubcloneSeeker::Subclone::_fraction
protected

The percentage of this subclone

double SubcloneSeeker::Subclone::_treeFraction
protected

The total fraction taken by the subtree rooted by this object

sqlite3_int64 SubcloneSeeker::Subclone::parentId
protected

The database id of the parent node, 0 represents a root


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