/* min_intervalp.c Compile with: gcc -g min_intervalp.c -lm -o min_interval Example run: min_interval intv_file Extracts the "best" p-interval (ie, the one that minimizes the fn+fp count) from an agree-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]; int 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, "%d %d %d %d %d", &from, &to, &fp, &fn, &total); if (total