ARB
Macros | Functions | Variables
arb_dnarates.cxx File Reference
#include "DNAml_rates_1_0.h"
#include <aw_awar_defs.hxx>
#include <unistd.h>
#include <cmath>
Include dependency graph for arb_dnarates.cxx:

Go to the source code of this file.

Macros

#define programName   "DNAml_rates"
 
#define programVersion   "1.0.0"
 
#define programDate   "April 11, 1992"
 
#define assert(bed)   arb_assert(bed)
 

Functions

static void getnums (FILE *INFILE)
 
int min (int i, int j)
 
bool digit (int ch)
 
bool white (int ch)
 
static void uppercase (int *chptr)
 
static int base36 (int ch)
 
static int itobase36 (int i)
 
static int findch (int c, FILE *INFILE)
 
static void inputweights (FILE *INFILE)
 
static void getoptions (FILE *INFILE)
 
static void getbasefreqs (FILE *INFILE)
 
static void getyspace ()
 
static void setuptree (tree *tr, const int numSp)
 
static void freeTreeNode (nodeptr p)
 
static void freeTree (tree *tr)
 
static void getdata (tree *tr, FILE *INFILE)
 
static void sitesort ()
 
static void sitecombcrunch ()
 
static void makeweights ()
 
static void makevalues (tree *tr)
 
static void empiricalfreqs (tree *tr)
 
static void getinput (tree *tr, FILE *INFILE)
 
static xarraysetupxarray ()
 
static void linkxarray (int req, int min, xarray **freexptr, xarray **usedxptr)
 
static void setupnodex (tree *tr)
 
static xarraygetxtip (nodeptr p)
 
static xarraygetxnode (nodeptr p)
 
static void newview (nodeptr p)
 
static void hookup (nodeptr p, nodeptr q, double z)
 
static void initrav (nodeptr p)
 
static int treeFinishCom (FILE *INFILE)
 
static int treeGetCh (FILE *INFILE)
 
static void treeFlushLabel (FILE *INFILE)
 
static int findTipName (tree *tr, int ch, FILE *INFILE)
 
static double processLength (FILE *INFILE)
 
static void treeFlushLen (FILE *INFILE)
 
static void treeNeedCh (int c1, const char *where, FILE *INFILE)
 
static void addElementLen (tree *tr, nodeptr p, FILE *INFILE)
 
static void uprootTree (tree *tr, nodeptr p)
 
static void treeReadLen (tree *tr, FILE *INFILE)
 
static double evaluate (tree *tr, nodeptr p)
 
static void dli_dki (nodeptr p)
 
static void spanSubtree (nodeptr p)
 
static void findSiteRates (tree *tr, double ki_min, double ki_max, double d_ki, double max_error)
 
static double subtreeLength (nodeptr p)
 
static double treeLength (tree *tr)
 
static void categorize (int Sites, int Categs, int Weight[], int Pattern[], double Patrate[], double categrate[], int sitecateg[])
 
static void getArbFilter ()
 
static int get_next_SAI_count ()
 
static GBDATAcreate_next_SAI ()
 
static bool writeToArb ()
 
static void openArb (const char *dbname)
 
static void saveArb (const char *saveAs)
 
static void closeArb ()
 
static void wrfile (FILE *outfile, int Sites, int Categs, int Weight[], double categrate[], int sitecateg[])
 
static void summarize (int treenum)
 
static void makeUserRates (tree *tr, FILE *INFILE)
 
bool is_char (const char *name, char c)
 
bool wantSTDIN (const char *iname)
 
int ARB_main (int argc, char *argv[])
 

Variables

static xarrayusedxtip
 
static xarrayfreextip
 
static double dLidki [maxpatterns]
 
static double bestki [maxpatterns]
 
static double bestLi [maxpatterns]
 
static double patrate [maxpatterns]
 
static double xi
 
static double xv
 
static double ttratio
 
static double freqa
 
static double freqc
 
static double freqg
 
static double freqt
 
static double freqr
 
static double freqy
 
static double invfreqr
 
static double invfreqy
 
static double freqar
 
static double freqcy
 
static double freqgr
 
static double freqty
 
static double fracchange
 
static int info [maxsites+1]
 
static int patsite [maxsites+1]
 
static int pattern [maxsites+1]
 
static int patweight [maxsites+1]
 
static int weight [maxsites+1]
 
static int categs
 
static int endsite
 
static int mininfo
 
