CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
command_tests.cpp File Reference
#include <stdexcept>
#include <vector>
#include <string>
#include <sstream>
#include <map>
#include "CppUTest/TestHarness.h"
#include "CppUTest/CommandLineTestRunner.h"
#include "cafe_commands.h"
#include "reports.h"
#include "Globals.h"
#include "viterbi.h"
#include "gene_family.h"
#include "cafe.h"

Functions

 TEST_GROUP (CommandTests)
 
 TEST (CommandTests, command_list)
 
 TEST (CommandTests, Test_cafe_cmd_source_prereqs)
 
 TEST (CommandTests, cafe_cmd_generate_random_family)
 
 TEST (CommandTests, cafe_cmd_date)
 
 TEST (CommandTests, cafe_cmd_echo)
 
 TEST (CommandTests, cafe_cmd_exit)
 
 TEST (CommandTests, cafe_command_report_prereqs)
 
void assert_gainloss_exception (Globals &globals, std::string expected)
 
 TEST (CommandTests, cafe_cmd_gainloss_exceptions)
 
 TEST (CommandTests, cafe_cmd_log)
 
 TEST (CommandTests, get_load_arguments)
 
 TEST (CommandTests, get_load_arguments_filter_and_max_size)
 
 TEST (CommandTests, cafe_cmd_load)
 
 TEST (CommandTests, cafe_cmd_save)
 
 TEST (CommandTests, cafe_cmd_tree)
 
 TEST (CommandTests, cafe_cmd_tree_syncs_family_if_loaded)
 
 TEST (CommandTests, cafe_cmd_tree_missing_branch_length)
 
void prepare_viterbi (CafeParam &param)
 
 TEST (CommandTests, cafe_cmd_viterbi_id_not_existing)
 
 TEST (CommandTests, cafe_cmd_viterbi_family_out_of_range)
 
 TEST (CommandTests, cafe_cmd_viterbi_args)
 
 TEST (CommandTests, viterbi_write)
 
 TEST (CommandTests, get_pvalue_arguments)
 
 TEST (CommandTests, get_lhtest_arguments)
 
 TEST (CommandTests, cafe_cmd_lhtest)
 
 TEST (CommandTests, cafe_cmd_esterror)
 
 TEST (CommandTests, validate_esterror)
 
 TEST (CommandTests, cafe_cmd_seed)
 

Variables

struct chooseln_cache cache
 A cache of values of chooseln. More...
 
pBirthDeathCacheArray probability_cache
 

Function Documentation

void assert_gainloss_exception ( Globals globals,
std::string  expected 
)
void prepare_viterbi ( CafeParam param)
TEST ( CommandTests  ,
command_list   
)
TEST ( CommandTests  ,
Test_cafe_cmd_source_prereqs   
)
TEST ( CommandTests  ,
cafe_cmd_generate_random_family   
)
TEST ( CommandTests  ,
cafe_cmd_date   
)
TEST ( CommandTests  ,
cafe_cmd_echo   
)
TEST ( CommandTests  ,
cafe_cmd_exit   
)
TEST ( CommandTests  ,
cafe_command_report_prereqs   
)
TEST ( CommandTests  ,
cafe_cmd_gainloss_exceptions   
)
TEST ( CommandTests  ,
cafe_cmd_log   
)
TEST ( CommandTests  ,
get_load_arguments   
)
TEST ( CommandTests  ,
get_load_arguments_filter_and_max_size   
)
TEST ( CommandTests  ,
cafe_cmd_load   
)
TEST ( CommandTests  ,
cafe_cmd_save   
)
TEST ( CommandTests  ,
cafe_cmd_tree   
)
TEST ( CommandTests  ,
cafe_cmd_tree_syncs_family_if_loaded   
)
TEST ( CommandTests  ,
cafe_cmd_tree_missing_branch_length   
)
TEST ( CommandTests  ,
cafe_cmd_viterbi_id_not_existing   
)
TEST ( CommandTests  ,
cafe_cmd_viterbi_family_out_of_range   
)
TEST ( CommandTests  ,
cafe_cmd_viterbi_args   
)
TEST ( CommandTests  ,
viterbi_write   
)
TEST ( CommandTests  ,
get_pvalue_arguments   
)
TEST ( CommandTests  ,
get_lhtest_arguments   
)
TEST ( CommandTests  ,
cafe_cmd_lhtest   
)
TEST ( CommandTests  ,
cafe_cmd_esterror   
)
TEST ( CommandTests  ,
validate_esterror   
)
TEST ( CommandTests  ,
cafe_cmd_seed   
)
TEST_GROUP ( CommandTests  )

Variable Documentation

struct chooseln_cache cache

A cache of values of chooseln.

Chooseln evaluates the natural logarithm of Gamma(n+1)/(Gamma(k+1)*Gamma(n-k+1)) The cache holds values for integer values of n and k. It does not appear to be threadsafe.

P(X(t) = c | X(0) = s) = {j=0}^{(s,c)} {s}{j}{s+c-j-1}{s-1} ^{s+c-2j}(1-2)^j

pBirthDeathCacheArray probability_cache

The variable cafe_param is a global singleton that holds general program state. cafe_param holds pcafe, a CafeTree, and pfamily, a CafeFamily . These are set by the user via the commands "tree" and "load" respectively. When the user calls the command "lambda" calculations are performed on the pcafe and pfamily variables.