Skip to content
Commits on Source (4)
......@@ -5,6 +5,9 @@
#define XXXXXXX 0
#define USE_PENALTY_EX 1
#define TERMGAPFAC 0.0
#define TERMGAPFAC_EX 0.0
#if 1
static void match_calc_mtx( double **mtx, double *match, char **s1, char **s2, int i1, int lgth2 )
{
......@@ -37,7 +40,9 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
gap = newgapstr;
lgth1 = strlen( seq1[0] );
lgth2 = strlen( seq2[0] );
double wm;
double wm, g;
double fpenalty = (double)penalty;
double fpenalty_ex = (double)penalty_ex;
#if 0
......@@ -56,11 +61,41 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
ijp[0][j] = -( j + 1 );
}
// if( tailgp == 1 || ijp[lgth1][lgth2] >= warpbase )
if( tailgp == 1 )
;
else
{
#if 1
// reporterr( "lastverticalw[lgth1-1] = %f\n", lastverticalw[lgth1-1] );
// reporterr( "lasthorizontalw[lgth2-1] = %f\n", lasthorizontalw[lgth2-1] );
wm = lasthorizontalw[lgth2-1] - 1.0; // lasthorizontalw[lgth2-1] yori kanarazu chiisai.
for( j=lgth2-2; j>=0; j-- )
{
if( (g=lasthorizontalw[j]+ ( fpenalty * TERMGAPFAC + fpenalty_ex * (lgth2-1-j) * TERMGAPFAC_EX ) ) > wm )
{
wm = g;
iin = lgth1-1; jin = j;
ijp[lgth1][lgth2] = -( lgth2 - j );
}
}
for( i=lgth1-2; i>=0; i-- )
{
if( ( g=lastverticalw[i]+ ( fpenalty * TERMGAPFAC + fpenalty_ex * (lgth1-1-i) * TERMGAPFAC_EX ) ) > wm )
{
wm = g;
iin = i; jin = lgth2-1;
ijp[lgth1][lgth2] = +( lgth1 - i );
}
}
if( lasthorizontalw[lgth2-1] > wm ) // score ga onaji baai erabarenai
{
wm = lasthorizontalw[lgth2-1];
iin = lgth1-1; jin = lgth2-1;
ijp[lgth1][lgth2] = 0;
}
#else
wm = lastverticalw[0];
for( i=0; i<lgth1; i++ )
{
......@@ -80,6 +115,7 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
ijp[lgth1][lgth2] = -( lgth2 - j );
}
}
#endif
}
......@@ -158,19 +194,20 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
// fprintf( stderr, "%s\n", mseq1[0] );
// fprintf( stderr, "%s\n", mseq2[0] );
return( 0.0 );
return( wm );
}
double G__align11( double **n_dynamicmtx, char **seq1, char **seq2, int alloclen, int headgp, int tailgp )
{
// int k;
register int i, j;
int lasti; /* outgap == 0 -> lgth1, outgap == 1 -> lgth1+1 */
int lastj;
int lgth1, lgth2;
int resultlen;
double wm; /* int ?????? */
double wm, wmo; /* int ?????? */
double g;
double *currentw, *previousw;
double fpenalty = (double)penalty;
......@@ -178,6 +215,7 @@ double G__align11( double **n_dynamicmtx, char **seq1, char **seq2, int alloclen
double fpenalty_tmp;
#if USE_PENALTY_EX
double fpenalty_ex = (double)penalty_ex;
double fpenalty_ex_i;
#endif
#if 1
double *wtmp;
......@@ -428,13 +466,41 @@ double G__align11( double **n_dynamicmtx, char **seq1, char **seq2, int alloclen
for( i=1; i<lgth1+1; i++ )
{
initverticalw[i] += fpenalty;
#if USE_PENALTY_EX
// initverticalw[i] += fpenalty_ex * i; // ato de fukkatsu
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
currentw[j] += fpenalty;
#if USE_PENALTY_EX
// currentw[j] += fpenalty_ex * j; // ato de fukkatsu
// reporterr( "added _ex\n" );
#endif
}
}
else
{
for( i=1; i<lgth1+1; i++ )
{
initverticalw[i] += fpenalty * TERMGAPFAC;
#if USE_PENALTY_EX // 2018/Apr/22
initverticalw[i] += fpenalty_ex * i * TERMGAPFAC_EX;
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
currentw[j] += fpenalty * TERMGAPFAC;
#if USE_PENALTY_EX // 2018/Apr/22
currentw[j] += fpenalty_ex * j * TERMGAPFAC_EX;
// reporterr( "added _ex\n" );
#endif
}
}
for( j=1; j<lgth2+1; ++j )
{
m[j] = currentw[j-1]; mp[j] = 0;
......@@ -510,6 +576,9 @@ fprintf( stderr, "\n" );
warpjpt = warpj + 1;
}
if( i < lgth1 ) fpenalty_ex_i = fpenalty_ex;
else fpenalty_ex_i = 0.0; // 2018/May/11
for( j=1; j<lastj; j++ )
{
......@@ -528,12 +597,14 @@ fprintf( stderr, "\n" );
*ijppt = -( j - mpi );
}
if( (g=*prept) >= mi )
// if( (g=*prept) > mi )
{
mi = g;
mpi = j-1;
}
#if USE_PENALTY_EX
mi += fpenalty_ex;
mi += fpenalty_ex_i;
// mi += fpenalty_ex;
#endif
#if 0
......@@ -545,11 +616,13 @@ fprintf( stderr, "\n" );
*ijppt = +( i - *mpjpt );
}
if( (g=*prept) >= *mjpt )
// if( (g=*prept) > *mjpt )
{
*mjpt = g;
*mpjpt = i-1;
}
#if USE_PENALTY_EX
if( j < lgth2 ) // 2018/May/11
m[j] += fpenalty_ex;
#endif
#if 1
......@@ -647,6 +720,7 @@ fprintf( stderr, "\n" );
}
}
if( trywarp )
{
// fprintf( stderr, "\nwm = %f\n", wm );
......@@ -659,7 +733,10 @@ fprintf( stderr, "\n" );
free( prevwarpj );
}
Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, tailgp, warpis, warpjs, warpbase );
wmo = Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, tailgp, warpis, warpjs, warpbase );
if( !tailgp ) wm = wmo;
// reporterr( "wm (after tracking) = %f\n", wm );
if( warpis ) free( warpis );
if( warpjs ) free( warpjs );
......@@ -698,6 +775,7 @@ double G__align11_noalign( double **n_dynamicmtx, int penal, int penal_ex, char
double fpenalty = (double)penal;
#if USE_PENALTY_EX
double fpenalty_ex = (double)penal_ex;
double fpenalty_ex_i;
#endif
#if 1
double *wtmp;
......@@ -831,10 +909,18 @@ double G__align11_noalign( double **n_dynamicmtx, int penal, int penal_ex, char
for( i=1; i<lgth1+1; i++ )
{
initverticalw[i] += fpenalty;
#if USE_PENALTY_EX // 2018/Apr/23
// initverticalw[i] += fpenalty_ex * i; // ato de fukkatsu
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
currentw[j] += fpenalty;
#if USE_PENALTY_EX // 2018/Apr/23
// currentw[j] += fpenalty_ex * j; // ato de fukkatsu
// reporterr( "added _ex\n" );
#endif
}
}
......@@ -901,6 +987,10 @@ fprintf( stderr, "\n" );
mjpt = m + 1;
prept = previousw;
curpt = currentw + 1;
if( i < lgth1 ) fpenalty_ex_i = fpenalty_ex;
else fpenalty_ex_i = 0.0; // 2018/May/11
for( j=1; j<lgth2+1; j++ )
{
wm = *prept;
......@@ -915,12 +1005,13 @@ fprintf( stderr, "\n" );
{
wm = g;
}
if( (g=*prept) >= mi )
// if( (g=*prept) >= mi )
if( (g=*prept) > mi ) // onaji hazu
{
mi = g;
}
#if USE_PENALTY_EX
mi += fpenalty_ex;
mi += fpenalty_ex_i;
#endif
#if 0
......@@ -930,11 +1021,13 @@ fprintf( stderr, "\n" );
{
wm = g;
}
if( (g=*prept) >= *mjpt )
// if( (g=*prept) >= *mjpt )
if( (g=*prept) > *mjpt ) // onaji hazu
{
*mjpt = g;
}
#if USE_PENALTY_EX
if( j < lgth2 ) // 2018/May/11
m[j] += fpenalty_ex;
#endif
......@@ -952,7 +1045,7 @@ fprintf( stderr, "\n" );
fprintf( stderr, "\n" );
fprintf( stderr, ">\n%s\n", mseq1[0] );
fprintf( stderr, ">\n%s\n", mseq2[0] );
fprintf( stderr, "wm = %f\n", wm );
fprintf( stderr, "wm (noalign) = %f\n", wm );
#endif
return( wm );
......
......@@ -9,6 +9,9 @@
#define FASTMATCHCALC 1
#define SLOW 0
#define TERMGAPFAC 0.0
#define TERMGAPFAC_EX 0.0
static TLS double **impmtx = NULL;
static TLS int impalloclen = 0;
......@@ -872,6 +875,38 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
;
else
{
#if 1
double fpenalty = (double)penalty;
double fpenalty_ex = (double)penalty_ex;
double g;
// reporterr( "in S, lastverticalw[lgth1-1] = %f\n", lastverticalw[lgth1-1] );
// reporterr( "in S, lasthorizontalw[lgth2-1] = %f\n", lasthorizontalw[lgth2-1] );
wm = lasthorizontalw[lgth2-1] - 1.0; // lasthorizontalw[lgth2-1] yori kanarazu chiisai.
for( j=lgth2-2; j>=0; j-- )
{
if( (g=lasthorizontalw[j]+ ( fpenalty * TERMGAPFAC + fpenalty_ex * (lgth2-1-j) * TERMGAPFAC_EX ) ) > wm )
{
wm = g;
iin = lgth1-1; jin = j;
ijp[lgth1][lgth2] = -( lgth2 - j );
}
}
for( i=lgth1-2; i>=0; i-- )
{
if( ( g=lastverticalw[i]+ ( fpenalty * TERMGAPFAC + fpenalty_ex * (lgth1-1-i) * TERMGAPFAC_EX ) ) > wm )
{
wm = g;
iin = i; jin = lgth2-1;
ijp[lgth1][lgth2] = +( lgth1 - i );
}
}
if( lasthorizontalw[lgth2-1] > wm ) // score ga onaji baai erabarenai
{
wm = lasthorizontalw[lgth2-1];
iin = lgth1-1; jin = lgth2-1;
ijp[lgth1][lgth2] = 0;
}
#else
wm = lastverticalw[0];
for( i=0; i<lgth1; i++ )
{
......@@ -891,6 +926,7 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
ijp[lgth1][lgth2] = -( lgth2 - j );
}
}
#endif
}
for( i=0; i<lgth1+1; i++ )
......@@ -1027,7 +1063,7 @@ static double Atracking( double *lasthorizontalw, double *lastverticalw,
*gt2 = gaptable2;
}
return( 0.0 );
return( wm );
}
double A__align( double **n_dynamicmtx, char **seq1, char **seq2, double *eff1, double *eff2, int icyc, int jcyc, int alloclen, int constraint, double *impmatch, char *sgap1, char *sgap2, char *egap1, char *egap2, int *chudanpt, int chudanref, int *chudanres, int headgp, int tailgp, int firstmem, int calledbyfulltreebase, double **cpmxchild0, double **cpmxchild1, double ***cpmxresult, double orieff1, double orieff2 )
......@@ -1046,6 +1082,7 @@ double A__align( double **n_dynamicmtx, char **seq1, char **seq2, double *eff1,
int lgth1, lgth2;
int resultlen;
double wm = 0.0; /* int ?????? */
double wmo = 0.0;
double g;
double *currentw, *previousw;
// double fpenalty = (double)penalty;
......@@ -1663,20 +1700,48 @@ double A__align( double **n_dynamicmtx, char **seq1, char **seq2, double *eff1,
imp_match_calc( n_dynamicmtx, currentw, icyc, jcyc, lgth1, lgth2, seq1, seq2, eff1, eff2, localhom, 1, 0 );
#endif
if( headgp == 1 )
{
for( i=1; i<lgth1+1; i++ )
{
// initverticalw[i] += ( ogcp1[0] + fgcp1[i-1] ) ;
initverticalw[i] += ( ogcp1[0] * headgapfreq2 + fgcp1[i-1] * gapfreq2pt[0] ) ;
#if USE_PENALTY_EX // 2018/Apr/23
initverticalw[i] += fpenalty_ex * i;
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
// currentw[j] += ( ogcp2[0] + fgcp2[j-1] ) ;
currentw[j] += ( ogcp2[0] * headgapfreq1 + fgcp2[j-1] * gapfreq1pt[0] ) ;
#if USE_PENALTY_EX // 2018/Apr/23
currentw[j] += fpenalty_ex * j;
// reporterr( "added _ex\n" );
#endif
}
}
else
{
for( i=1; i<lgth1+1; i++ )
{
initverticalw[i] += fpenalty * TERMGAPFAC; // motto tanjun de yoi?
#if USE_PENALTY_EX // 2018/Apr/22
initverticalw[i] += fpenalty_ex * i * TERMGAPFAC_EX;
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
currentw[j] += fpenalty * TERMGAPFAC; // motto tanjun de yoi?
#if USE_PENALTY_EX // 2018/Apr/22
currentw[j] += fpenalty_ex * j * TERMGAPFAC_EX;
// reporterr( "added _ex\n" );
#endif
}
}
#if OUTGAP0TRY
else
{
......@@ -1687,6 +1752,8 @@ double A__align( double **n_dynamicmtx, char **seq1, char **seq2, double *eff1,
initverticalw[i] -= offset * i / 2.0;
}
#endif
#if 0
fprintf( stderr, "\n " );
for( j=0; j<lgth2+1; j++ ) fprintf( stderr, " %c ", seq2[0][j] );
......@@ -1843,6 +1910,7 @@ fprintf( stderr, "\n" );
// fprintf( stderr, "Jump to %d (%c)!", mpi, seq2[0][mpi] );
}
if( (g=*prept+*ogcp2pt*gf1vapre) >= mi )
// if( (g=*prept+*ogcp2pt*gf1vapre) > mi )
{
mi = g;
mpi = j-1;
......@@ -1862,6 +1930,7 @@ fprintf( stderr, "\n" );
// fprintf( stderr, "Jump to %d (%c)!", *mpjpt, seq1[0][*mpjpt] );
}
if( (g=*prept+ ogcp1va* *gf2ptpre) >= *mjpt )
// if( (g=*prept+ ogcp1va* *gf2ptpre) > *mjpt )
{
*mjpt = g;
*mpjpt = i-1;
......@@ -1980,10 +2049,13 @@ fprintf( stderr, "\n" );
}
else
{
// Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, reuseprofiles, eff1, eff2, cpmxresult, cpmx1pt, cpmx2pt, gapfreq1pt, gapfreq2pt, ogcp1opt, ogcp2opt, fgcp1opt, fgcp2opt, orieff1, orieff2, (cpmx1pt!=cpmx1), (cpmx2pt!=cpmx2) );
Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, reuseprofiles, &gt1, &gt2 );
// wmo = Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, reuseprofiles, eff1, eff2, cpmxresult, cpmx1pt, cpmx2pt, gapfreq1pt, gapfreq2pt, ogcp1opt, ogcp2opt, fgcp1opt, fgcp2opt, orieff1, orieff2, (cpmx1pt!=cpmx1), (cpmx2pt!=cpmx2) );
wmo = Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, reuseprofiles, &gt1, &gt2 );
if( !tailgp ) wm = wmo;
}
// reporterr( "wm = %f\n", wm );
#if 1
if( cpmxresult )
{
......@@ -2134,6 +2206,7 @@ double A__align_variousdist( int **which, double ***matrices, double **n_dynamic
int lgth1, lgth2;
int resultlen;
double wm = 0.0; /* int ?????? */
double wmo = 0.0; /* int ?????? */
double g;
double *currentw, *previousw;
// double fpenalty = (double)penalty;
......@@ -2610,13 +2683,42 @@ double A__align_variousdist( int **which, double ***matrices, double **n_dynamic
{
// initverticalw[i] += ( ogcp1[0] + fgcp1[i-1] ) ;
initverticalw[i] += ( ogcp1[0] * headgapfreq2 + fgcp1[i-1] * gapfreq2[0] ) ;
#if USE_PENALTY_EX // 2018/Apr/23
initverticalw[i] += fpenalty_ex * i;
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
// currentw[j] += ( ogcp2[0] + fgcp2[j-1] ) ;
currentw[j] += ( ogcp2[0] * headgapfreq1 + fgcp2[j-1] * gapfreq1[0] ) ;
#if USE_PENALTY_EX // 2018/Apr/23
currentw[j] += fpenalty_ex * j;
// reporterr( "added _ex\n" );
#endif
}
}
else
{
for( i=1; i<lgth1+1; i++ )
{
initverticalw[i] += fpenalty * TERMGAPFAC; // motto tanjun de yoi?
#if USE_PENALTY_EX // 2018/Apr/22
initverticalw[i] += fpenalty_ex * i * TERMGAPFAC_EX;
// reporterr( "added _ex\n" );
#endif
}
for( j=1; j<lgth2+1; j++ )
{
currentw[j] += fpenalty * TERMGAPFAC; // motto tanjun de yoi?
#if USE_PENALTY_EX // 2018/Apr/22
currentw[j] += fpenalty_ex * j * TERMGAPFAC_EX;
// reporterr( "added _ex\n" );
#endif
}
}
#if OUTGAP0TRY
else
{
......@@ -2806,6 +2908,7 @@ fprintf( stderr, "\n" );
// fprintf( stderr, "Jump to %d (%c)!", mpi, seq2[0][mpi] );
}
if( (g=*prept+*ogcp2pt*gf1vapre) >= mi )
// if( (g=*prept+*ogcp2pt*gf1vapre) > mi )
{
mi = g;
mpi = j-1;
......@@ -2825,6 +2928,7 @@ fprintf( stderr, "\n" );
// fprintf( stderr, "Jump to %d (%c)!", *mpjpt, seq1[0][*mpjpt] );
}
if( (g=*prept+ ogcp1va* *gf2ptpre) >= *mjpt )
// if( (g=*prept+ ogcp1va* *gf2ptpre) > *mjpt )
{
*mjpt = g;
*mpjpt = i-1;
......@@ -2935,8 +3039,11 @@ fprintf( stderr, "\n" );
Atracking_localhom( impmatch, currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, warpis, warpjs, warpbase, &ngap1, &ngap2, 0, NULL, NULL );
}
else
{
// Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0.0, 0.0, 1, 1 ); // NULL x 11 ha atode awaseru.
Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, 0, NULL, NULL);
wmo = Atracking( currentw, lastverticalw, seq1, seq2, mseq1, mseq2, ijp, icyc, jcyc, tailgp, warpis, warpjs, warpbase, &ngap1, &ngap2, 0, NULL, NULL);
if( !tailgp ) wm = wmo;
}
if( warpis ) free( warpis );
if( warpjs ) free( warpjs );
......
......@@ -367,6 +367,7 @@ static void overridematrix( double **matrix )
}
reporterr( "Score(%c=0x%x,%c=0x%x)=%f\n", i1, i1, i2, i2, v );
matrix[i1][i2] = v;
matrix[i2][i1] = v; // 2018/May/11
}
}
......
......@@ -714,6 +714,12 @@ void constants( int nseq, char **seq )
fprintf( stdout, "####### average1 = %f\n", average );
#endif
if( average < 0.0 )
{
reporterr( "\nUnrealistic scoring matrix. Give larger positive values to matches (A/A, B/B, etc).\n\n" );
exit( 1 );
}
for( i=0; i<nalphabets; i++ ) for( j=0; j<nalphabets; j++ )
n_distmp[i][j] *= 600.0 / average;
#if TEST
......
......@@ -1460,7 +1460,6 @@ static void *treebasethread( void *arg )
pthread_cond_wait( targ->treecond, targ->mutex ); // tabun iranai
(*nrunpt)++;
// moved, 20187/Mar/10
m1 = topol[l][0][0];
m2 = topol[l][1][0];
#if 0
......@@ -1503,7 +1502,7 @@ static void *treebasethread( void *arg )
}
#endif
// moved, 2018/Mar/10. Must be after changing memhist[l]
if( mergeoralign[l] == 'n' )
{
// reporterr( "SKIP!\n" );
......@@ -1514,6 +1513,8 @@ static void *treebasethread( void *arg )
// free( topol[l][1] ); topol[l][1] = NULL;
// free( topol[l] ); topol[l] = NULL;
pthread_mutex_unlock( targ->mutex );
free( localmem[0] );
free( localmem[1] );
continue;
}
......@@ -1975,6 +1976,8 @@ static int treebase( int *nlen, char **aseq, int nadd, char *mergeoralign, char
// free( topol[l][0] ); topol[l][0] = NULL;
// free( topol[l][1] ); topol[l][1] = NULL;
// free( topol[l] ); topol[l] = NULL;
free( localmem[0] );
free( localmem[1] );
continue;
}
......
......@@ -422,4 +422,4 @@ extern void sortbylength( int *uselh, Lennum *in, int size, unsigned long long n
extern void limitlh( int *uselh, Lennum *in, int size, int limit );
extern double distdp_noalign( char *s1, char *s2, double selfscore1, double selfscore2, int alloclen ); // tbfast.c kara yobareru
extern int getweightfromname( int n, double *w, char **name );
extern void getweightfromname( int n, double *w, char **name );
......@@ -606,3 +606,4 @@ fprintf( stderr, "\n" );
return( maxwm );
}
......@@ -103,7 +103,7 @@ int main( int ac, char **av )
}
else if( c == 0x0d || c == 0x0a )
{
fprintf( stderr, "Warning: skipped 0x%x (CR or LF) that cannot be used in mafft --text.\n", c, c );
fprintf( stderr, "Warning: skipped 0x%x (CR or LF) that cannot be used in mafft --text.\n", c );
//printf( "%c", c );
}
else if( c == 0x20 || c == 0x3E || c == 0x3C || c == 0x3D )
......
......@@ -6095,7 +6095,7 @@ int uselhin( FILE *fp, int n, int *uselh )
return( 1 );
}
int getweightfromname( int n, double *w, char **name )
void getweightfromname( int n, double *w, char **name )
{
int i;
int res;
......
#! /bin/bash
er=0;
myself=`dirname "$0"`/`basename "$0"`; export myself
version="v7.397 (2018/Apr/16)"; export version
version="v7.402 (2018/May/23)"; export version
LANG=C; export LANG
os=`uname`
progname=`basename "$0"`
......@@ -181,6 +181,7 @@ kappa=$defaultkappa
sbstmodel=$defaultsbstmodel
fmodel=$defaultfmodel
nmodel=" "
gexp=0
gop=$defaultgop
gopdist=$defaultgop
aof=$defaultaof
......@@ -807,6 +808,16 @@ if [ $# -gt 0 ]; then
exit
fi
shiftpenaltyspecified=1
elif [ "$1" = "--exp" ]; then
shift
# gexp="$1"
tmpval="$1"
gexp=`awk "BEGIN{ print -1.0 * \"$tmpval\"}"`
if ! expr "$gexp" : "[0-9\-]" > /dev/null ; then
printf "\nSpecify a number for exp, like --exp 0.1\n" 1>&2
printf "'$1' cannot be interpreted as a number..\n\n" 1>&2
exit
fi
elif [ "$1" = "--ep" ]; then
shift
# aof="$1"
......@@ -2423,7 +2434,7 @@ function removetmpfile() { # for MPI
if [ $fragment -ne 0 ]; then
"$prefix/addsingle" -Q 100 $legacygapopt -W $tuplesize -O $outnum $addsinglearg $addarg $add2ndhalfarg -C $numthreads $memopt $weightopt $treeinopt $treeoutopt $distoutopt $seqtype $model -f "-"$gop -h $aof $param_fft $localparam $algopt $treealg $scoreoutarg < infile > /dev/null 2>>"$progressfile" || exit 1
else
"$prefix/disttbfast" -q $npickup -E $cycledisttbfast -V "-"$gopdist -s $unalignlevel $legacygapopt $mergearg -W $tuplesize $termgapopt $outnum $addarg $add2ndhalfarg -C $numthreads-$numthreadstb $memopt $weightopt $treeinopt $treeoutopt $distoutopt $seqtype $model -f "-"$gop -Q $spfactor -h $aof $param_fft $algopt $treealg $scoreoutarg < infile > pre 2>>"$progressfile" || exit 1
"$prefix/disttbfast" -q $npickup -E $cycledisttbfast -V "-"$gopdist -s $unalignlevel $legacygapopt $mergearg -W $tuplesize $termgapopt $outnum $addarg $add2ndhalfarg -C $numthreads-$numthreadstb $memopt $weightopt $treeinopt $treeoutopt $distoutopt $seqtype $model -g $gexp -f "-"$gop -Q $spfactor -h $aof $param_fft $algopt $treealg $scoreoutarg < infile > pre 2>>"$progressfile" || exit 1
mv hat3.seed hat3
fi
fi
......
......@@ -35,7 +35,7 @@
#define VERSION "7.397"
#define VERSION "7.402"
#define SHOWVERSION reporterr( "%s (%s) Version " VERSION "\nalg=%c, model=%s, amax=%3.1f\n%d thread(s)\n\n", progName( argv[0] ), (dorp=='d')?"nuc":((nblosum==-2)?"text":"aa"), alg, modelname, specificityconsideration, nthread )
#define FFT_THRESHOLD 80
......
......@@ -3067,6 +3067,7 @@ void fixed_supg_double_realloc_nobk_halfmtx_treeout_constrained( int nseq, doubl
int *testtopol, **inconsistent;
int **inconsistentpairlist;
int ninconsistentpairs;
int maxinconsistentpairs;
int *warned;
int allinconsistent;
int firsttime;
......@@ -3158,6 +3159,7 @@ void fixed_supg_double_realloc_nobk_halfmtx_treeout_constrained( int nseq, doubl
reporterr( "\n" );
ninconsistentpairs = 0;
maxinconsistentpairs = 1; // inconsistentpairlist[0] dake allocate sareteirunode
for( k=0; k<nseq-1; k++ )
{
if( k % 10 == 0 ) reporterr( "\r% 5d / %d", k, nseq );
......@@ -3286,9 +3288,14 @@ void fixed_supg_double_realloc_nobk_halfmtx_treeout_constrained( int nseq, doubl
}
inconsistent[im][jm] = 1;
if( maxinconsistentpairs < ninconsistentpairs+1 )
{
inconsistentpairlist = realloc( inconsistentpairlist, (ninconsistentpairs+1)*sizeof( int * ) );
inconsistentpairlist[ninconsistentpairs] = malloc( sizeof( int ) * 2 );
reporterr( "reallocating inconsistentpairlist, size=%d\n", ninconsistentpairs+1 );
for( j=maxinconsistentpairs; j<ninconsistentpairs+1; j++ )
inconsistentpairlist[j] = malloc( sizeof( int ) * 2 );
maxinconsistentpairs = ninconsistentpairs+1;
reporterr( "Reallocated inconsistentpairlist, size=%d\n", maxinconsistentpairs );
}
inconsistentpairlist[ninconsistentpairs][0] = im;
inconsistentpairlist[ninconsistentpairs][1] = jm;
ninconsistentpairs++;
......@@ -3517,7 +3524,8 @@ void fixed_supg_double_realloc_nobk_halfmtx_treeout_constrained( int nseq, doubl
free( nearest );
free( testtopol );
FreeIntMtx( inconsistent );
FreeIntMtx( inconsistentpairlist );
for( i=0; i<maxinconsistentpairs; i++ ) free( inconsistentpairlist[i] );
free( inconsistentpairlist );
free( warned );
}
......@@ -7165,6 +7173,7 @@ void fixed_supg_double_treeout_constrained( int nseq, double **eff, int ***topol
int *testtopol, **inconsistent;
int **inconsistentpairlist;
int ninconsistentpairs;
int maxinconsistentpairs;
int *warned;
int allinconsistent;
int firsttime;
......@@ -7308,6 +7317,7 @@ void fixed_supg_double_treeout_constrained( int nseq, double **eff, int ***topol
reporterr( "\n" );
ninconsistentpairs = 0;
maxinconsistentpairs = 1; // inconsistentpairlist[0] dake allocate sareteirunode
for( k=0; k<nseq-1; k++ )
{
if( k % 10 == 0 ) reporterr( "\r% 5d / %d", k, nseq );
......@@ -7437,8 +7447,14 @@ void fixed_supg_double_treeout_constrained( int nseq, double **eff, int ***topol
}
inconsistent[im][jm] = 1;
if( maxinconsistentpairs < ninconsistentpairs+1 )
{
inconsistentpairlist = realloc( inconsistentpairlist, (ninconsistentpairs+1)*sizeof( int * ) );
inconsistentpairlist[ninconsistentpairs] = malloc( sizeof( int ) * 2 );
for( j=maxinconsistentpairs; j<ninconsistentpairs+1; j++ )
inconsistentpairlist[j] = malloc( sizeof( int ) * 2 );
maxinconsistentpairs = ninconsistentpairs+1;
reporterr( "Reallocated inconsistentpairlist, size=%d\n", maxinconsistentpairs );
}
inconsistentpairlist[ninconsistentpairs][0] = im;
inconsistentpairlist[ninconsistentpairs][1] = jm;
ninconsistentpairs++;
......@@ -7671,7 +7687,8 @@ void fixed_supg_double_treeout_constrained( int nseq, double **eff, int ***topol
free( nearest );
free( testtopol );
FreeIntMtx( inconsistent );
FreeIntMtx( inconsistentpairlist );
for( i=0; i<maxinconsistentpairs; i++ ) free( inconsistentpairlist[i] );
free( inconsistentpairlist );
free( warned );
}
......
......@@ -1061,11 +1061,17 @@ double partA__align( char **seq1, char **seq2, double *eff1, double *eff2, int i
{
// initverticalw[i] += ( ogcp1[0] + fgcp1[i-1] ) ;
initverticalw[i] += ( ogcp1[0] * headgapfreq2 + fgcp1[i-1] * gapfreq2[0] ) ;
#if USE_PENALTY_EX
tsuika hitsuyou
#endif
}
for( j=1; j<lgth2+1; j++ )
{
// currentw[j] += ( ogcp2[0] + fgcp2[j-1] ) ;
currentw[j] += ( ogcp2[0] * headgapfreq1 + fgcp2[j-1] * gapfreq1[0] ) ;
#if USE_PENALTY_EX
tsuika hitsuyou
#endif
}
}
#if OUTGAP0TRY
......@@ -1208,7 +1214,8 @@ fprintf( stderr, "\n" );
*ijppt = -( j - mpi );
}
// g = *prept + *ogcp2pt * gapfreq1[i-1];
if( (g = *prept + *ogcp2pt * gf1vapre) >= mi )
// if( (g = *prept + *ogcp2pt * gf1vapre) >= mi )
if( (g = *prept + *ogcp2pt * gf1vapre) > mi ) // 2018/Apr
{
mi = g;
mpi = j-1;
......@@ -1224,7 +1231,8 @@ fprintf( stderr, "\n" );
*ijppt = +( i - *mpjpt );
}
// g = *prept + ogcp1va * gapfreq2[j-1];
if( (g = *prept + ogcp1va * *gf2ptpre) >= *mjpt )
// if( (g = *prept + ogcp1va * *gf2ptpre) >= *mjpt )
if( (g = *prept + ogcp1va * *gf2ptpre) > *mjpt ) // 2018/Apr
{
*mjpt = g;
*mpjpt = i-1;
......@@ -1785,11 +1793,17 @@ double partA__align_variousdist( int **which, double ***matrices, double **n_dyn
{
// initverticalw[i] += ( ogcp1[0] + fgcp1[i-1] ) ;
initverticalw[i] += ( ogcp1[0] * headgapfreq2 + fgcp1[i-1] * gapfreq2[0] ) ;
#if USE_PENALTY_EX
tsuika hitsuyou
#endif
}
for( j=1; j<lgth2+1; j++ )
{
// currentw[j] += ( ogcp2[0] + fgcp2[j-1] ) ;
currentw[j] += ( ogcp2[0] * headgapfreq1 + fgcp2[j-1] * gapfreq1[0] ) ;
#if USE_PENALTY_EX
tsuika hitsuyou
#endif
}
}
#if OUTGAP0TRY
......@@ -1944,7 +1958,8 @@ fprintf( stderr, "\n" );
*ijppt = -( j - mpi );
}
// g = *prept + *ogcp2pt * gapfreq1[i-1];
if( (g = *prept + *ogcp2pt * gf1vapre) >= mi )
// if( (g = *prept + *ogcp2pt * gf1vapre) >= mi )
if( (g = *prept + *ogcp2pt * gf1vapre) > mi ) // 2018/Apr
{
mi = g;
mpi = j-1;
......@@ -1960,7 +1975,8 @@ fprintf( stderr, "\n" );
*ijppt = +( i - *mpjpt );
}
// g = *prept + ogcp1va * gapfreq2[j-1];
if( (g = *prept + ogcp1va * *gf2ptpre) >= *mjpt )
// if( (g = *prept + ogcp1va * *gf2ptpre) >= *mjpt )
if( (g = *prept + ogcp1va * *gf2ptpre) > *mjpt ) // 2018/Apr
{
*mjpt = g;
*mpjpt = i-1;
......
......@@ -956,6 +956,8 @@ static void *treebasethread( void *arg ) // seed && compacttree==3 niha taioushi
// free( topol[l][1] );
// free( topol[l] );
pthread_mutex_unlock( targ->mutex );
// free( localmem[0] );
// free( localmem[1] );
continue;
}
......@@ -1397,13 +1399,15 @@ void treebase( int *nlen, char **aseq, int nadd, char *mergeoralign, char **mseq
}
#endif
// moved, 2018/Mar/10
// moved, 2018/Mar/10. Must be after changing memhist[l]
if( mergeoralign[l] == 'n' )
{
// fprintf( stderr, "SKIP!\n" );
// free( topol[l][0] );
// free( topol[l][1] );
// free( topol[l] );
free( localmem[0] );
free( localmem[1] );
continue;
}
......
mafft (7.402-1) unstable; urgency=medium
* New upstream version
-- Andreas Tille <tille@debian.org> Mon, 28 May 2018 16:17:10 +0200
mafft (7.397-1) unstable; urgency=medium
[ Steffen Moeller ]
......
-----------------------------------------------------------------------
MAFFT: a multiple sequence alignment program
version 7.397, 2018/Apr/16
version 7.402, 2018/May/23
http://mafft.cbrc.jp/alignment/software/
katoh@ifrec.osaka-u.ac.jp
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.