static int numsp
 
static int sites
 
static int weightsum
 
static bool anerror
 
static bool freqsfrom
 
static bool interleaved
 
static bool printdata
 
static bool writefile
 
static bool userweights
 
static chary [maxsp+1]
 
static chararb_filter
 
static charalignment_name
 
static GBDATAgb_main
 

Macro Definition Documentation

#define programName   "DNAml_rates"

Definition at line 25 of file arb_dnarates.cxx.

Referenced by getnums().

#define programVersion   "1.0.0"

Definition at line 26 of file arb_dnarates.cxx.

Referenced by getnums().

#define programDate   "April 11, 1992"

Definition at line 27 of file arb_dnarates.cxx.

Referenced by getnums().

#define assert (   bed)    arb_assert(bed)

Function Documentation

static void getnums ( FILE *  INFILE)
static

Definition at line 87 of file arb_dnarates.cxx.

References anerror, maxsites, maxsp, numsp, programDate, programName, programVersion, and sites.

Referenced by getinput().

int min ( int  i,
int  j 
)
inline

Definition at line 122 of file arb_dnarates.cxx.

Referenced by wrfile().

bool digit ( int  ch)
inline

Definition at line 123 of file arb_dnarates.cxx.

Referenced by getdata(), and PH_create_ml_multiline_SAI().

bool white ( int  ch)
inline

Definition at line 124 of file arb_dnarates.cxx.

Referenced by getdata(), inputweights(), only_whitespace(), and treeGetCh().

static void uppercase ( int chptr)
static

Definition at line 126 of file arb_dnarates.cxx.

Referenced by getdata(), and getoptions().

static int base36 ( int  ch)
static

Definition at line 138 of file arb_dnarates.cxx.

Referenced by get_short(), and inputweights().

static int itobase36 ( int  i)
static

Definition at line 150 of file arb_dnarates.cxx.

Referenced by getdata(), wrfile(), and writeToArb().

static int findch ( int  c,
FILE *  INFILE 
)
static
static void inputweights ( FILE *  INFILE)
static

Definition at line 167 of file arb_dnarates.cxx.

References anerror, base36(), findch(), nmlngth, sites, weight, weightsum, and white().

Referenced by getoptions().

static void getoptions ( FILE *  INFILE)
static
static void getbasefreqs ( FILE *  INFILE)
static

Definition at line 337 of file arb_dnarates.cxx.

References anerror, findch(), fracchange, freqa, freqar, freqc, freqcy, freqg, freqgr, freqr, freqsfrom, freqt, freqty, freqy, invfreqr, invfreqy, ttratio, xi, and xv.

Referenced by getinput().

static void getyspace ( )
static

Definition at line 381 of file arb_dnarates.cxx.

References anerror, numsp, sites, and y.

Referenced by getinput().

static void setuptree ( tree tr,
const int  numSp 
)
static
static void freeTreeNode ( nodeptr  p)
static

Definition at line 445 of file arb_dnarates.cxx.

References xarray::a, and node::x.

Referenced by freeTree().

static void freeTree ( tree tr)
static

Definition at line 456 of file arb_dnarates.cxx.

References freeTreeNode(), leafs_2_nodes(), tree::mxtips, node::next, tree::nodep, and ROOTED.

Referenced by ARB_main().

static void getdata ( tree tr,
FILE *  INFILE 
)
static
static void sitesort ( )
static

Definition at line 650 of file arb_dnarates.cxx.

References numsp, patsite, sites, and y.

Referenced by makeweights().

static void sitecombcrunch ( )
static

Definition at line 680 of file arb_dnarates.cxx.

References endsite, numsp, patsite, pattern, patweight, sites, weight, and y.

Referenced by makeweights().

static void makeweights ( )
static

Definition at line 712 of file arb_dnarates.cxx.

References anerror, endsite, maxpatterns, patsite, sitecombcrunch(), sites, and sitesort().

Referenced by getinput().

static void makevalues ( tree tr)
static

Definition at line 728 of file arb_dnarates.cxx.

References endsite, tree::nodep, numsp, patsite, node::tip, and y.

Referenced by getinput().

static void empiricalfreqs ( tree tr)
static

Definition at line 740 of file arb_dnarates.cxx.

References endsite, freqa, freqc, freqg, freqt, tree::nodep, numsp, patweight, and node::tip.

Referenced by getinput().

