bpp-phyl3  3.0.0
bpp::PhyloBranchMapping Class Reference

#include <Bpp/Phyl/Mapping/PhyloBranchMapping.h>

+ Inheritance diagram for bpp::PhyloBranchMapping:
+ Collaboration diagram for bpp::PhyloBranchMapping:

Public Member Functions

 PhyloBranchMapping ()
 Constructors. More...
 
 PhyloBranchMapping (double length)
 
 PhyloBranchMapping (const PhyloBranch &branch)
 
 PhyloBranchMapping (const PhyloBranchMapping &branch)
 Copy constructor. More...
 
PhyloBranchMappingoperator= (const PhyloBranchMapping &branch)
 Assignation operator. More...
 
PhyloBranchMappingclone () const
 
 ~PhyloBranchMapping ()
 destructor. In Graph, nothing is changed. More...
 
void setNumberOfSites (size_t nbSites)
 Sets a number of sites. If the number of types is already defined, it is kept. More...
 
void setNumberOfTypes (size_t nbTypes)
 Define a number of types. More...
 
void setNumberOfSitesAndTypes (size_t nbSites, size_t nbTypes)
 Define a number of types. More...
 
size_t getNumberOfSites () const
 Gets the number of sites. More...
 
size_t getNumberOfTypes () const
 Gets the number of types. More...
 
VdoublegetSiteCount (size_t site)
 Gets the counts at a given site. More...
 
const VdoublegetSiteCount (size_t site) const
 
double getSiteTypeCount (size_t site, size_t type) const
 Gets the counts at a given site on a given type. More...
 
void setSiteTypeCount (size_t site, size_t type, double value)
 Sets the counts at a given site on a given type. More...
 
double operator() (size_t site, size_t type) const
 Without check. More...
 
double & operator() (size_t site, size_t type)
 
const VVdoublegetCounts () const
 return counts More...
 
VVdoublegetCounts ()
 
bool hasLength () const
 Has the length been set? More...
 
void deleteLength ()
 Delete length. More...
 
double getLength () const
 What is the branch length? More...
 
void setLength (double newLength)
 
void setProperty (const std::string &name, const Clonable &property)
 Set/add a branch property. More...
 
ClonablegetProperty (const std::string &name)
 
const ClonablegetProperty (const std::string &name) const
 
ClonableremoveProperty (const std::string &name)
 
void deleteProperty (const std::string &name)
 
void removeProperties ()
 Remove all branch properties. More...
 
void deleteProperties ()
 Delete all branch properties. More...
 
bool hasProperty (const std::string &name) const
 
std::vector< std::string > getPropertyNames () const
 
bool hasBootstrapValue () const
 
double getBootstrapValue () const
 

Protected Attributes

VVdouble counts_
 
bool isLengthDefined_
 
double length_
 
std::map< std::string, Clonable * > properties_
 

Detailed Description

Definition at line 25 of file PhyloBranchMapping.h.

Constructor & Destructor Documentation

◆ PhyloBranchMapping() [1/4]

bpp::PhyloBranchMapping::PhyloBranchMapping ( )
inline

Constructors.

Warning
phyloTree_ does not know the edge exists.

Definition at line 44 of file PhyloBranchMapping.h.

Referenced by clone().

◆ PhyloBranchMapping() [2/4]

bpp::PhyloBranchMapping::PhyloBranchMapping ( double  length)
inline

Definition at line 49 of file PhyloBranchMapping.h.

◆ PhyloBranchMapping() [3/4]

bpp::PhyloBranchMapping::PhyloBranchMapping ( const PhyloBranch branch)
inline

Definition at line 54 of file PhyloBranchMapping.h.

◆ PhyloBranchMapping() [4/4]

bpp::PhyloBranchMapping::PhyloBranchMapping ( const PhyloBranchMapping branch)
inline

Copy constructor.

Parameters
branchThe branch to copy.

Definition at line 65 of file PhyloBranchMapping.h.

◆ ~PhyloBranchMapping()

