8 void arguments( int argc, char *argv[] )
16 while( --argc > 0 && (*++argv)[0] == '-' )
18 while ( (c = *++argv[0]) )
24 fprintf( stderr, "eregfile = %s\n", eregfile );
29 fprintf( stderr, "regfile = %s\n", regfile );
34 fprintf( stderr, "inputfile = %s\n", inputfile );
38 fprintf( stderr, "illegal option %c\n", c );
48 fprintf( stderr, "options: Check source file !\n" );
53 void readereg( FILE *regfp, int **regtable, char **revtable, int *outtable, int *noutpt, int *loutpt )
59 char rev[100], out[100];
64 fgets( gett, 999, regfp );
65 sscanf( gett, "%c %s %s %s %s %s", &mem, reg[0], reg[1], reg[2], reg[3], reg[4] );
68 fprintf( stderr, "Format error\n" );
73 sscanf( reg[j], "%d-%d-%c", regtable[0]+(j*2), regtable[0]+(j*2)+1, revtable[0]+j );
74 fprintf( stderr, "%d %d-%d\n", 0, regtable[0][j*2], regtable[0][j*2+1] );
75 startpos = regtable[0][j*2];
76 endpos = regtable[0][j*2+1];
77 if( startpos > endpos )
79 endpos = regtable[0][j*2];
80 startpos = regtable[0][j*2+1];
82 if( startpos != -1 && endpos != -1 )
83 *loutpt += endpos - startpos + 1;
88 fgets( gett, 999, regfp );
89 if( feof( regfp ) ) break;
90 sscanf( gett, "%d o=%s", &mem, out );
93 fprintf( stderr, "Out of range\n" );
96 outtable[mem] = atoi( out );
97 if( outtable[mem] ) *noutpt += 1;
101 void readreg( FILE *regfp, int **regtable, char **revtable, int *outtable )
111 fgets( gett, 999, regfp );
112 if( feof( regfp ) ) break;
113 sscanf( gett, "%d %s %s %s %s %s o=%s", &mem, reg[0], reg[1], reg[2], reg[3], reg[4], out );
116 fprintf( stderr, "Out of range\n" );
121 sscanf( reg[j], "%d-%d-%c", regtable[mem]+(j*2), regtable[mem]+(j*2)+1, revtable[mem]+j );
122 fprintf( stderr, "%d %d-%d\n", mem, regtable[mem][j*2], regtable[mem][j*2+1] );
124 outtable[mem] = atoi( out );
128 int main( int argc, char *argv[] )
140 arguments( argc, argv );
144 infp = fopen( inputfile, "r" );
147 fprintf( stderr, "Cannot open %s\n", inputfile );
155 getnumlen_nogap( infp, &nlenmin );
159 regfp = fopen( regfile, "r" );
162 fprintf( stderr, "Cannot open %s\n", regfile );
165 regtable = AllocateIntMtx( njob, 5*2 );
166 revtable = AllocateCharMtx( njob, 5 );
167 outtable = AllocateIntVec( njob );
168 readreg( regfp, regtable, revtable, outtable );
169 cutData( infp, regtable, revtable, outtable );
173 regfp = fopen( eregfile, "r" );
176 fprintf( stderr, "Cannot open %s\n", eregfile );
179 regtable = AllocateIntMtx( 1, 5*2 );
180 revtable = AllocateCharMtx( 1, 5 );
181 outtable = AllocateIntVec( njob );
182 readereg( regfp, regtable, revtable, outtable, &nout, &lout );
183 fprintf( stderr, "nout = %d, lout = %d\n", nout, lout );
185 outseq = AllocateCharMtx( nout, lout+1 );
186 name = AllocateCharMtx( nout, B );
188 cutAlignment( infp, regtable, revtable, outtable, name, outseq );
189 fprintf( stderr, "gappick! nout = %d\n", nout );
190 commongappick( nout, outseq );
191 for( i=0; i<nout; i++ )
193 fprintf( stdout, "%s\n", name[i] );
194 fprintf( stdout, "%s\n", outseq[i] );
202 fprintf( stderr, "Strategy:\n" );
203 fprintf( stderr, " Not-Aligned\n" );
205 // fprintf( stdout, "%d x %d - %d %c\n", njob, nlenmax, nlenmin, dorp );