X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=binaries%2Fsrc%2Fmafft%2Fcore%2Fdvtditr.c;h=a25890204b2b78736c0d56391da414043f48fb75;hb=711ff37b582bf25ba17d553008c4bf06cbdb8c84;hp=54b44c6c5d9469b3b12015a4b09316498f200648;hpb=7c6018cf87e67d7ac21f5230284ef2162a19320f;p=jabaws.git diff --git a/binaries/src/mafft/core/dvtditr.c b/binaries/src/mafft/core/dvtditr.c index 54b44c6..a258902 100644 --- a/binaries/src/mafft/core/dvtditr.c +++ b/binaries/src/mafft/core/dvtditr.c @@ -5,9 +5,31 @@ extern char **seq_g; extern char **res_g; +static int subalignment; +static int subalignmentoffset; +static int specifictarget; static int intop; static int intree; +static double autosubalignment; + + +static void calcmaxdistclass( void ) +{ + int c; + double rep; + for( c=0; c 0 && (*++argv)[0] == '-' ) { @@ -85,7 +117,7 @@ void arguments( int argc, char *argv[] ) --argc; goto nextoption; case 'I': - niter = atoi( *++argv ); + niter = myatoi( *++argv ); fprintf( stderr, "niter = %d\n", niter ); --argc; goto nextoption; @@ -102,6 +134,15 @@ void arguments( int argc, char *argv[] ) // fprintf( stderr, "ppenalty = %d\n", ppenalty ); --argc; goto nextoption; + case 'Q': + penalty_shift_factor = atof( *++argv ); + if( penalty_shift_factor < 100.0 && penalty_shift_factor != 2.0 ) + { + fprintf( stderr, "%f, penalty_shift is fixed to penalty x 2 in the iterative refinement phase.\n", penalty_shift_factor ); + penalty_shift_factor = 2.0; + } + --argc; + goto nextoption; case 'g': ppenalty_ex = (int)( atof( *++argv ) * 1000 - 0.5 ); // fprintf( stderr, "ppenalty_ex = %d\n", ppenalty_ex ); @@ -113,25 +154,25 @@ void arguments( int argc, char *argv[] ) --argc; goto nextoption; case 'k': - kimuraR = atoi( *++argv ); + kimuraR = myatoi( *++argv ); fprintf( stderr, "kappa = %d\n", kimuraR ); --argc; goto nextoption; case 'b': - nblosum = atoi( *++argv ); + nblosum = myatoi( *++argv ); scoremtx = 1; fprintf( stderr, "blosum %d / kimura 200\n", nblosum ); --argc; goto nextoption; case 'j': - pamN = atoi( *++argv ); + pamN = myatoi( *++argv ); scoremtx = 0; TMorJTT = JTT; fprintf( stderr, "jtt/kimura %d\n", pamN ); --argc; goto nextoption; case 'm': - pamN = atoi( *++argv ); + pamN = myatoi( *++argv ); scoremtx = 0; TMorJTT = TM; fprintf( stderr, "tm %d\n", pamN ); @@ -152,12 +193,17 @@ void arguments( int argc, char *argv[] ) --argc; goto nextoption; case 'C': - nthread = atoi( *++argv ); + nthread = myatoi( *++argv ); fprintf( stderr, "nthread = %d\n", nthread ); --argc; goto nextoption; + case 'H': + subalignment = 1; + subalignmentoffset = myatoi( *++argv ); + --argc; + goto nextoption; case 't': - randomseed = atoi( *++argv ); + randomseed = myatoi( *++argv ); fprintf( stderr, "randomseed = %d\n", randomseed ); --argc; goto nextoption; @@ -175,12 +221,25 @@ void arguments( int argc, char *argv[] ) // exit( 1 ); --argc; goto nextoption; + case 's': + specificityconsideration = (double)myatof( *++argv ); +// fprintf( stderr, "specificityconsideration = %f\n", specificityconsideration ); + --argc; + goto nextoption; +#if 0 + case 'S' : + scoreout = 1; // for checking parallel calculation + break; +#else case 'S' : - scoreout = 1; + spscoreout = 1; // 2014/Dec/30, sp score break; +#endif +#if 0 case 's' : RNAscoremtx = 'r'; break; +#endif #if 1 case 'a': fmodel = 1; @@ -195,9 +254,11 @@ void arguments( int argc, char *argv[] ) case 'P': dorp = 'p'; break; +#if 0 case 'Q': alg = 'Q'; break; +#endif case 'R': rnaprediction = 'r'; break; @@ -231,16 +292,19 @@ void arguments( int argc, char *argv[] ) case 's' : treemethod = 's'; break; -#endif case 'H': alg = 'H'; break; +#endif case 'A': alg = 'A'; break; case 'M': alg = 'M'; break; + case '@': + alg = 'd'; + break; case 'F': use_fft = 1; break; @@ -261,15 +325,20 @@ void arguments( int argc, char *argv[] ) case 'J': utree = 0; break; +#if 0 case 'd': disp = 1; break; +#endif case 'Z': score_check = 0; break; case 'Y': score_check = 2; break; + case 'L': + legacygapcost = 1; + break; #if 0 case 'n' : treemethod = 'n'; @@ -278,23 +347,44 @@ void arguments( int argc, char *argv[] ) case 'n' : outnumber = 1; break; - case 'X' : + case 'X': treemethod = 'X'; - break; + sueff_global = atof( *++argv ); + fprintf( stderr, "sueff_global = %f\n", sueff_global ); + --argc; + goto nextoption; +#if 0 case 'E' : treemethod = 'E'; break; case 'q' : treemethod = 'q'; break; +#endif + case 'E': + autosubalignment = atof( *++argv ); + fprintf( stderr, "autosubalignment = %f\n", autosubalignment ); + --argc; + goto nextoption; + case 'W': + minimumweight = atof( *++argv ); + fprintf( stderr, "minimumweight = %f\n", minimumweight ); + --argc; + goto nextoption; case 'z': - fftThreshold = atoi( *++argv ); + fftThreshold = myatoi( *++argv ); --argc; goto nextoption; case 'w': - fftWinSize = atoi( *++argv ); + fftWinSize = myatoi( *++argv ); --argc; goto nextoption; + case '=': + specifictarget = 1; + break; + case ':': + nwildcard = 1; + break; default: fprintf( stderr, "illegal option %c\n", c ); argc = 0; @@ -335,6 +425,7 @@ int main( int argc, char *argv[] ) double **eff; FILE *prep; FILE *infp; + FILE *orderfp; int alloclen; int returnvalue; char c; @@ -346,11 +437,22 @@ int main( int argc, char *argv[] ) static char **nogap1seq; static char *kozoarivec; int nkozo; + int alignmentlength; + int **skipthisbranch; + int foundthebranch; + int nsubalignments, maxmem; + int **subtable; + int *insubtable; + int *preservegaps; + char ***subalnpt; + int ntarget, *targetmap, *targetmapr; + int ilim; arguments( argc, argv ); #ifndef enablemultithread nthread = 0; #endif + if( fastathreshold < 0.0001 ) constraint = 0; if( inputfile ) { @@ -380,6 +482,29 @@ int main( int argc, char *argv[] ) exit( 1 ); } + + if( subalignment ) + { + readsubalignmentstable( njob, NULL, NULL, &nsubalignments, &maxmem ); + fprintf( stderr, "nsubalignments = %d\n", nsubalignments ); + fprintf( stderr, "maxmem = %d\n", maxmem ); + subtable = AllocateIntMtx( nsubalignments, maxmem+1 ); + insubtable = AllocateIntVec( njob ); + preservegaps = AllocateIntVec( njob ); + for( i=0; i 0.0 && subalignment == 0 ) + { +// reporterr( "Computing skipthisbranch..\n" ); + insubtable = AllocateIntVec( njob ); + preservegaps = AllocateIntVec( njob ); + subtable = calloc( 1, sizeof( char * ) ); + subtable[0] = NULL; // for FreeIntMtx + for( i=0; i= njob ) + { + fprintf( stderr, "No such sequence, %d.\n", subtable[i][j]+1 ); + exit( 1 ); + } + if( alignmentlength != strlen( seq[subtable[i][j]] ) ) + { + fprintf( stderr, "\n" ); + fprintf( stderr, "###############################################################################\n" ); + fprintf( stderr, "# ERROR!\n" ); + fprintf( stderr, "# Subalignment %d must be aligned.\n", i+1 ); + fprintf( stderr, "# Please check the alignment lengths of following sequences.\n" ); + fprintf( stderr, "#\n" ); + fprintf( stderr, "# %d. %-10.10s -> %d letters (including gaps)\n", subtable[i][0]+1, name[subtable[i][0]]+1, alignmentlength ); + fprintf( stderr, "# %d. %-10.10s -> %d letters (including gaps)\n", subtable[i][j]+1, name[subtable[i][j]]+1, (int)strlen( seq[subtable[i][j]] ) ); + fprintf( stderr, "#\n" ); + fprintf( stderr, "# See http://mafft.cbrc.jp/alignment/software/merge.html for details.\n" ); + if( subalignmentoffset ) + { + fprintf( stderr, "#\n" ); + fprintf( stderr, "# You specified seed alignment(s) consisting of %d sequences.\n", subalignmentoffset ); + fprintf( stderr, "# In this case, the rule of numbering is:\n" ); + fprintf( stderr, "# The aligned seed sequences are numbered as 1 .. %d\n", subalignmentoffset ); + fprintf( stderr, "# The input sequences to be aligned are numbered as %d .. %d\n", subalignmentoffset+1, subalignmentoffset+njob ); + } + fprintf( stderr, "###############################################################################\n" ); + fprintf( stderr, "\n" ); + exit( 1 ); + } + insubtable[subtable[i][j]] = 1; + } + for( j=0; j OK\n" ); + break; + } + } + if( !foundthebranch ) + { + system( "cp infile.tree GuideTree" ); // tekitou + fprintf( stderr, "\n" ); + fprintf( stderr, "###############################################################################\n" ); + fprintf( stderr, "# ERROR!\n" ); + fprintf( stderr, "# Subalignment %d does not seem to form a monophyletic cluster\n", i+1 ); + fprintf( stderr, "# in the guide tree ('GuideTree' in this directory) internally computed.\n" ); + fprintf( stderr, "# If you really want to use this subalignment, pelase give a tree with --treein \n" ); + fprintf( stderr, "# http://mafft.cbrc.jp/alignment/software/treein.html\n" ); + fprintf( stderr, "# http://mafft.cbrc.jp/alignment/software/merge.html\n" ); + if( subalignmentoffset ) + { + fprintf( stderr, "#\n" ); + fprintf( stderr, "# You specified seed alignment(s) consisting of %d sequences.\n", subalignmentoffset ); + fprintf( stderr, "# In this case, the rule of numbering is:\n" ); + fprintf( stderr, "# The aligned seed sequences are numbered as 1 .. %d\n", subalignmentoffset ); + fprintf( stderr, "# The input sequences to be aligned are numbered as %d .. %d\n", subalignmentoffset+1, subalignmentoffset+njob ); + } + fprintf( stderr, "############################################################################### \n" ); + fprintf( stderr, "\n" ); + exit( 1 ); + } +// commongappick( seq[subtable[i]], subalignment[i] ); // irukamo + } +#if 0 + for( i=0; i %d\n\n", skipthisbranch[i][0] ); + fprintf( stderr, "group2 = " ); + for( j=0; topol[i][1][j] != -1; j++ ) + fprintf( stderr, "%d ", topol[i][1][j]+1 ); + fprintf( stderr, "\n" ); + fprintf( stderr, "SKIP -> %d\n\n", skipthisbranch[i][1] ); + } +#endif + + for( i=0; i