static void getinput ( tree tr,
FILE *  INFILE 
)
static
static xarray* setupxarray ( )
static

Definition at line 802 of file arb_dnarates.cxx.

References xarray::a, xarray::c, endsite, xarray::g, xarray::next, NULp, xarray::owner, xarray::prev, and xarray::t.

Referenced by linkxarray(), and setupnodex().

static void linkxarray ( int  req,
int  min,
xarray **  freexptr,
xarray **  usedxptr 
)
static

Definition at line 823 of file arb_dnarates.cxx.

References anerror, xarray::next, NULp, xarray::prev, and setupxarray().

Referenced by ARB_main().

static void setupnodex ( tree tr)
static

Definition at line 860 of file arb_dnarates.cxx.

References anerror, tree::mxtips, tree::nodep, setupxarray(), and node::x.

Referenced by ARB_main().

static xarray* getxtip ( nodeptr  p)
static

Definition at line 868 of file arb_dnarates.cxx.

References anerror, freextip, xarray::next, NULp, xarray::owner, xarray::prev, usedxtip, and node::x.

Referenced by newview().

static xarray* getxnode ( nodeptr  p)
static

Definition at line 932 of file arb_dnarates.cxx.

References node::next, NULp, s, and node::x.

Referenced by newview().

static void newview ( nodeptr  p)
static
static void hookup ( nodeptr  p,
nodeptr  q,
double  z 
)
static

Definition at line 1054 of file arb_dnarates.cxx.

References node::back, and node::z.

Referenced by addElementLen(), and uprootTree().

static void initrav ( nodeptr  p)
static

Definition at line 1061 of file arb_dnarates.cxx.

References node::back, newview(), node::next, and node::tip.

Referenced by findSiteRates(), and treeReadLen().

static int treeFinishCom ( FILE *  INFILE)
static

Definition at line 1073 of file arb_dnarates.cxx.

References inquote.

Referenced by treeGetCh().

static int treeGetCh ( FILE *  INFILE)
static
static void treeFlushLabel ( FILE *  INFILE)
static

Definition at line 1102 of file arb_dnarates.cxx.

References findch(), and treeGetCh().

Referenced by addElementLen(), and treeReadLen().

static int findTipName ( tree tr,
int  ch,
FILE *  INFILE 
)
static

Definition at line 1129 of file arb_dnarates.cxx.

References node::back, tree::mxtips, node::name, nmlngth, and tree::nodep.

Referenced by addElementLen().

static double processLength ( FILE *  INFILE)
static

Definition at line 1195 of file arb_dnarates.cxx.

References anerror, and treeGetCh().

Referenced by addElementLen(), and treeFlushLen().

static void treeFlushLen ( FILE *  INFILE)
static

Definition at line 1214 of file arb_dnarates.cxx.

References processLength(), and treeGetCh().

Referenced by treeReadLen().

static void treeNeedCh ( int  c1,
const char where,
FILE *  INFILE 
)
static

Definition at line 1222 of file arb_dnarates.cxx.

References anerror, and treeGetCh().

Referenced by addElementLen(), and treeReadLen().

static void addElementLen ( tree tr,
nodeptr  p,
FILE *  INFILE 
)
static
static void uprootTree ( tree tr,
nodeptr  p 
)
static
static void treeReadLen ( tree tr,
FILE *  INFILE 
)
static
static double evaluate ( tree tr,
nodeptr  p 
)
static
static void dli_dki ( nodeptr  p)
static
static void spanSubtree ( nodeptr  p)
static

Definition at line 1488 of file arb_dnarates.cxx.

References node::back, dli_dki(), node::next, and node::tip.

Referenced by findSiteRates().

static void findSiteRates ( tree tr,
double  ki_min,
double  ki_max,
double  d_ki,
double  max_error 
)
static
static double subtreeLength ( nodeptr  p)
static

Definition at line 1559 of file arb_dnarates.cxx.

References node::back, fracchange, node::next, node::tip, and node::z.

Referenced by treeLength().

static double treeLength ( tree tr)
static

Definition at line 1570 of file arb_dnarates.cxx.

References node::back, node::next, tree::start, subtreeLength(), and node::tip.

Referenced by makeUserRates().

static void categorize ( int  Sites,
int  Categs,
int  Weight[],
int  Pattern[],
double  Patrate[],
double  categrate[],
int  sitecateg[] 
)
static

Definition at line 1581 of file arb_dnarates.cxx.

References nint.

