#include "mltaln.h" #define DEBUG 0 #define IODEBUG 0 #define SCOREOUT 0 void arguments( int argc, char *argv[] ) { int c; thrinter = 1.0; inputfile = NULL; fftkeika = 0; constraint = 0; nblosum = 62; fmodel = 0; calledByXced = 0; devide = 0; use_fft = 0; fftscore = 1; fftRepeatStop = 0; fftNoAnchStop = 0; weight = 3; utree = 1; tbutree = 1; refine = 0; check = 1; cut = 0.0; disp = 0; outgap = 1; alg = 'A'; mix = 0; tbitr = 0; scmtd = 5; tbweight = 0; tbrweight = 3; checkC = 0; treemethod = 'x'; contin = 0; scoremtx = 1; kobetsubunkatsu = 0; dorp = NOTSPECIFIED; ppenalty = NOTSPECIFIED; ppenalty_ex = NOTSPECIFIED; poffset = NOTSPECIFIED; kimuraR = NOTSPECIFIED; pamN = NOTSPECIFIED; geta2 = GETA2; fftWinSize = NOTSPECIFIED; fftThreshold = NOTSPECIFIED; TMorJTT = JTT; while( --argc > 0 && (*++argv)[0] == '-' ) { while ( c = *++argv[0] ) { switch( c ) { case 'i': inputfile = *++argv; fprintf( stderr, "inputfile = %s\n", inputfile ); --argc; goto nextoption; case 'f': ppenalty = (int)( atof( *++argv ) * 1000 - 0.5 ); fprintf( stderr, "ppenalty = %d\n", ppenalty ); --argc; goto nextoption; case 'g': ppenalty_ex = (int)( atof( *++argv ) * 1000 - 0.5 ); fprintf( stderr, "ppenalty_ex = %d\n", ppenalty_ex ); --argc; goto nextoption; case 'h': poffset = (int)( atof( *++argv ) * 1000 - 0.5 ); fprintf( stderr, "poffset = %d\n", poffset ); --argc; goto nextoption; case 'k': kimuraR = atoi( *++argv ); fprintf( stderr, "kimuraR = %d\n", kimuraR ); --argc; goto nextoption; case 'b': nblosum = atoi( *++argv ); scoremtx = 1; fprintf( stderr, "blosum %d\n", nblosum ); --argc; goto nextoption; case 'j': pamN = atoi( *++argv ); scoremtx = 0; TMorJTT = JTT; fprintf( stderr, "jtt %d\n", pamN ); --argc; goto nextoption; case 'm': pamN = atoi( *++argv ); scoremtx = 0; TMorJTT = TM; fprintf( stderr, "tm %d\n", pamN ); --argc; goto nextoption; case 'l': fastathreshold = atof( *++argv ); constraint = 2; fprintf( stderr, "weighti = %f\n", fastathreshold ); --argc; goto nextoption; case 'c': thrinter = atof( *++argv ); fprintf( stderr, "thrinter %f\n", thrinter ); --argc; goto nextoption; #if 0 case 'm': fmodel = 1; break; #endif case 'r': fmodel = -1; break; case 'D': dorp = 'd'; break; case 'P': dorp = 'p'; break; case 'e': fftscore = 0; break; case 'O': fftNoAnchStop = 1; break; case 'R': fftRepeatStop = 1; break; case 'Q': calledByXced = 1; break; case 's': treemethod = 's'; break; case 'x': treemethod = 'x'; break; case 'p': treemethod = 'p'; break; case 'a': alg = 'a'; break; case 'A': alg = 'A'; break; case 'S': alg = 'S'; break; case 'C': alg = 'C'; break; case 'F': use_fft = 1; break; case 'v': tbrweight = 3; break; case 'd': disp = 1; break; case 'o': outgap = 0; break; /* Modified 01/08/27, default: user tree */ case 'J': tbutree = 0; break; /* modification end. */ case 'z': fftThreshold = atoi( *++argv ); --argc; goto nextoption; case 'w': fftWinSize = atoi( *++argv ); --argc; goto nextoption; case 'Z': checkC = 1; break; default: fprintf( stderr, "illegal option %c\n", c ); argc = 0; break; } } nextoption: ; } if( argc == 1 ) { cut = atof( (*argv) ); argc--; } if( argc != 0 ) { fprintf( stderr, "options: Check source file !\n" ); exit( 1 ); } if( tbitr == 1 && outgap == 0 ) { fprintf( stderr, "conflicting options : o, m or u\n" ); exit( 1 ); } if( alg == 'C' && outgap == 0 ) { fprintf( stderr, "conflicting options : C, o\n" ); exit( 1 ); } } void treebase( char name[M][B], int nlen[M], char **seq, char **aseq, char **mseq1, char **mseq2, int ***topol, double *effarr, int alloclen, LocalHom **localhomtable ) { int i, j, l; int clus1, clus2; int s1, s2, r1, r2; float pscore, tscore; static char *indication1, *indication2; FILE *trap; static char name1[M][B], name2[M][B]; static double *effarr1 = NULL; static double *effarr2 = NULL; static LocalHom ***localhomshrink = NULL; float dumfl = 0.0; double total; if( effarr1 == NULL ) { effarr1 = AllocateDoubleVec( njob ); effarr2 = AllocateDoubleVec( njob ); indication1 = AllocateCharVec( 150 ); indication2 = AllocateCharVec( 150 ); #if 0 #else if( constraint ) { localhomshrink = (LocalHom ***)calloc( njob, sizeof( LocalHom ** ) ); for( i=0; i 66 ) fprintf( stderr, "..." ); fprintf( stderr, "\n" ); fprintf( stderr, "group2 = %.66s", indication2 ); if( strlen( indication2 ) > 66 ) fprintf( stderr, "..." ); fprintf( stderr, "\n" ); #endif // for( i=0; i 0.0 ) { fprintf( stderr, "Extending localhom ... " ); extendlocalhom2( njob, localhomtable, iscore ); fprintf( stderr, "done.\n" ); // job de watteoku for( i=0; inext ) tmpptr->opt /= localhomtable[i][j].nokori; } } } #endif // resetlocalhom( njob, localhomtable ); // chuui !!! #if 1 fprintf( stderr, "##### writing hat4, nlenmax = %d\n", nlenmax ); hat3p = fopen( "hat4", "w" ); if( !hat3p ) ErrorExit( "Cannot open hat4." ); for( i=0; inext ) { fprintf( hat3p, "%d %d %d %6.3f %d %d %d %d %p nokori=%d ext=%d\n", i, j, tmpptr->overlapaa, tmpptr->opt * 5.8 / 600, tmpptr->start1, tmpptr->end1, tmpptr->start2, tmpptr->end2, tmpptr->next, tmpptr->nokori, tmpptr->extended ); fflush( hat3p ); if( tmpptr->opt == -1.0 ) continue; } } } fclose( hat3p ); fprintf( stderr, "done.\n" ); #endif } FreeDoubleMtx( len ); FreeDoubleMtx( iscore ); for( i=0; inext ) { free( (void *)tmppt1 ); tmppt1 = tmppt2; } free( (void *)tmppt1 ); } free( (void *)(localhomtable[i]+j) ); } free( (void *)localhomtable ); } #endif fprintf( trap_g, "done.\n" ); fclose( trap_g ); writePre( njob, name, nlen, aseq, !contin ); #if 0 writeData( stdout, njob, name, nlen, aseq ); #endif #if IODEBUG fprintf( stderr, "OSHIMAI\n" ); #endif if( constraint ) FreeLocalHomTable( localhomtable, njob ); SHOWVERSION; return( 0 ); }