#include #include #include #include unsigned long int j,i,p; int k=0,a=0,b=0,n,g,diff=0,e=0,gc=0; char ch,buf[150]; fpos_t pos; FILE *f1,*f2,*f3,*f4,*f5,*f8; //-------------sequence structure-------------// struct SEQUENCE { char tag[50]; char *seq; unsigned long int size,at_cnt; }; struct SEQUENCE *SS; /*################################# EXTRACTS THE SEQUENCE #############################*/ void Extractseq(FILE *f1){ char c; p=0; //Sets the Pointer to beginning of Scaffold while(!feof(f1)){ fscanf(f1,"%s%*[^\n]",buf); if(strstr(buf,SS[i].tag)){ j=1;fgetpos(f1,&pos);break;} } //Finds the size of the Sequence while((c = fgetc(f1))!=EOF){ if(c == '>') break;else if(c=='A' || c=='T' || c=='a' || c=='t') p++; else if(c=='G' || c=='C' || c=='N' || c=='g' || c=='c' || c=='n') j++; else if(c == '\n') continue; } SS[i].size = j+p; SS[i].at_cnt = p; }