eXpress “1.5”

TargetTable Class Reference

The TargetTable class is used to keep track of the Target objects for a run. More...

#include <targets.h>

List of all members.

Public Member Functions

 TargetTable (std::string targ_fasta_file, std::string haplotype_file, bool prob_seqs, bool known_aux_params, double alpha, const AlphaMap *alpha_map, const Librarian *libs)
 TargetTable Constructor.
 ~TargetTable ()
 TargetTable Destructor.
Targetget_targ (TargID id)
 A member function that returns a pointer to the target with the given id.
void round_reset ()
 A member function that readies all Target objects in the table for the next round of batch EM.
size_t size () const
 An accessor for the number of targets in the table.
double total_fpb () const
 An accessor for the (logged) total mass per base, including pseudo-counts.
void update_total_fpb (double incr_amt)
 a member function that increments the (logged) total mass per base.
void update_covar (TargID targ1, TargID targ2, double covar)
 A member function that increases the (logged) covariance between two targets by the specified amount.
double get_covar (TargID targ1, TargID targ2)
 An accessor for the covariance between two targets.
size_t covar_size () const
 An accessor for number of pairs of targets with non-zero covariance.
Bundlemerge_bundles (Bundle *b1, Bundle *b2)
 A member function that merges the given Bundles.
size_t num_bundles () const
 An accessor for the number of bundles in the partition.
void masses_to_counts ()
 Renormalized masses to be counts and projects when necessary.
void output_results (std::string output_dir, size_t tot_counts, bool output_varcov=false, bool output_rdds=false)
 A member function that outputs the final expression data in a file called 'results.xprs', (optionally) the variance-covariance matrix in 'varcov.xprs', and (optionally) the RDD p-values in the given output directory.
void asynch_bias_update (boost::mutex *mutex)
 A member function to be run asynchronously that continuously updates the background bias values, target bias values, and target effective lengths.
void enable_bundle_threadsafety ()
void disable_bundle_threadsafety ()
void collapse_bundles ()
 Collapses the merge trees in the BundleTable.

Detailed Description

The TargetTable class is used to keep track of the Target objects for a run.

The constructor parses a fasta file to generate the Target objects and stores them in a map keyed by their string id.

Author:
Adam Roberts
Date:
2011 Artistic License 2.0

Definition at line 520 of file targets.h.


Constructor & Destructor Documentation

TargetTable::TargetTable ( std::string  targ_fasta_file,
std::string  haplotype_file,
bool  prob_seqs,
bool  known_aux_params,
double  alpha,
const AlphaMap *  alpha_map,
const Librarian libs 
)

TargetTable Constructor.

Parameters:
targ_fasta_filea string storing the path to the fasta file from which to load targets.
haplotype_filea string storing the path to the haplotype file containing comma-separated target pairs to be considered alternative haplotypes (optional).
prob_seqsa bool that specifies if the sequence is to be treated probablistically, for RDD detection.
known_aux_paramsa bool that is true iff the auxiliary parameters (fld, bias) are provided and need not be learned.
alphaa double that specifies the intial pseudo-counts for each bp of the targets (non-logged).
alpha_mapan optional pointer to a map object that specifies proportional weights of pseudo-counts for each target.
libsa pointer to the struct containing pointers to the global parameter tables (bias_table, mismatch_table, fld).

Definition at line 292 of file targets.cpp.

TargetTable::~TargetTable ( )

TargetTable Destructor.

Deletes all of the target objects in the table.

Definition at line 424 of file targets.cpp.


Member Function Documentation

void TargetTable::asynch_bias_update ( boost::mutex *  mutex)

A member function to be run asynchronously that continuously updates the background bias values, target bias values, and target effective lengths.

Parameters:
mutexa pointer to the mutex to be used to protect the global fld and bias tables during updates.

Definition at line 843 of file targets.cpp.

size_t TargetTable::covar_size ( ) const [inline]

An accessor for number of pairs of targets with non-zero covariance.

Returns:
The number of target pairs with non-zero covariance.

Definition at line 652 of file targets.h.

double TargetTable::get_covar ( TargID  targ1,
TargID  targ2 
) [inline]

An accessor for the covariance between two targets.

These returned value will be the log of the negative of the true value.

Parameters:
targ1one of the targets in the pair.
targ2the other target in the pair.
Returns:
The negative of the pair's covariance (logged).

Definition at line 645 of file targets.h.

Target * TargetTable::get_targ ( TargID  id)

A member function that returns a pointer to the target with the given id.

Parameters:
idof the target queried.
Returns:
A pointer to the target with the given id.

Definition at line 462 of file targets.cpp.

Bundle * TargetTable::merge_bundles ( Bundle b1,
Bundle b2 
)

A member function that merges the given Bundles.

Parameters:
b1a pointer to the first Bundle to merge.
b2a pointer to the second Bundle to merge.
Returns:
A pointer to the merged Bundle.

Definition at line 466 of file targets.cpp.

size_t TargetTable::num_bundles ( ) const [inline]

An accessor for the number of bundles in the partition.

Returns:
The number of bundles in the partition.

Definition at line 664 of file targets.h.

void TargetTable::output_results ( std::string  output_dir,
size_t  tot_counts,
bool  output_varcov = false,
bool  output_rdds = false 
)

A member function that outputs the final expression data in a file called 'results.xprs', (optionally) the variance-covariance matrix in 'varcov.xprs', and (optionally) the RDD p-values in the given output directory.

Parameters:
output_dirthe directory to output the expression file to.
tot_countsthe total number of observed mapped fragments.
output_varcovboolean specifying whether to also output the variance-covariance matrix
output_rddsboolean specifying whether to also output the RDD p-values.

Definition at line 588 of file targets.cpp.

size_t TargetTable::size ( ) const [inline]

An accessor for the number of targets in the table.

Returns:
The number of targets in the table.

Definition at line 614 of file targets.h.

double TargetTable::total_fpb ( ) const

An accessor for the (logged) total mass per base, including pseudo-counts.

Returns:
The (logged) total mass per base, including pseudo-counts.

Definition at line 833 of file targets.cpp.

void TargetTable::update_covar ( TargID  targ1,
TargID  targ2,
double  covar 
) [inline]

A member function that increases the (logged) covariance between two targets by the specified amount.

These values are stored positive even though they are negative.

Parameters:
targ1one of the targets in the pair
targ2the other target in the pair
covara double specifying the amount to increase the pair's covariance by (logged)

Definition at line 635 of file targets.h.

void TargetTable::update_total_fpb ( double  incr_amt)

a member function that increments the (logged) total mass per base.

Parameters:
incr_amtthe (logged) amount to increment by.

Definition at line 838 of file targets.cpp.


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