コード例 #1
0
ファイル: tree-dist.C プロジェクト: msuchard/BAli-Phy
void tree_sample::add_tree(RootedTree& T)
{
  if (T.root().degree() == 2)
    T.remove_node_from_branch(T.root());

  add_tree(static_cast<Tree&>(T));
}
コード例 #2
0
ファイル: tree-dist.C プロジェクト: msuchard/BAli-Phy
 bool reader_t::next_tree(RootedTree& T)
 {
   int r;
   Tree& T2 = static_cast<Tree&>(T);
   if (next_tree_(T2,r)) {
     lines_++;
     T.reroot(r);
     return true;
   }
   else
     return false;
 }
コード例 #3
0
string write_no_names(const RootedTree& T, bool print_lengths) 
{
  vector<const_branchview> branches = sorted_neighbors(T.root());

  string output = "(";
  for(int i=0;i<branches.size();i++) {
    output += write_no_names(branches[i],print_lengths);
    if (i+1 < branches.size())
      output += ',';
  }
  output += ");";
  return output;
}
コード例 #4
0
ファイル: sequencetree.C プロジェクト: argriffing/BAli-Phy
string write_with_bootstrap_fraction(const RootedTree& T, const vector<string>& names, 
				     const vector<double>& bf, bool print_lengths) 
{
  vector<const_branchview> branches = sorted_neighbors(T.root());

  string output = "(";
  for(int i=0;i<branches.size();i++) {
    output += write_with_bootstrap_fraction(names,branches[i],bf,print_lengths);
    if (i+1 < branches.size())
      output += ',';
  }
  output += ");";
  return output;
}
コード例 #5
0
RootedTree::RootedTree(const RootedTree& t1, const RootedTree& t2) 
  :Tree(t1),root_(nodes_[t1.root_->node])
{
  merge_tree(root(), t2, t2.root());
}