CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
cafe_commands.h File Reference
#include <vector>
#include <string>
#include <map>
#include <iosfwd>
#include <stdexcept>
#include "family.h"
#include "cafe_shell.h"

Go to the source code of this file.

Data Structures

struct  Argument
 
struct  load_args
 
struct  viterbi_args
 
struct  pvalue_args
 
struct  lhtest_args
 
struct  esterror_args
 
struct  roots
 
class  io_error
 

Macros

#define MAKE_FN_NAME(x)   int cafe_cmd_##x (Globals& globals, std::vector<std::string>)
 
#define COMMAND(signal)   MAKE_FN_NAME(signal)
 

Typedefs

typedef ArgumentpArgument
 
typedef int(* cafe_command2 )(Globals &globals, std::vector< std::string >)
 

Functions

 COMMAND (accuracy)
 
 COMMAND (branchlength)
 
 COMMAND (cvfamily)
 
 COMMAND (cvspecies)
 
 COMMAND (date)
 
 COMMAND (echo)
 
 COMMAND (errormodel)
 
 COMMAND (esterror)
 
 COMMAND (exit)
 
 COMMAND (extinct)
 
 COMMAND (family)
 
 COMMAND (gainloss)
 
 COMMAND (generate_random_family)
 
 COMMAND (lambdamu)
 
 COMMAND (lhtest)
 
 COMMAND (list)
 
 COMMAND (load)
 
 COMMAND (log)
 
 COMMAND (noerrormodel)
 
 COMMAND (print_param)
 
 COMMAND (pvalue)
 
 COMMAND (retrieve)
 
 COMMAND (rootdist)
 
 COMMAND (save)
 
 COMMAND (score)
 
 COMMAND (seed)
 
 COMMAND (simerror)
 
 COMMAND (simextinct)
 
 COMMAND (source)
 
 COMMAND (tree)
 
 COMMAND (version)
 
 COMMAND (viterbi)
 
std::map< std::string,
cafe_command2
get_dispatcher ()
 Holds the list of commands that are available in Cafe. More...
 
int cafe_shell_dispatch_command (Globals &globals, char *cmd)
 
void list_commands (std::ostream &ost)
 
std::vector< Argumentbuild_argument_list (std::vector< std::string > tokens)
 
void clear_tree_viterbis (pCafeTree psum)
 
int get_num_trials (std::vector< std::string > args)
 
int write_family_gainloss (std::ostream &ofst, std::string family_id, pCafeTree tree1, pCafeTree tree2)
 
std::vector< int > get_clusters (int parameterized_k_value, int num_families, double *k_weights)
 
void write_node_headers (std::ostream &s1, std::ostream &s2, pCafeTree pcafe)
 
void write_leaves (std::ostream &ofst, pCafeTree pcafe, int *k, int i, int id, bool evens)
 
void write_version (std::ostream &ost)
 
void write_family (std::ostream &ost, pCafeFamily family)
 
void viterbi_write (std::ostream &ost, pCafeTree pcafe, pCafeFamily pfamily)
 
void tree_set_branch_lengths (pCafeTree pcafe, std::vector< int > lengths)
 
load_args get_load_arguments (std::vector< Argument > pargs)
 
viterbi_args get_viterbi_arguments (std::vector< Argument > pargs)
 
pvalue_args get_pvalue_arguments (std::vector< Argument > pargs)
 
lhtest_args get_lhtest_arguments (std::vector< Argument > pargs)
 
esterror_args get_esterror_arguments (std::vector< Argument > pargs)
 
void validate (esterror_args args)
 
void run_viterbi_sim (pCafeTree pcafe, pCafeFamily pfamily, roots &roots)
 
int init_histograms (int rfsize, roots &roots, int nsamples)
 
void get_doubles_array (std::vector< double > &loc, pArgument parg)
 
void log_param_values (std::ostream &ost, Globals &globals)
 
void prereqs (pCafeParam param, int flags)
 

Variables

const int REQUIRES_FAMILY = 0x01
 
const int REQUIRES_TREE = 0x02
 
