/* min_interval.c Compile with: gcc -g min_interval.c -lm -o min_interval Example run: min_interval intv_file Extracts the "best" a-interval (ie, the one that minimizes the fn+fp count) from a phylogen or infocon interval file. Used with phylogen/infocon, in combined region analyses, eg for hs23b (b/c the outputs are expressed as interval files follwing the merge procedure). */ #include #include #include #include #include #include #define Usage "%s " void fatal(char *message); void fatalf(char *msg, char *val); FILE *ckopen(char *name, char *mode); int main(int argc, char *argv[]) { char buffer[200]; double from, to; int min, fn, fp, total; FILE *file; if (argc!=2) fatalf(Usage, argv[0]); file = ckopen(argv[1],"r"); min = 100000; while (fgets(buffer,200,file)!=NULL) { sscanf(buffer, "%lf %lf %d %d %d", &from, &to, &fp, &fn, &total); if (total