#include "psublast/psublast.h" typedef struct region { int b, e; int flag; struct region *link; } region_list_t, *region_list_ptr; typedef struct line { char orf[100]; int len; int b, e; } hit_t, *hit_ptr; #define Usage "%s " #define MAX_NUM_MATCHES 100000 static hit_t Matches[MAX_NUM_MATCHES]; static int numMatches = 0; static region_list_ptr new_region(int b, int e, region_list_ptr link); static int insert_region(region_list_ptr *rlist, int b, int e, int flag); int main(int argc, char *argv[]) { FILE *fp; char buf[1000], *tok, *orf; region_list *regions; if (argc!=2) fatalf(Usage, argv[0]); fp = ckopen(argv[1],"r"); regions = NULL; while (fgets(buf,1000,fp)!=NULL) { tok = strtok(buf, " "); orf = strsave(tok); tok = strtok(NULL, " "); from = atoi(tok); tok = strtok(NULL, " \n"); to = atoi(tok); insert_region(®ions, from, to, 1); } fclose(fp); fp = ckopen(argv[2],"r"); while (fgets(buf,1000,fp)!=NULL) { tok = strtok(buf, " "); tok = strtok(NULL, " "); from = atoi(tok); tok = strtok(NULL, " \n"); to = atoi(tok); insert_region(®ions, from, to, -1); } fclose(fp); for (r=regions; r; r=r->link) if (r->flag == -1) printf(">SBO %d %d\n", r->b, r->e); } static region_list_ptr new_region(int b, int e, region_list_ptr link) { region_list_ptr new = ckalloc(sizeof(region_list_t)); new->b = b; new->e = e; new->link = link; return new; }