const int REQUIRES_LAMBDA = 0x04
 
const int REQUIRES_ERRORMODEL = 0x08
 

Macro Definition Documentation

#define COMMAND (   signal)    MAKE_FN_NAME(signal)
#define MAKE_FN_NAME (   x)    int cafe_cmd_##x (Globals& globals, std::vector<std::string>)

Typedef Documentation

typedef int(* cafe_command2)(Globals &globals, std::vector< std::string >)
typedef Argument* pArgument

Function Documentation

std::vector<Argument> build_argument_list ( std::vector< std::string >  tokens)
int cafe_shell_dispatch_command ( Globals globals,
char *  cmd 
)
void clear_tree_viterbis ( pCafeTree  psum)
COMMAND ( accuracy  )
COMMAND ( branchlength  )
COMMAND ( cvfamily  )
COMMAND ( cvspecies  )
COMMAND ( date  )
COMMAND ( echo  )
COMMAND ( errormodel  )
COMMAND ( esterror  )
COMMAND ( exit  )
COMMAND ( extinct  )
COMMAND ( family  )
COMMAND ( gainloss  )
COMMAND ( generate_random_family  )
COMMAND ( lambdamu  )
COMMAND ( lhtest  )
COMMAND ( list  )
COMMAND ( load  )
COMMAND ( log  )
COMMAND ( noerrormodel  )
COMMAND ( print_param  )
COMMAND ( pvalue  )
COMMAND ( retrieve  )
COMMAND ( rootdist  )
COMMAND ( save  )
COMMAND ( score  )
COMMAND ( seed  )
COMMAND ( simerror  )
COMMAND ( simextinct  )
COMMAND ( source  )
COMMAND ( tree  )
COMMAND ( version  )
COMMAND ( viterbi  )
std::vector<int> get_clusters ( int  parameterized_k_value,
int  num_families,
double *  k_weights 
)
std::map<std::string, cafe_command2> get_dispatcher ( )

Holds the list of commands that are available in Cafe.

Each element consists of a command and the function that is called to handle that command. Functions include cafe_cmd_lambda, #cafe_cmd_family, cafe_cmd_tree, etc.

void get_doubles_array ( std::vector< double > &  loc,
pArgument  parg 
)
esterror_args get_esterror_arguments ( std::vector< Argument pargs)
lhtest_args get_lhtest_arguments ( std::vector< Argument pargs)
load_args get_load_arguments ( std::vector< Argument pargs)
int get_num_trials ( std::vector< std::string >  args)
pvalue_args get_pvalue_arguments ( std::vector< Argument pargs)
viterbi_args get_viterbi_arguments ( std::vector< Argument pargs)
int init_histograms ( int  rfsize,
roots roots,
int  nsamples 
)
void list_commands ( std::ostream &  ost)
void log_param_values ( std::ostream &  ost,
Globals globals 
)
void prereqs ( pCafeParam  param,
int  flags 
)
void run_viterbi_sim ( pCafeTree  pcafe,
pCafeFamily  pfamily,
roots roots 
)
void tree_set_branch_lengths ( pCafeTree  pcafe,
std::vector< int >  lengths 
)
void validate ( esterror_args  args)
void viterbi_write ( std::ostream &  ost,
pCafeTree  pcafe,
pCafeFamily  pfamily 
)
void write_family ( std::ostream &  ost,
pCafeFamily  family 
)
int write_family_gainloss ( std::ostream &  ofst,
std::string  family_id,
pCafeTree  tree1,
pCafeTree  tree2 
)
void write_leaves ( std::ostream &  ofst,
pCafeTree  pcafe,
int *  k,
int  i,
int  id,
bool  evens 
)
void write_node_headers ( std::ostream &  s1,
std::ostream &  s2,
pCafeTree  pcafe 
)
void write_version ( std::ostream &  ost)

Variable Documentation

const int REQUIRES_ERRORMODEL = 0x08
const int REQUIRES_FAMILY = 0x01
const int REQUIRES_LAMBDA = 0x04
const int REQUIRES_TREE = 0x02