8 void arguments( int argc, char *argv[] )
17 while( --argc > 0 && (*++argv)[0] == '-' )
19 while ( (c = *++argv[0]) )
25 fprintf( stderr, "eregfile = %s\n", eregfile );
30 fprintf( stderr, "regfile = %s\n", regfile );
35 fprintf( stderr, "inputfile = %s\n", inputfile );
42 fprintf( stderr, "illegal option %c\n", c );
52 fprintf( stderr, "options: Check source file !\n" );
57 void readereg( FILE *regfp, int **regtable, char **revtable, int *outtable, int *noutpt, int *loutpt )
69 fgets( gett, 999, regfp );
70 sscanf( gett, "%c %s %s %s %s %s", &cmem, reg[0], reg[1], reg[2], reg[3], reg[4] );
73 fprintf( stderr, "Format error\n" );
78 sscanf( reg[j], "%d-%d-%c", regtable[0]+(j*2), regtable[0]+(j*2)+1, revtable[0]+j );
79 fprintf( stderr, "%d %d-%d\n", 0, regtable[0][j*2], regtable[0][j*2+1] );
80 startpos = regtable[0][j*2];
81 endpos = regtable[0][j*2+1];
82 if( startpos > endpos )
84 endpos = regtable[0][j*2];
85 startpos = regtable[0][j*2+1];
87 if( startpos != -1 && endpos != -1 )
88 *loutpt += endpos - startpos + 1;
93 fgets( gett, 999, regfp );
94 if( feof( regfp ) ) break;
95 sscanf( gett, "%d o=%s", &mem, out );
98 fprintf( stderr, "Out of range\n" );
101 outtable[mem] = atoi( out );
102 if( outtable[mem] ) *noutpt += 1;
106 void readreg( FILE *regfp, int **regtable, char **revtable, int *outtable )
116 fgets( gett, 999, regfp );
117 if( feof( regfp ) ) break;
118 sscanf( gett, "%d %s %s %s %s %s o=%s", &mem, reg[0], reg[1], reg[2], reg[3], reg[4], out );
121 fprintf( stderr, "Out of range\n" );
126 sscanf( reg[j], "%d-%d-%c", regtable[mem]+(j*2), regtable[mem]+(j*2)+1, revtable[mem]+j );
127 fprintf( stderr, "%d %d-%d\n", mem, regtable[mem][j*2], regtable[mem][j*2+1] );
129 outtable[mem] = atoi( out );
133 int main( int argc, char *argv[] )
145 arguments( argc, argv );
149 infp = fopen( inputfile, "r" );
152 fprintf( stderr, "Cannot open %s\n", inputfile );
160 getnumlen_nogap( infp, &nlenmin );
164 regfp = fopen( regfile, "r" );
167 fprintf( stderr, "Cannot open %s\n", regfile );
170 regtable = AllocateIntMtx( njob, 5*2 );
171 revtable = AllocateCharMtx( njob, 5 );
172 outtable = AllocateIntVec( njob );
173 readreg( regfp, regtable, revtable, outtable );
174 cutData( infp, regtable, revtable, outtable );
178 regfp = fopen( eregfile, "r" );
181 fprintf( stderr, "Cannot open %s\n", eregfile );
184 regtable = AllocateIntMtx( 1, 5*2 );
185 revtable = AllocateCharMtx( 1, 5 );
186 outtable = AllocateIntVec( njob );
187 readereg( regfp, regtable, revtable, outtable, &nout, &lout );
188 fprintf( stderr, "nout = %d, lout = %d\n", nout, lout );
190 outseq = AllocateCharMtx( nout, lout+1 );
191 name = AllocateCharMtx( nout, B );
193 cutAlignment( infp, regtable, revtable, outtable, name, outseq );
194 fprintf( stderr, "gappick! nout = %d\n", nout );
195 commongappick( nout, outseq );
196 for( i=0; i<nout; i++ )
198 fprintf( stdout, "%s\n", name[i] );
199 fprintf( stdout, "%s\n", outseq[i] );
207 fprintf( stderr, "Strategy:\n" );
208 fprintf( stderr, " Not-Aligned\n" );
210 // fprintf( stdout, "%d x %d - %d %c\n", njob, nlenmax, nlenmin, dorp );