X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=binaries%2Fsrc%2Fmafft%2Fcore%2Fmafft-profile.c;fp=binaries%2Fsrc%2Fmafft%2Fcore%2Fmafft-profile.c;h=1eb479c3d9e4f39e497e6c0b631afa53e671adc5;hb=063b30bb5e8161134ae764742636ab538e10eea7;hp=0000000000000000000000000000000000000000;hpb=6e0ce943f09b5ac30f3eb8dc0f20bc75114669ce;p=jabaws.git diff --git a/binaries/src/mafft/core/mafft-profile.c b/binaries/src/mafft/core/mafft-profile.c new file mode 100644 index 0000000..1eb479c --- /dev/null +++ b/binaries/src/mafft/core/mafft-profile.c @@ -0,0 +1,504 @@ +#include "mltaln.h" + +#define DEBUG 0 + +#if DEBUG +#include +#include +#include +double getrusage_sec() +{ + struct rusage t; + struct timeval tv; + getrusage(RUSAGE_SELF, &t); + tv = t.ru_utime; + return tv.tv_sec + (double)tv.tv_usec*1e-6; +} +#endif + + +int intcmp( int *str1, int *str2 ) +{ + while( *str1 != -1 && *str2 != -1 ) + if( *str1++ != *str2++ ) return( 1 ); + if( *str1 != *str2 ) return( 1 ); + return( 0 ); +} + +char **arguments( int argc, char *argv[] ) +{ + int c = 0; + + fmodel = 0; + nblosum = 62; + calledByXced = 0; + devide = 0; + fftscore = 1; + use_fft = 1; + alg = 'A'; + weight = 0; + utree = 1; + tbutree = 0; + refine = 0; + check = 1; + cut = 0.0; + disp = 0; + outgap = 0; + mix = 0; + tbitr = 0; + scmtd = 5; + tbweight = 0; + tbrweight = 3; + checkC = 0; + scoremtx = 1; + dorp = NOTSPECIFIED; + ppenalty = NOTSPECIFIED; + ppenalty_ex = NOTSPECIFIED; + poffset = 0; // chokusetsu yobareru kara + kimuraR = NOTSPECIFIED; + pamN = NOTSPECIFIED; + fftWinSize = NOTSPECIFIED; + fftThreshold = NOTSPECIFIED; + TMorJTT = JTT; + treemethod = 'x'; + + + while( --argc > 0 && (*++argv)[0] == '-' ) + { + while ( ( c = *++argv[0] ) ) + { + switch( c ) + { + case 'P': + dorp = 'p'; + break; + case 'D': + dorp = 'd'; + break; + case 'F': + use_fft = 1; + break; + case 'N': + use_fft = 0; + break; + case 'e': + fftscore = 0; + break; + case 'Q': + alg = 'Q'; + break; + case 'H': + alg = 'H'; + break; + case 'A': + alg = 'A'; + break; + case 'M': + alg = 'M'; + break; + case 'd': + disp = 1; + break; + case 'O': + outgap = 0; + break; + case 'a': + fmodel = 1; + break; + case 'u': + tbrweight = 0; + break; + case 'z': + fftThreshold = atoi( *++argv ); + --argc; + goto nextoption; + case 'w': + fftWinSize = atoi( *++argv ); + --argc; + goto nextoption; + case 'Z': + checkC = 1; + break; + 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, "kappa = %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; + default: + fprintf( stderr, "illegal option %c\n", c ); + argc = 0; + break; + } + } + nextoption: + ; + } + if( argc != 2 ) + { + fprintf( stderr, "options: Check source file ! %c ?\n", c ); + exit( 1 ); + } + fprintf( stderr, "tbitr = %d, tbrweight = %d, tbweight = %d\n", tbitr, tbrweight, tbweight ); +// readOtherOptions( &ppid, &fftThreshold, &fftWinSize ); + return( argv ); + +} + +void GroupAlign( int nseq1, int nseq2, char **name, int *nlen, char **seq, char **aseq, char **mseq1, char **mseq2, int ***topol, double **len, double *eff, int alloclen ) +{ + int i; + int clus1, clus2; + int s1, s2; + float pscore; + static char **name1, **name2; + double *effarr = eff; + double *effarr1 = NULL; + double *effarr2 = NULL; + static char *indication1, *indication2; + float dumfl = 0.0; + int intdum; +#if DEBUG + double time1, time2; +#endif + + +// fprintf( stderr, "in GroupAlign fftWinSize = %d\n", fftWinSize ); +// fprintf( stderr, "in GroupAlign fftThreshold = %d\n", fftThreshold ); + + if( effarr1 == NULL ) + { + name1 = AllocateCharMtx( nseq1, B ); + name2 = AllocateCharMtx( nseq2, B ); + indication1 = AllocateCharVec( 150 ); + indication2 = AllocateCharVec( 150 ); + effarr1 = AllocateDoubleVec( njob ); + effarr2 = AllocateDoubleVec( njob ); +#if 0 +#else +#endif + } + + for( i=0; i 30000 || len2 > 30000 ) + { + fprintf( stderr, "\nlen1=%d, len2=%d, Switching to the memsave mode.\n", len1, len2 ); + alg = 'M'; + } + + + + + GroupAlign( nseq1, nseq2, name, nlen, seq, aseq, mseq1, mseq2, topol, len, eff, alloclen ); + +#if 0 + writePre( njob, name, nlen, aseq, 1 ); +#else + writeDataforgaln( stdout, njob, name, nlen, aseq ); +#endif + + SHOWVERSION; + return( 0 ); +}