5 static int treeout = 0;
8 void arguments( int argc, char *argv[] )
19 ppenalty = NOTSPECIFIED; //?
20 ppenalty_ex = NOTSPECIFIED; //?
21 poffset = NOTSPECIFIED; //?
22 kimuraR = NOTSPECIFIED;
25 while( --argc > 0 && (*++argv)[0] == '-' )
27 while ( (c = *++argv[0]) )
45 fprintf( stderr, "inputfile = %s\n", inputfile );
55 fprintf( stderr, "options: Check source file !\n" );
60 int main( int argc, char **argv )
64 static char name[M][B];
70 float ssi, ssj, bunbo;
73 arguments( argc, argv );
77 infp = fopen( inputfile, "r" );
80 fprintf( stderr, "Cannot open %s\n", inputfile );
88 PreRead( stdin, &njob, &nlenmax );
94 seq = AllocateCharMtx( njob, nlenmax+1 );
95 mtx = AllocateDoubleMtx( njob, njob );
96 selfscore = AllocateFloatVec( njob );
99 FRead( stdin, name, nlen, seq );
101 readData( infp, name, nlen, seq );
105 constants( njob, seq );
108 for( i=0; i<njob-1; i++ )
110 fprintf( stderr, "%4d/%4d\r", i+1, njob );
111 for( j=i+1; j<njob; j++ )
112 mtx[i][j] = (double)substitution_hosei( seq[i], seq[j] );
113 // fprintf( stderr, "i=%d,j=%d, l=%d &&& %f\n", i, j, nlen[0], mtx[i][j] );
116 for( i=0; i<njob; i++ )
118 selfscore[i] = (float)naivepairscore11( seq[i], seq[i], penalty );
121 for( i=0; i<njob-1; i++ )
124 fprintf( stderr, "%4d/%4d\r", i+1, njob );
125 for( j=i+1; j<njob; j++ )
128 bunbo = MIN( ssi, ssj );
132 mtx[i][j] = 1.0 - (double)naivepairscore11( seq[i], seq[j], penalty ) / bunbo;
133 // mtx[i][j] = 1.0 - (double)naivepairscore11( seq[i], seq[j], penalty ) / MIN( selfscore[i], selfscore[j] );
134 // fprintf( stderr, "i=%d,j=%d, l=%d### %f, score = %d\n", i, j, nlen[0], mtx[i][j], naivepairscore11( seq[i], seq[j], penalty ) );
140 for( i=0; i<njob-1; i++ ) for( j=i+1; j<njob; j++ )
141 fprintf( stdout, "i=%d, j=%d, mtx[][] = %f\n", i, j, mtx[i][j] );
144 fp = fopen( "hat2", "w" );
145 WriteHat2( fp, njob, name, mtx );
153 topol = AllocateIntCub( njob, 2, njob );
154 len = AllocateDoubleMtx( njob, njob );
155 veryfastsupg_double_outtree( njob, mtx, topol, len );
161 res = system( ALNDIR "/spgsdl < hat2" );