bpp::PhyloBranchMapping::~PhyloBranchMapping ( )
inline

destructor. In Graph, nothing is changed.

Definition at line 89 of file PhyloBranchMapping.h.

Member Function Documentation

◆ clone()

PhyloBranchMapping* bpp::PhyloBranchMapping::clone ( ) const
inline

Definition at line 83 of file PhyloBranchMapping.h.

References PhyloBranchMapping().

◆ deleteLength()

void bpp::PhyloBranch::deleteLength ( )
inlineinherited

Delete length.

Definition at line 90 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_.

◆ deleteProperties()

void bpp::PhyloBranch::deleteProperties ( )
inlineinherited

Delete all branch properties.

Definition at line 189 of file PhyloBranch.h.

References bpp::PhyloBranch::properties_.

Referenced by bpp::PhyloBranch::~PhyloBranch().

◆ deleteProperty()

void bpp::PhyloBranch::deleteProperty ( const std::string &  name)
inlineinherited

◆ getBootstrapValue()

double bpp::PhyloBranch::getBootstrapValue ( ) const
inlineinherited

◆ getCounts() [1/2]

VVdouble& bpp::PhyloBranchMapping::getCounts ( )
inline

Definition at line 203 of file PhyloBranchMapping.h.

References counts_.

◆ getCounts() [2/2]

const VVdouble& bpp::PhyloBranchMapping::getCounts ( ) const
inline

return counts

Definition at line 198 of file PhyloBranchMapping.h.

References counts_.

◆ getLength()

double bpp::PhyloBranch::getLength ( ) const
inlineinherited

What is the branch length?

Returns
a double representing the branch length, 0 if length is not defined.

Definition at line 101 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_, and bpp::PhyloBranch::length_.

Referenced by bpp::PhyloBranchParam::PhyloBranchParam().

◆ getNumberOfSites()

size_t bpp::PhyloBranchMapping::getNumberOfSites ( ) const
inline

Gets the number of sites.

Definition at line 121 of file PhyloBranchMapping.h.

References counts_.

Referenced by getSiteTypeCount(), and setSiteTypeCount().

◆ getNumberOfTypes()

size_t bpp::PhyloBranchMapping::getNumberOfTypes ( ) const
inline

Gets the number of types.

Definition at line 129 of file PhyloBranchMapping.h.

References counts_.

Referenced by getSiteTypeCount(), and setSiteTypeCount().

◆ getProperty() [1/2]

Clonable* bpp::PhyloBranch::getProperty ( const std::string &  name)
inlineinherited

◆ getProperty() [2/2]

const Clonable* bpp::PhyloBranch::getProperty ( const std::string &  name) const
inlineinherited

◆ getPropertyNames()

std::vector<std::string> bpp::PhyloBranch::getPropertyNames ( ) const
inlineinherited

Definition at line 200 of file PhyloBranch.h.

References bpp::MapTools::getKeys(), and bpp::PhyloBranch::properties_.

◆ getSiteCount() [1/2]

Vdouble& bpp::PhyloBranchMapping::getSiteCount ( size_t  site)
inline

Gets the counts at a given site.

Definition at line 138 of file PhyloBranchMapping.h.

References counts_.

◆ getSiteCount() [2/2]

const Vdouble& bpp::PhyloBranchMapping::getSiteCount ( size_t  site) const
inline

Definition at line 143 of file PhyloBranchMapping.h.

References counts_.

◆ getSiteTypeCount()

double bpp::PhyloBranchMapping::getSiteTypeCount ( size_t  site,
size_t  type 
) const
inline

Gets the counts at a given site on a given type.

With check

Definition at line 157 of file PhyloBranchMapping.h.

References counts_, getNumberOfSites(), and getNumberOfTypes().

◆ hasBootstrapValue()

bool bpp::PhyloBranch::hasBootstrapValue ( ) const
inlineinherited

Definition at line 202 of file PhyloBranch.h.

References bpp::PhyloBranch::properties_.

