eXpress “1.5”

BiasBoss Class Reference

The BiasBoss class keeps track of sequence-specific and positional bias. More...

#include <biascorrection.h>

List of all members.

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.

Detailed Description

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.

Author:
Adam Roberts
Date:
2011 Artistic License 2.0

Definition at line 138 of file biascorrection.h.


Constructor & Destructor Documentation

BiasBoss::BiasBoss ( size_t  order,
double  alpha 
)

BiasBoss Constructor.

Parameters:
ordera size_t specifying the order of the Markov chains used to model the sequences.
alphaa 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.

Parameters:
ordera size_t specifying the order to use for the Markov chains modelling the sequence. Must match file.
param_file_namea string specifying the path to the parameter file.

Member Function Documentation

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.

Parameters:
outfilethe file to append to.
void BiasBoss::copy_expectations ( const BiasBoss other)

A member function that copies the expected parameters from another BiasBoss.

Parameters:
othera 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.

Parameters:
othera 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.

Parameters:
start_biasa vector containing the logged bias for each 5' start site in the target.
end_biasa vector containing the logged bias for each 3' end site in the target.
targthe target for which to calculate the bias.
Returns:
The product of the average 5' and 3' bias (logged).

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.

Returns:
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.

Parameters:
targthe 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.

Parameters:
hitthe fragment hit (alignment).
massthe logged probabality of the mapping, which is the amount to increment the observed counts by.

Definition at line 228 of file biascorrection.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables