#include #include #include "distance_matrix.h" #include "statgeom.h" #include "split.h" #include "cluster.h" #include "treeplot.h" #include "utils.h" #define PUBLIC #define PRIVATE static PRIVATE char scale1[] = "....,....1....,....2....,....3....,....4"; PRIVATE char scale2[] = "....,....5....,....6....,....7....,....8"; PRIVATE void usage(void); main(int argc, char *argv[]) { int n,i,j,l; int intty; int outtty; char *mask, junk[20]; char **s; char **ss[4]; float *B; float **dm; Split *S; Union *U; char DistAlgorithm='H'; int nn[4]; short Do_Split=0, Do_Wards=0, Do_Stg=1, Do_4_Stg=0, Do_Nj=0, Do_Mat=0; float per_digit, per_gap; mask = space(sizeof(char)*54); strcpy (mask,"%ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"); for (i=1; i %s\n","H (Hamming Distance)"); break; case 'A' : dm = StrEdit_SimpleDistMatrix(s,n); printf("> %s\n","A (Needleman-Wunsch Distance)"); break; case 'G' : dm = StrEdit_GotohDistMatrix(s,n); printf("> %s\n","G (Gotoh Distance)"); break; default: nrerror("This can't happen."); } } if(Do_Split) { S = split_decomposition(dm); sort_Split(S); print_Split(S); free_Split(S); } if(Do_Wards) { U = wards_cluster(dm); printf_phylogeny(U,"W"); PSplot_phylogeny(U,"wards.ps","Ward's Method"); free(U); } if(Do_Nj) { U = neighbour_joining(dm); printf_phylogeny(U,"Nj"); PSplot_phylogeny(U,"nj.ps","Neighbor Joining"); free(U); } if(Do_Mat) printf_distance_matrix(dm); } if (dm!=NULL) free_distance_matrix(dm); for(i=0;i