Referenced by bpp::PhyloBranch::getBootstrapValue().

◆ hasLength()

bool bpp::PhyloBranch::hasLength ( ) const
inlineinherited

Has the length been set?

Returns
true if a length has been defined

Definition at line 81 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_.

Referenced by bpp::PhyloBranchParam::PhyloBranchParam().

◆ hasProperty()

bool bpp::PhyloBranch::hasProperty ( const std::string &  name) const
inlineinherited

◆ operator()() [1/2]

double& bpp::PhyloBranchMapping::operator() ( size_t  site,
size_t  type 
)
inline

Definition at line 189 of file PhyloBranchMapping.h.

References counts_.

◆ operator()() [2/2]

double bpp::PhyloBranchMapping::operator() ( size_t  site,
size_t  type 
) const
inline

Without check.

Definition at line 184 of file PhyloBranchMapping.h.

References counts_.

◆ operator=()

PhyloBranchMapping& bpp::PhyloBranchMapping::operator= ( const PhyloBranchMapping branch)
inline

Assignation operator.

Parameters
branchthe branch to copy.
Returns
A reference toward this branch.

Definition at line 76 of file PhyloBranchMapping.h.

References counts_, and bpp::PhyloBranch::operator=().

◆ removeProperties()

void bpp::PhyloBranch::removeProperties ( )
inlineinherited

Remove all branch properties.

Attached objects will not be deleted.

Definition at line 181 of file PhyloBranch.h.

References bpp::PhyloBranch::properties_.

◆ removeProperty()

Clonable* bpp::PhyloBranch::removeProperty ( const std::string &  name)
inlineinherited

◆ setLength()

void bpp::PhyloBranch::setLength ( double  newLength)
inlineinherited

Define a new branch length

Parameters
newLengtha double repserenting the new length of the branch

Definition at line 114 of file PhyloBranch.h.

References bpp::PhyloBranch::isLengthDefined_, and bpp::PhyloBranch::length_.

◆ setNumberOfSites()

void bpp::PhyloBranchMapping::setNumberOfSites ( size_t  nbSites)
inline

Sets a number of sites. If the number of types is already defined, it is kept.

Definition at line 96 of file PhyloBranchMapping.h.

References counts_, and bpp::VectorTools::resize2().

◆ setNumberOfSitesAndTypes()

void bpp::PhyloBranchMapping::setNumberOfSitesAndTypes ( size_t  nbSites,
size_t  nbTypes 
)
inline

Define a number of types.

Definition at line 112 of file PhyloBranchMapping.h.

References counts_, and bpp::VectorTools::resize2().

◆ setNumberOfTypes()

void bpp::PhyloBranchMapping::setNumberOfTypes ( size_t  nbTypes)
inline

Define a number of types.

Definition at line 104 of file PhyloBranchMapping.h.

References counts_, and bpp::VectorTools::resize2().

◆ setProperty()

void bpp::PhyloBranch::setProperty ( const std::string &  name,
const Clonable property 
)
inlineinherited

Set/add a branch property.

If no property with the same name is found, the new property will be added to the list. Conversely, the property will be deleted and replaced by the new one. If you want to keep a copy of the old property, consider using the removeProperty function before.

Parameters
nameThe name of the property to set.
propertyThe property object (will be cloned).

Definition at line 130 of file PhyloBranch.h.

References bpp::PhyloBranch::hasProperty(), and bpp::PhyloBranch::properties_.

◆ setSiteTypeCount()

void bpp::PhyloBranchMapping::setSiteTypeCount ( size_t  site,
size_t  type,
double  value 
)
inline

Sets the counts at a given site on a given type.

Definition at line 170 of file PhyloBranchMapping.h.

References counts_, getNumberOfSites(), and getNumberOfTypes().

Member Data Documentation

◆ counts_

◆ isLengthDefined_

bool bpp::PhyloBranch::isLengthDefined_
protectedinherited

◆ length_

double bpp::PhyloBranch::length_
protectedinherited

◆ properties_


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