eXpress “1.5”
|
The BiasBoss class keeps track of sequence-specific and positional bias. More...
#include <biascorrection.h>
Public Member Functions | |
BiasBoss (size_t order, double alpha) | |
BiasBoss Constructor. | |
BiasBoss (size_t order, std::string param_file_name) | |
A second constructor that loads the distributions from a parameter file. | |
size_t | order () const |
An accessor for the order of the Markov chains used to model the sequences. | |
void | copy_observations (const BiasBoss &other) |
A member function that copies the observed parameters from another BiasBoss. | |
void | copy_expectations (const BiasBoss &other) |
A member function that copies the expected parameters from another BiasBoss. | |
void | update_expectations (const Target &targ, double mass=0, const std::vector< double > &fl_cdf=std::vector< double >()) |
A member function that updates the expectation parameters assuming uniform abundance of and coverage accross the target's sequence. | |
void | normalize_expectations () |
A member function that normalizes the expected counts and fills in the lower-ordered marginals. | |
void | update_observed (const FragHit &hit, double mass) |
A member function that updates the observed parameters given a fragment mapping to a target and its logged probabilistic assignment value. | |
double | get_target_bias (std::vector< float > &start_bias, std::vector< float > &end_bias, const Target &targ) const |
A member function that returns the 5' and 3' bias values at each position in a given target based on the current bias parameters. | |
void | append_output (std::ofstream &outfile) const |
A member function that appends the 5' and 3' bias parameters to the given file, formatted in tables for easy readability. |
The BiasBoss class keeps track of sequence-specific and positional bias.
It allows for the bias associated with a given fragment end to be calculated, and
for the bias parameters to be updated based on additional observations. All stored and returned values are in log space.
Definition at line 138 of file biascorrection.h.
BiasBoss::BiasBoss | ( | size_t | order, |
double | alpha | ||
) |
BiasBoss Constructor.
order | a size_t specifying the order of the Markov chains used to model the sequences. |
alpha | a double specifying the strength of the uniform prior (logged pseudo-counts for each parameter). |
Definition at line 185 of file biascorrection.cpp.
BiasBoss::BiasBoss | ( | size_t | order, |
std::string | param_file_name | ||
) |
A second constructor that loads the distributions from a parameter file.
Note that the values should not be modified after using this constructor.
order | a size_t specifying the order to use for the Markov chains modelling the sequence. Must match file. |
param_file_name | a string specifying the path to the parameter file. |
void BiasBoss::append_output | ( | std::ofstream & | outfile | ) | const |
A member function that appends the 5' and 3' bias parameters to the given file, formatted in tables for easy readability.
outfile | the file to append to. |
void BiasBoss::copy_expectations | ( | const BiasBoss & | other | ) |
A member function that copies the expected parameters from another BiasBoss.
other | a BiasBoss to copy the parameters from. |
Definition at line 202 of file biascorrection.cpp.
void BiasBoss::copy_observations | ( | const BiasBoss & | other | ) |
A member function that copies the observed parameters from another BiasBoss.
other | a BiasBoss to copy the parameters from. |
Definition at line 197 of file biascorrection.cpp.
double BiasBoss::get_target_bias | ( | std::vector< float > & | start_bias, |
std::vector< float > & | end_bias, | ||
const Target & | targ | ||
) | const |
A member function that returns the 5' and 3' bias values at each position in a given target based on the current bias parameters.
start_bias | a vector containing the logged bias for each 5' start site in the target. |
end_bias | a vector containing the logged bias for each 3' end site in the target. |
targ | the target for which to calculate the bias. |
Definition at line 244 of file biascorrection.cpp.
size_t BiasBoss::order | ( | ) | const [inline] |
An accessor for the order of the Markov chains used to model the sequences.
Definition at line 177 of file biascorrection.h.
void BiasBoss::update_expectations | ( | const Target & | targ, |
double | mass = 0 , |
||
const std::vector< double > & | fl_cdf = std::vector<double>() |
||
) |
A member function that updates the expectation parameters assuming uniform abundance of and coverage accross the target's sequence.
targ | the target to measure expected counts from |
Definition at line 207 of file biascorrection.cpp.
void BiasBoss::update_observed | ( | const FragHit & | hit, |
double | mass | ||
) |
A member function that updates the observed parameters given a fragment mapping to a target and its logged probabilistic assignment value.
hit | the fragment hit (alignment). |
mass | the logged probabality of the mapping, which is the amount to increment the observed counts by. |
Definition at line 228 of file biascorrection.cpp.