#include <tools.h>
|
| ParamsBuilder () |
| Default constructor - Initializing a builder using the default values.
|
|
ParamsBuilder & | withRandomSeed (const uint64_t &seed) |
| Specify a seed number for random generators. Default: the clock of the PC. Be careful! To make the results reproducible, users should specify the seed number.
|
|
ParamsBuilder & | withThreshProb (const double &thresh_prob) |
| Specify a relative probability threshold, which is used to ignore possible states with very low probabilities. Default: 1e-8.
|
|
ParamsBuilder & | withMinBlengthFactor (const double &min_blength_factor) |
| Specify a factor to compute the minimum branch length (if fixed_min_blength is specified, this factor is ignored). Default: 0.2
<Minimum branch length> = <min_blength_factor> * <default branch length>
where <default branch length> is one mutation per site.
|
|
ParamsBuilder & | withMaxBlengthFactor (const double &max_blength_factor) |
| Specify a factor to compute the maximum branch length. Default: 40
<Maximum branch length> = <max_blength_factor> * <default branch length>
where <default branch length> is one mutation per site.
|
|
ParamsBuilder & | withFixedMinBlength (const double &fixed_min_blength) |
| Specify a minimum value of the branch lengths. Default: the minimum branch length is computed from 'min_blength_factor'.
|
|
ParamsBuilder & | withMutationUpdatePeriod (const int32_t &mutation_update_period) |
| Specify the period (in term of the number of sample placements) to update the substitution rate matrix. Default: 25.
|
|
ParamsBuilder & | withNumTreeTraversal (const int32_t &num_tree_traversal) |
| Specify the number of times we traverse the tree looking for topological improvements (applying SPR moves). Default: 1.
|
|
ParamsBuilder & | withSPRThresh (const double &SPR_thresh) |
| Specify a threshold that avoids CMAPLE trying to apply SPR moves on nodes that have the placement cost (i.e. the likelihood contribution by placing a node on the tree) exceeds this threshold. Default: -1e-5.
|
|
ParamsBuilder & | withStopTreeSearchThresh (const double &stop_search_thresh) |
| Specify a threshold to stop the tree search. If the total log likelihood improvement obtained by an iteration of tree search is lower than this threshold, CMAPLE stops doing tree search . Default: 1.
|
|
std::unique_ptr< cmaple::Params > | build () |
| Build the Params object after initializing parameters.
|
|
A PatternBuilder to build an instance of Params which stores all program parameters.
One can build an instance of Params and specify several parameters by: ParamsBuilder().withRandomSeed().withFixedMinBlength().with<...>().build();
◆ withRandomSeed()
ParamsBuilder & cmaple::ParamsBuilder::withRandomSeed |
( |
const uint64_t & |
seed | ) |
|
Specify a seed number for random generators. Default: the clock of the PC. Be careful! To make the results reproducible, users should specify the seed number.
- Parameters
-
[in] | seed | A non-negative number |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if seed is negative |
◆ withThreshProb()
ParamsBuilder & cmaple::ParamsBuilder::withThreshProb |
( |
const double & |
thresh_prob | ) |
|
Specify a relative probability threshold, which is used to ignore possible states with very low probabilities. Default: 1e-8.
- Parameters
-
[in] | thresh_prob | A positive relative probability threshold |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if thresh_prob is non-positive |
◆ withMinBlengthFactor()
ParamsBuilder & cmaple::ParamsBuilder::withMinBlengthFactor |
( |
const double & |
min_blength_factor | ) |
|
Specify a factor to compute the minimum branch length (if fixed_min_blength is specified, this factor is ignored). Default: 0.2
<Minimum branch length> = <min_blength_factor> * <default branch length>
where <default branch length> is one mutation per site.
- Parameters
-
[in] | min_blength_factor | A positive factor to compute the minimum branch length |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if min_blength_factor is non-positive |
◆ withMaxBlengthFactor()
ParamsBuilder & cmaple::ParamsBuilder::withMaxBlengthFactor |
( |
const double & |
max_blength_factor | ) |
|
Specify a factor to compute the maximum branch length. Default: 40
<Maximum branch length> = <max_blength_factor> * <default branch length>
where <default branch length> is one mutation per site.
- Parameters
-
[in] | max_blength_factor | A positive factor to compute the maximum branch length |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if max_blength_factor is non-positive |
◆ withFixedMinBlength()
ParamsBuilder & cmaple::ParamsBuilder::withFixedMinBlength |
( |
const double & |
fixed_min_blength | ) |
|
Specify a minimum value of the branch lengths. Default: the minimum branch length is computed from 'min_blength_factor'.
- Parameters
-
[in] | fixed_min_blength | A positive value for the minimum branch lengths |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if fixed_min_blength is non-positive |
◆ withMutationUpdatePeriod()
ParamsBuilder & cmaple::ParamsBuilder::withMutationUpdatePeriod |
( |
const int32_t & |
mutation_update_period | ) |
|
Specify the period (in term of the number of sample placements) to update the substitution rate matrix. Default: 25.
- Parameters
-
[in] | mutation_update_period | A positive value for the period (in term of the number of sample placements) |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if mutation_update_period is non-positive |
◆ withNumTreeTraversal()
ParamsBuilder & cmaple::ParamsBuilder::withNumTreeTraversal |
( |
const int32_t & |
num_tree_traversal | ) |
|
Specify the number of times we traverse the tree looking for topological improvements (applying SPR moves). Default: 1.
- Parameters
-
[in] | num_tree_traversal | A positive number of tree traversals |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if num_tree_traversal is non-positive |
◆ withSPRThresh()
ParamsBuilder & cmaple::ParamsBuilder::withSPRThresh |
( |
const double & |
SPR_thresh | ) |
|
Specify a threshold that avoids CMAPLE trying to apply SPR moves on nodes that have the placement cost (i.e. the likelihood contribution by placing a node on the tree) exceeds this threshold. Default: -1e-5.
- Parameters
-
[in] | SPR_thresh | A positive threshold to consider applying SPR moves at nodes |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if SPR_thresh is non-positive |
◆ withStopTreeSearchThresh()
ParamsBuilder & cmaple::ParamsBuilder::withStopTreeSearchThresh |
( |
const double & |
stop_search_thresh | ) |
|
Specify a threshold to stop the tree search. If the total log likelihood improvement obtained by an iteration of tree search is lower than this threshold, CMAPLE stops doing tree search . Default: 1.
- Parameters
-
[in] | stop_search_thresh | A positive value for the threshold to stop the tree search |
- Returns
- A reference to the ParamsBuilder instance
- Exceptions
-
std::invalid_argument | if stop_search_thresh is non-positive |
◆ build()
std::unique_ptr< cmaple::Params > cmaple::ParamsBuilder::build |
( |
| ) |
|
Build the Params object after initializing parameters.
- Returns
- a unique pointer to an instance of Params
The documentation for this class was generated from the following file: