void getoptions() { /* interactively set options */ long inseed0, loopcount; Char ch; boolean done; fprintf(outfile, "\nContinuous character Maximum Likelihood"); fprintf(outfile, " method version %s\n\n",VERSION); putchar('\n'); global = false; jumble = false; njumble = 1; lengths = false; outgrno = 1; outgropt = false; all = false; contchars = false; trout = true; usertree = false; printdata = false; progress = true; treeprint = true; loopcount = 0; do { cleerhome(); printf("\nContinuous character Maximum Likelihood"); printf(" method version %s\n\n",VERSION); printf("Settings for this run:\n"); printf(" U Search for best tree? %s\n", (usertree ? "No, use user trees in input" : "Yes")); if (usertree) { printf(" L Use lengths from user trees?%s\n", (lengths ? " Yes" : " No")); } printf(" C Gene frequencies or continuous characters? %s\n", (contchars ? "Continuous characters" : "Gene frequencies")); if (!contchars) printf(" A Input file has all alleles at each locus? %s\n", (all ? "Yes" : "No, one allele missing at each")); printf(" O Outgroup root? %s %ld\n", (outgropt ? "Yes, at species number" : "No, use as outgroup species"),outgrno); if (!usertree) { printf(" G Global rearrangements? %s\n", (global ? "Yes" : "No")); printf(" J Randomize input order of species?"); if (jumble) printf(" Yes (seed=%8ld,%3ld times)\n", inseed0, njumble); else printf(" No. Use input order\n"); } printf(" M Analyze multiple data sets?"); if (mulsets) printf(" Yes, %2ld sets\n", datasets); else printf(" No\n"); printf(" 0 Terminal type (IBM PC, ANSI, none)? %s\n", ibmpc ? "IBM PC" : ansi ? "ANSI" : "(none)"); printf(" 1 Print out the data at start of run %s\n", (printdata ? "Yes" : "No")); printf(" 2 Print indications of progress of run %s\n", (progress ? "Yes" : "No")); printf(" 3 Print out tree %s\n", (treeprint ? "Yes" : "No")); printf(" 4 Write out trees onto tree file? %s\n", (trout ? "Yes" : "No")); printf("\n Y to accept these or type the letter for one to change\n"); #ifdef WIN32 phyFillScreenColor(); #endif fflush(stdout); scanf("%c%*[^\n]", &ch); getchar(); uppercase(&ch); done = (ch == 'Y'); if (!done) { if (((!usertree) && (strchr("JOUGACM12340", ch) != NULL)) || (usertree && ((strchr("LOUACM12340", ch) != NULL)))){ switch (ch) { case 'A': if (!contchars) all = !all; break; case 'C': contchars = !contchars; break; case 'G': global = !global; break; case 'J': jumble = !jumble; if (jumble) initjumble(&inseed, &inseed0, seed, &njumble); else njumble = 1; break; case 'L': lengths = !lengths; break; case 'O': outgropt = !outgropt; if (outgropt) initoutgroup(&outgrno, spp); break; case 'U': usertree = !usertree; break; case 'M': mulsets = !mulsets; if (mulsets) initdatasets(&datasets); break; case '0': initterminal(&ibmpc, &ansi); break; case '1': printdata = !printdata; break; case '2': progress = !progress; break; case '3': treeprint = !treeprint; break; case '4': trout = !trout; break; } } else printf("Not a possible option!\n"); } countup(&loopcount, 100); } while (!done); } /* getoptions */
void getoptions() { /* interactively set options */ long inseed0=0; Char ch; boolean done=false; putchar('\n'); minev = false; global = false; jumble = false; njumble = 1; lengths = false; lower = false; negallowed = false; outgrno = 1; outgropt = false; power = 2.0; replicates = false; trout = true; upper = false; usertree = false; printdata = false; progress = true; treeprint = true; do { cleerhome(); printf("\nFitch-Margoliash method version %s\n\n",VERSION); printf("Settings for this run:\n"); printf(" D Method (F-M, Minimum Evolution)? %s\n", (minev ? "Minimum Evolution" : "Fitch-Margoliash")); printf(" U Search for best tree? %s\n", (usertree ? "No, use user trees in input file" : "Yes")); if (usertree) { printf(" N Use lengths from user trees? %s\n", (lengths ? "Yes" : "No")); } printf(" P Power?%9.5f\n",power); printf(" - Negative branch lengths allowed? %s\n", negallowed ? "Yes" : "No"); printf(" O Outgroup root?"); if (outgropt) printf(" Yes, at species number%3ld\n", outgrno); else printf(" No, use as outgroup species%3ld\n", outgrno); printf(" L Lower-triangular data matrix?"); if (lower) printf(" Yes\n"); else printf(" No\n"); printf(" R Upper-triangular data matrix?"); if (upper) printf(" Yes\n"); else printf(" No\n"); printf(" S Subreplicates?"); if (replicates) printf(" Yes\n"); else printf(" No\n"); if (!usertree) { printf(" G Global rearrangements?"); if (global) printf(" Yes\n"); else printf(" No\n"); printf(" J Randomize input order of species?"); if (jumble) printf(" Yes (seed =%8ld,%3ld times)\n", inseed0, njumble); else printf(" No. Use input order\n"); } printf(" M Analyze multiple data sets?"); if (mulsets) printf(" Yes, %2ld sets\n", datasets); else printf(" No\n"); printf(" 0 Terminal type (IBM PC, ANSI, none)?"); if (ibmpc) printf(" IBM PC\n"); if (ansi) printf(" ANSI\n"); if (!(ibmpc || ansi)) printf(" (none)\n"); printf(" 1 Print out the data at start of run"); if (printdata) printf(" Yes\n"); else printf(" No\n"); printf(" 2 Print indications of progress of run"); if (progress) printf(" Yes\n"); else printf(" No\n"); printf(" 3 Print out tree"); if (treeprint) printf(" Yes\n"); else printf(" No\n"); printf(" 4 Write out trees onto tree file?"); if (trout) printf(" Yes\n"); else printf(" No\n"); printf( "\n Y to accept these or type the letter for one to change\n"); #ifdef WIN32 phyFillScreenColor(); #endif scanf("%c%*[^\n]", &ch); getchar(); uppercase(&ch); done = (ch == 'Y'); if (!done) { if (strchr("DJOUNPG-LRSM01234",ch) != NULL) { switch (ch) { case 'D': minev = !minev; if (minev && (!negallowed)) negallowed = true; break; case '-': negallowed = !negallowed; break; case 'G': global = !global; break; case 'J': jumble = !jumble; if (jumble) initjumble(&inseed, &inseed0, seed, &njumble); else njumble = 1; break; case 'L': lower = !lower; break; case 'N': lengths = !lengths; break; case 'O': outgropt = !outgropt; if (outgropt) initoutgroup(&outgrno, spp); break; case 'P': initpower(&power); break; case 'R': upper = !upper; break; case 'S': replicates = !replicates; break; case 'U': usertree = !usertree; break; case 'M': mulsets = !mulsets; if (mulsets) initdatasets(&datasets); break; case '0': initterminal(&ibmpc, &ansi); break; case '1': printdata = !printdata; break; case '2': progress = !progress; break; case '3': treeprint = !treeprint; break; case '4': trout = !trout; break; } } else printf("Not a possible option!\n"); } } while (!done); } /* getoptions */