Referenced by summarize(), and writeToArb().

static void getArbFilter ( )
static

Get the calling filter, needed to expand weights afterwards

Definition at line 1643 of file arb_dnarates.cxx.

References AWAR_GDE_EXPORT_FILTER, GB_begin_transaction(), GB_commit_transaction(), GBT_get_default_alignment(), and GBT_read_string().

Referenced by ARB_main().

static int get_next_SAI_count ( )
static

Definition at line 1651 of file arb_dnarates.cxx.

References GB_FIND, GB_INT, GB_read_int(), GB_search(), and GB_write_int().

Referenced by create_next_SAI().

static GBDATA* create_next_SAI ( )
static

Definition at line 1662 of file arb_dnarates.cxx.

References GBT_find_or_create_SAI(), GBT_find_SAI(), get_next_SAI_count(), and NULp.

Referenced by writeToArb().

static bool writeToArb ( )
static
static void openArb ( const char dbname)
static

Definition at line 1771 of file arb_dnarates.cxx.

References EXIT_FAILURE, GB_open(), GB_warning(), and GB_warningf().

Referenced by ARB_main().

static void saveArb ( const char saveAs)
static

Definition at line 1784 of file arb_dnarates.cxx.

References error(), EXIT_FAILURE, GB_save(), and GB_warningf().

Referenced by ARB_main().

static void closeArb ( )
static

Definition at line 1792 of file arb_dnarates.cxx.

References GB_close().

Referenced by ARB_main().

static void wrfile ( FILE *  outfile,
int  Sites,
int  Categs,
int  Weight[],
double  categrate[],
int  sitecateg[] 
)
static

Definition at line 1796 of file arb_dnarates.cxx.

References itobase36(), and min().

Referenced by summarize().

static void summarize ( int  treenum)
static

Definition at line 1842 of file arb_dnarates.cxx.

References categorize(), categs, maxcategories, maxsites, patrate, pattern, sites, weight, wrfile(), and writefile.

Referenced by makeUserRates().

static void makeUserRates ( tree tr,
FILE *  INFILE 
)
static
bool is_char ( const char name,
char  c 
)
inline

Definition at line 1915 of file arb_dnarates.cxx.

Referenced by wantSTDIN().

bool wantSTDIN ( const char iname)
inline

Definition at line 1916 of file arb_dnarates.cxx.

References is_char().

Referenced by ARB_main().

int ARB_main ( int  argc,
char argv[] 
)

Variable Documentation

xarray* usedxtip
static

Definition at line 41 of file arb_dnarates.cxx.

Referenced by ARB_main(), and getxtip().

xarray * freextip
static

Definition at line 41 of file arb_dnarates.cxx.

Referenced by ARB_main(), and getxtip().

double dLidki[maxpatterns]
static

Definition at line 44 of file arb_dnarates.cxx.

Referenced by dli_dki(), and findSiteRates().

double bestki[maxpatterns]
static

Definition at line 44 of file arb_dnarates.cxx.

Referenced by findSiteRates().

double bestLi[maxpatterns]
static

Definition at line 44 of file arb_dnarates.cxx.

Referenced by findSiteRates().

double patrate[maxpatterns]
static
double xi
static
double xv
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), evaluate(), getbasefreqs(), and newview().

double ttratio
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by ColumnStat::get_ttratio(), getbasefreqs(), and getoptions().

double freqa
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), empiricalfreqs(), evaluate(), getbasefreqs(), and newview().

double freqc
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), empiricalfreqs(), evaluate(), getbasefreqs(), and newview().

double freqg
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), empiricalfreqs(), evaluate(), getbasefreqs(), and newview().

double freqt
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), empiricalfreqs(), evaluate(), getbasefreqs(), and newview().

double freqr
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by getbasefreqs().

double freqy
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by getbasefreqs().

double invfreqr
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), evaluate(), getbasefreqs(), and newview().

double invfreqy
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by dli_dki(), evaluate(), getbasefreqs(), and newview().

double freqar
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by getbasefreqs().

double freqcy
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by getbasefreqs().

double freqgr
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by getbasefreqs().

double freqty
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by getbasefreqs().

double fracchange
static

Definition at line 50 of file arb_dnarates.cxx.

Referenced by addElementLen(), getbasefreqs(), and subtreeLength().

int info[maxsites+1]
static
int patsite[maxsites+1]
static

Definition at line 57 of file arb_dnarates.cxx.

