CAFE
Computational Analysis of gene Family Evolution
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lambda.cpp File Reference
#include <family.h>
#include "cafe_shell.h"
#include "cafe.h"
#include <mathfunc.h>
#include <exception>
#include <string>
#include <stdexcept>
#include <vector>
#include <sstream>
#include <iterator>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <cmath>
#include "lambda.h"
#include "cafe_commands.h"
#include "Globals.h"
#include "log_buffer.h"
#include "gene_family.h"

Functions

void cafe_shell_set_lambda (pCafeParam param, double *parameters)
 
int __cafe_cmd_lambda_tree (pCafeParam param, char *arg1, char *arg2)
 
double __cafe_best_lambda_search (double *plambda, void *args)
 
double __cafe_cluster_lambda_search (double *parameters, void *args)
 
bool is_out (Argument arg)
 
void set_all_lambdas (pCafeParam param, double value)
 
pGMatrix cafe_lambda_distribution (pCafeParam param, const vector< lambda_range > &range)
 
void write_lambda_distribution (pCafeParam param, const std::vector< lambda_range > &range, FILE *fp)
 
void initialize_params_and_k_weights (pCafeParam param, int what)
 
void set_parameters (pCafeParam param, lambda_args &params)
 
void lambda_set (pCafeParam param, lambda_args &params)
 
void lambda_search (pCafeParam param, lambda_args &params)
 
int cafe_cmd_lambda (Globals &globals, vector< string > tokens)
 Find lambda values. More...
 
double * cafe_best_lambda_by_fminsearch (pCafeParam param, int lambda_len, int k)
 
posterior compute_posterior (pCafeFamilyItem pitem, pCafeTree pcafe, const std::vector< double > &prior_rfsize)
 
double get_posterior (pCafeFamily pfamily, pCafeTree pcafe, family_size_range *range, std::vector< double > &ML, std::vector< double > &MAP, std::vector< double > &prior_rfsize, int quiet)
 
double __lnLPoisson (double *plambda, void *data)
 
std::vector< int > collect_leaf_sizes (pCafeFamily pfamily)
 
poisson_lambda find_poisson_lambda (pCafeFamily pfamily)
 
void cafe_set_prior_rfsize_poisson_lambda (std::vector< double > &prior_rfsize, int shift, double *lambda)
 
double cafe_set_prior_rfsize_empirical (pCafeParam param, std::vector< double > &prior_rfsize)
 set empirical prior on rootsize based on the assumption that rootsize follows leaf size distribution More...
 

Variables

pCafeParam cafe_param
 Holds the global program state that user commands act on. More...
 

Function Documentation

double __cafe_best_lambda_search ( double *  plambda,
void *  args 
)
double __cafe_cluster_lambda_search ( double *  parameters,
void *  args 
)
int __cafe_cmd_lambda_tree ( pCafeParam  param,
char *  arg1,
char *  arg2 
)
double __lnLPoisson ( double *  plambda,
void *  data 
)
double* cafe_best_lambda_by_fminsearch ( pCafeParam  param,
int  lambda_len,
int  k 
)
int cafe_cmd_lambda ( Globals globals,
vector< string >  tokens 
)

Find lambda values.

Arguments include -s and -t. The -s argument starts a search for lambda values maximizing the log likelihood of data for all values. Subsequent analayses will automatically use the results from the lambda search. -t takes the same Newick tree structure as in the tree command, excluding branch lengths and subsituting integer values from 1 to N taxon names. etc.

pGMatrix cafe_lambda_distribution ( pCafeParam  param,
const vector< lambda_range > &  range 
)
double cafe_set_prior_rfsize_empirical ( pCafeParam  param,
std::vector< double > &  prior_rfsize 
)

set empirical prior on rootsize based on the assumption that rootsize follows leaf size distribution

void cafe_set_prior_rfsize_poisson_lambda ( std::vector< double > &  prior_rfsize,
int  shift,
double *  lambda 
)
void cafe_shell_set_lambda ( pCafeParam  param,
double *  parameters 
)
std::vector<int> collect_leaf_sizes ( pCafeFamily  pfamily)
posterior compute_posterior ( pCafeFamilyItem  pitem,
pCafeTree  pcafe,
const std::vector< double > &  prior_rfsize 
)
poisson_lambda find_poisson_lambda ( pCafeFamily  pfamily)
double get_posterior ( pCafeFamily  pfamily,
pCafeTree  pcafe,
family_size_range range,
std::vector< double > &  ML,
std::vector< double > &  MAP,
std::vector< double > &  prior_rfsize,
int  quiet 
)
void initialize_params_and_k_weights ( pCafeParam  param,
int  what 
)
bool is_out ( Argument  arg)
void lambda_search ( pCafeParam  param,
lambda_args params 
)
void lambda_set ( pCafeParam  param,
lambda_args params 
)
void set_all_lambdas ( pCafeParam  param,
double  value 
)
void set_parameters ( pCafeParam  param,
lambda_args params 
)
void write_lambda_distribution ( pCafeParam  param,
const std::vector< lambda_range > &  range,
FILE *  fp 
)

Variable Documentation

pCafeParam cafe_param

Holds the global program state that user commands act on.