8 void arguments( int argc, char *argv[] )
17 ppenalty = NOTSPECIFIED;
18 ppenalty_ex = NOTSPECIFIED;
19 poffset = NOTSPECIFIED;
20 kimuraR = NOTSPECIFIED;
23 fftWinSize = NOTSPECIFIED;
24 fftThreshold = NOTSPECIFIED;
26 while( --argc > 0 && (*++argv)[0] == '-' )
28 while ( (c = *++argv[0]) )
33 ppenalty = (int)( atof( *++argv ) * 1000 - 0.5 );
34 fprintf( stderr, "ppenalty = %d\n", ppenalty );
38 ppenalty_ex = (int)( atof( *++argv ) * 1000 - 0.5 );
39 fprintf( stderr, "ppenalty_ex = %d\n", ppenalty_ex );
43 poffset = (int)( atof( *++argv ) * 1000 - 0.5 );
44 fprintf( stderr, "poffset = %d\n", poffset );
48 kimuraR = atoi( *++argv );
49 fprintf( stderr, "kimuraR = %d\n", kimuraR );
53 nblosum = atoi( *++argv );
55 fprintf( stderr, "blosum %d\n", nblosum );
59 pamN = atoi( *++argv );
61 fprintf( stderr, "jtt %d\n", pamN );
77 fprintf( stderr, "illegal option %c\n", c );
87 cut = atof( (*argv) );
92 fprintf( stderr, "options: Check source file !\n" );
95 if( tbitr == 1 && outgap == 0 )
97 fprintf( stderr, "conflicting options : o, m or u\n" );
100 if( alg == 'C' && outgap == 0 )
102 fprintf( stderr, "conflicting options : C, o\n" );
107 int main( int argc, char *argv[] )
110 static char name[M][B], **seq;
111 int i, j, alloclen, c;
117 arguments( argc, argv );
124 fprintf( stderr, "At least 2 sequences should be input!\n"
125 "Only %d sequence found.\n", njob );
129 seq = AllocateCharMtx( njob, nlenmax*9+1 );
130 mtx = AllocateDoubleMtx( njob, njob );
131 self = AllocateDoubleVec( njob );
132 alloclen = nlenmax*9;
134 readData( stdin, name, nlen, seq );
135 constants( njob, seq );
143 fprintf( stderr, "Illeagal character %c\n", c );
147 for( i=0; i<njob; i++ )
149 self[i] = (double)substitution_nid( seq[i], seq[i] );
150 // fprintf( stdout, "self[%d] = %f\n", i, self[i] );
153 for( i=0; i<njob-1; i++ )
154 for( j=i+1; j<njob; j++ )
156 tmpdouble = (double)substitution_score( seq[i], seq[j] );
157 // fprintf( stdout, "tmpdouble = %f\n", tmpdouble );
158 mtx[i][j] = ( 1.0 - tmpdouble / MIN( self[i], self[j] ) );
159 if( mtx[i][j] < 0.95 )
160 mtx[i][j] = - log( 1.0 - mtx[i][j] );
166 for( i=0; i<njob-1; i++ ) for( j=i+1; j<njob; j++ )
167 fprintf( stdout, "i=%d, j=%d, mtx[][] = %f\n", i, j, mtx[i][j] );
170 fp = fopen( "hat2", "w" );
171 WriteHat2( fp, njob, name, mtx );