Referenced by makevalues(), makeweights(), sitecombcrunch(), and sitesort().

int pattern[maxsites+1]
static
int patweight[maxsites+1]
static

Definition at line 57 of file arb_dnarates.cxx.

Referenced by dli_dki(), empiricalfreqs(), evaluate(), and sitecombcrunch().

int weight[maxsites+1]
static
int categs
static

Definition at line 64 of file arb_dnarates.cxx.

Referenced by getoptions(), summarize(), and writeToArb().

int endsite
static
int mininfo
static

Definition at line 64 of file arb_dnarates.cxx.

Referenced by getoptions().

int numsp
static
int sites
static
int weightsum
static

Definition at line 64 of file arb_dnarates.cxx.

Referenced by getoptions(), and inputweights().

bool anerror
static
bool freqsfrom
static

Definition at line 72 of file arb_dnarates.cxx.

Referenced by getbasefreqs(), getinput(), and getoptions().

bool interleaved
static

Definition at line 72 of file arb_dnarates.cxx.

Referenced by getdata(), and getoptions().

bool printdata
static

Definition at line 72 of file arb_dnarates.cxx.

Referenced by getdata(), and getoptions().

bool writefile
static

Definition at line 72 of file arb_dnarates.cxx.

Referenced by getoptions(), and summarize().

bool userweights
static

Definition at line 72 of file arb_dnarates.cxx.

Referenced by getdata(), and getoptions().

char* y[maxsp+1]
static

Definition at line 80 of file arb_dnarates.cxx.

Referenced by AW_window::at_y(), AW_window::auto_increment(), AW_window::auto_space(), AW_displayColorRange(), AW_xfig::AW_xfig(), awt_aps_calc_pages_needed(), awt_aps_go(), awt_aps_set_magnification_to_fit_ypage(), awt_aps_text_changed(), UNTYPED::awt_create_collect_buttons(), awt_create_input_mask(), UNTYPED::awt_create_order_buttons(), buildColumnTranslatorFromAwars(), ED4_abstract_sequence_terminal::calc_interval_displayed_in_rectangle(), ED4_abstract_sequence_terminal::calc_update_interval(), DI_MATRIX::calculate(), ED4_base::check_all(), cinvit_(), ED4_base::clear_background(), AW_clipable::clip(), DI_MATRIX::compress(), ComputeRotationXY(), AP_userdef_matrix::create_awars(), AP_userdef_matrix::create_input_fields(), create_key_map_window(), create_matrix_config_window(), ItemFieldShader::customize(), detectEqualRowsAndColumns(), PH_display::display(), GLRenderer::DisplayMoleculeName(), ED4_text_terminal::draw(), ED4_CursorShape::ED4_CursorShape(), elmhes_(), ED4_root::generate_window(), ALI_PATHMAP::get(), ED4_CursorShape::get_bounding_box(), ED4_manager::get_competent_child(), ED4_manager::get_competent_clicked_child(), get_max_slider_xpos(), get_max_slider_ypos(), get_upper_lower_cursor_pos(), ED4_scrolled_rectangle::get_world_rect(), getdata(), getyspace(), HalfSize(), hqr2_(), hqr_(), invit_(), ED4_cursor::is_completely_visible(), ED4_cursor::is_partly_visible(), AW::Rectangle::left_edge(), SymmetricMatrixMapper::linear_index(), ED4_scrolled_rectangle::link(), AW::Rectangle::lower_left_corner(), makevalues(), matrix_config_changed_cb(), minfit_(), AP_userdef_matrix::normize(), GEN_root::paint(), ALI_PATHMAP::print(), AW_xfig::print(), probe_match(), qzvec_(), reduc2_(), reduc_(), Resize(), AW::Rectangle::right_edge(), SAI_init_calculator_awars(), select_and_update(), ALI_PATHMAP::set(), ED4_cursor::set_abs_x(), MP_Main::set_p_eval(), ED4_manager::Show(), ED4_cursor::ShowCursor(), sitecombcrunch(), sitesort(), Structure3D::StoreCoordinates(), Structure3D::StoreHelixNrInfo(), svd_(), AP_userdef_matrix::update_from_awars(), and ED4_window::update_window_coords().

char* arb_filter
static

Definition at line 1639 of file arb_dnarates.cxx.

char* alignment_name
static
GBDATA* gb_main
static

Definition at line 1641 of file arb_dnarates.cxx.