コード例 #1
0
ファイル: disc.c プロジェクト: Chrisss50/ViralToolBox
void treeout2(node2 *p, long *col, node2 *root)
{
  /* write out file with representation of final tree */
  /* used in mix & penny */
  long i, n;
  Char c;

  if (p->tip) {
    n = 0;
    for (i = 1; i <= nmlngth; i++) {
      if (nayme[p->index - 1][i - 1] != ' ')
        n = i;
    }
    for (i = 0; i < n; i++) {
      c = nayme[p->index - 1][i];
      if (c == ' ')
        c = '_';
      putc(c, outtree);
    }
    *col += n;
  } else {
    putc('(', outtree);
    (*col)++;
    treeout2(p->next->back, col, root);
    putc(',', outtree);
    (*col)++;
    if (*col > 65) {
      putc('\n', outtree);
      *col = 0;
    }
    treeout2(p->next->next->back, col, root);
    putc(')', outtree);
    (*col)++;
  }
  if (p != root)
    return;
  if (nextree > 2)
    fprintf(outtree, "[%6.4f];\n", 1.0 / (nextree - 1));
  else
    fprintf(outtree, ";\n");
}  /* treeout2 */
コード例 #2
0
ファイル: penny.c プロジェクト: uw-loci/ome-server
void describe()
{
    /* prints ancestors, steps and table of numbers of steps in
       each character */

    if (stepbox) {
        putc('\n', outfile);
        writesteps(weights, numsteps);
    }
    if (questions && (!noroot || didreroot))
        guesstates(guess);
    if (ancseq) {
        hypstates(fullset, full, noroot, didreroot, root, wagner,
                  zeroanc, oneanc, treenode, guess, garbage);
        putc('\n', outfile);
    }
    if (trout) {
        col = 0;
        treeout2(root, &col, root);
    }
}  /* describe */