CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
reports.cpp File Reference
#include "../config.h"
#include <stdexcept>
#include <ostream>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <iterator>
#include <algorithm>
#include <strings.h>
#include "reports.h"
#include "likelihood_ratio.h"
#include "pvalue.h"
#include "branch_cutting.h"
#include "viterbi.h"
#include "Globals.h"
#include "cafe.h"

Functions

void cafe_shell_set_lambda (pCafeParam param, double *lambda)
 
size_t file_read_line (pString pstr, FILE *fp)
 
void cafe_report_load_bc_or_lhr_list (char *data, double **pvalues, int i, int nnodes)
 
void phylogeny_lambda_parse_func (pTree ptree, pTreeNode ptnode)
 
double * cafe_report_load_data_double_list (char *data, int delimiter, int *num)
 
double * cafe_report_load_data_double_pairs (char *data, int delimiter)
 
int * cafe_report_load_data_int_pairs (char *data, int delimiter)
 
template<typename T , typename U >
std::ostream & operator<< (ostream &ost, const std::pair< T, U > &pair)
 
template<typename T >
std::ostream & operator<< (ostream &ost, const std::vector< T > &v)
 Writes a vector of arbitrary objects to a stream, separated by commas. More...
 
template<typename T >
std::vector< pair< T, T > > to_pairs (const std::vector< T > &v)
 Converts a vector of objects to pairs of objects. More...
 
int expanded (change c)
 Accepts a change structure and returns its expand value. More...
 
int unchanged (change c)
 Accepts a change structure and returns its unchanged value. More...
 
int decreased (change c)
 Accepts a change structure and returns its decrease value. More...
 
template<typename func >
std::vector< int > get_change (const std::vector< change > &v, func f)
 
void lambda_tree_string (pString pstr, pPhylogenyNode pnode)
 
void cafe_report_set_viterbi (pCafeFamily family, pCafeTree pcafe, viterbi_parameters &viterbi, int i)
 
void cafe_tree_string_id (pString pstr, pPhylogenyNode pnode)
 
string quoted (string s)
 
void write_viterbi (ostream &ost, const Report &viterbi)
 
void write_families_header (ostream &ost, bool cutPvalues, bool likelihoodRatios)
 
void write_doubles (ostream &ost, vector< double > items)
 
std::ios_base & json (std::ios_base &os)
 These I/O manipulators allow selecting the report format. More...
 
std::ios_base & html (std::ios_base &os)
 
std::ostream & operator<< (std::ostream &ost, const family_line_item &item)
 
std::ostream & operator<< (std::ostream &ost, const tree_visualization &viz)
 
std::ostream & operator<< (ostream &ost, const Report &report)
 
report_parameters get_report_parameters (std::vector< std::string > tokens)
 
string extension (Report::Formats f)
 
void set_format (ostream &ost, Report::Formats f)
 
void cafe_do_report (Globals &globals, viterbi_parameters &viterbi, report_parameters *params)
 
void cafe_report_load_viterbi_pvalue (char *data, viterbi_parameters &v, pCafeFamilyItem item, pCafeTree ptree)
 
int cafe_report_retrieve_data (const char *file, pCafeParam param, viterbi_parameters &viterbi)
 
void update_depths (pTreeNode node, std::map< int, double > &depths, double curr_depth)
 
void calc_row (pTreeNode node, map< int, int > &positions)
 
map< int, int > get_row_positions (pTree tree)
 
map< int, int > get_col_positions (pTree tree, int drawing_width)
 
void draw_clade (pTreeNode node, vector< string > &char_matrix, int startcol, map< int, int > &col_positions, map< int, int > &row_positions)
 

Variables

pTree tmp_lambda_tree
 

Function Documentation

void cafe_do_report ( Globals globals,
viterbi_parameters viterbi,
report_parameters params 
)
void cafe_report_load_bc_or_lhr_list ( char *  data,
double **  pvalues,
int  i,
int  nnodes 
)
double* cafe_report_load_data_double_list ( char *  data,
int  delimiter,
int *  num 
)
double* cafe_report_load_data_double_pairs ( char *  data,
int  delimiter 
)
int* cafe_report_load_data_int_pairs ( char *  data,
int  delimiter 
)
void cafe_report_load_viterbi_pvalue ( char *  data,
viterbi_parameters v,
pCafeFamilyItem  item,
pCafeTree  ptree 
)
int cafe_report_retrieve_data ( const char *  file,
pCafeParam  param,
viterbi_parameters viterbi 
)
void cafe_report_set_viterbi ( pCafeFamily  family,
pCafeTree  pcafe,
viterbi_parameters viterbi,
int  i 
)
void cafe_shell_set_lambda ( pCafeParam  param,
double *  lambda 
)
void cafe_tree_string_id ( pString  pstr,
pPhylogenyNode  pnode 
)
void calc_row ( pTreeNode  node,
map< int, int > &  positions 
)
int decreased ( change  c)

Accepts a change structure and returns its decrease value.

void draw_clade ( pTreeNode  node,
vector< string > &  char_matrix,
int  startcol,
map< int, int > &  col_positions,
map< int, int > &  row_positions 
)
int expanded ( change  c)

Accepts a change structure and returns its expand value.

string extension ( Report::Formats  f)
size_t file_read_line ( pString  pstr,
FILE *  fp 
)
template<typename func >
std::vector<int> get_change ( const std::vector< change > &  v,
func  f 
)
map<int, int> get_col_positions ( pTree  tree,
int  drawing_width 
)
report_parameters get_report_parameters ( std::vector< std::string >  tokens)
map<int, int> get_row_positions ( pTree  tree)
std::ios_base& html ( std::ios_base &  os)
std::ios_base& json ( std::ios_base &  os)

These I/O manipulators allow selecting the report format.

void lambda_tree_string ( pString  pstr,
pPhylogenyNode  pnode 
)
template<typename T , typename U >
std::ostream& operator<< ( ostream &  ost,
const std::pair< T, U > &  pair 
)

Writes a pair of arbitrary objects to a stream, surrounded by brackets in JSON mode or parenthesis otherwise, and separated by a comma

template<typename T >
std::ostream& operator<< ( ostream &  ost,
const std::vector< T > &  v 
)

Writes a vector of arbitrary objects to a stream, separated by commas.

std::ostream& operator<< ( std::ostream &  ost,
const family_line_item item 
)
std::ostream& operator<< ( std::ostream &  ost,
const tree_visualization viz 
)
std::ostream& operator<< ( ostream &  ost,
const Report report 
)
void phylogeny_lambda_parse_func ( pTree  ptree,
pTreeNode  ptnode 
)
string quoted ( string  s)
void set_format ( ostream &  ost,
Report::Formats  f 
)
template<typename T >
std::vector<pair<T, T> > to_pairs ( const std::vector< T > &  v)

Converts a vector of objects to pairs of objects.

int unchanged ( change  c)

Accepts a change structure and returns its unchanged value.

void update_depths ( pTreeNode  node,
std::map< int, double > &  depths,
double  curr_depth 
)
void write_doubles ( ostream &  ost,
vector< double >  items 
)
void write_families_header ( ostream &  ost,
bool  cutPvalues,
bool  likelihoodRatios 
)
void write_viterbi ( ostream &  ost,
const Report viterbi 
)

Variable Documentation

pTree tmp_lambda_tree