// ============================================================ //
//                                                              //
//   File      : TreeRead.h                                     //
//   Purpose   :                                                //
//                                                              //
//   Coded by Ralf Westram (coder@reallysoft.de) in June 2009   //
//   Institute of Microbiology (Technical University Munich)    //
//   www.arb-home.de                                            //
//                                                              //
// ============================================================ //

#ifndef TREEREAD_H
#define TREEREAD_H

#ifndef ARBDBT_H
#include <arbdbt.h>
#endif

#define DEFAULT_BRANCH_LENGTH_MARKER -1000.0 // tree-edges w/o length are marked with this value during read and corrected in TREE_scale
inline bool is_marked_as_default_len(GBT_LEN len) { return len <= DEFAULT_BRANCH_LENGTH_MARKER; }
void TREE_scale(TreeNode *tree, double length_scale, double bootstrap_scale); // Note: auto-called by TREE_load + TREE_load_to_db

TreeNode *TREE_load(const char *path, TreeRoot *troot, char **commentPtr, bool allow_length_scaling, char **warningPtr);
GB_ERROR  TREE_load_to_db(GBDATA *gb_main, const char *treefile, const char *tree_name);

#else
#error TreeRead.h included twice
#endif // TREEREAD_H
