#else
#endif
+#include "mafft.h"
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <math.h>
#include <ctype.h>
#include "mtxutl.h"
-#include <float.h>
+//#include <double.h>
+#include <stdarg.h>
#ifdef enablemultithread
#include <pthread.h>
#endif
+#ifndef mingw
+#include <sys/resource.h> // for setstacksize, 2016/Jun
+#endif
-#define VERSION "6.857b"
-#define SHOWVERSION fprintf( stderr, "%s (%s) Version " VERSION " alg=%c, model=%s\n%d thread(s)\n", progName( argv[0] ), (dorp=='d')?"nuc":"aa", alg, modelname, nthread )
+#define VERSION "7.310"
+#define SHOWVERSION reporterr( "%s (%s) Version " VERSION " alg=%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
#define FFT_WINSIZE_P 20
#define DISPSEQF 60
#define DISPSITEI 0
#define MAXITERATION 500
-#define M 50000 /* njob no saidaiti */
+#define M 500000 /* njob no saidaiti */
#define N 5000000 /* nlen no saidaiti */
#define MAXSEG 100000
#define B 256
#define C 60 /* 1 gyou no mojisuu */
#define D 6
+#define DFORMAT "%#6.3f"
#define rnd() ( ( 1.0 / ( RAND_MAX + 1.0 ) ) * rand() )
#define MAX(X,Y) ( ((X)>(Y))?(X):(Y) )
#define MIN(X,Y) ( ((X)<(Y))?(X):(Y) )
#define JTT 201
#define TM 202
-extern char modelname[100];
+extern char modelname[500];
extern int njob, nlenmax;
-extern int amino_n[0x80];
-extern char amino_grp[0x80];
-extern int amino_dis[0x80][0x80];
-extern int amino_disLN[0x80][0x80];
-extern double amino_dis_consweight_multi[0x80][0x80];
-extern int n_dis[26][26];
-extern int n_disFFT[26][26];
-extern float n_dis_consweight_multi[26][26];
-extern char amino[26];
-extern double polarity[20];
-extern double volume[20];
+extern int amino_n[0x100];
+extern char amino_grp[0x100];
+//extern int amino_dis[0x100][0x100];
+extern int **amino_dis;
+extern double **n_disLN;
+//extern double amino_dis_consweight_multi[0x100][0x100];
+extern double **amino_dis_consweight_multi;
+extern int **n_dis;
+extern int **n_disFFT;
+extern double **n_dis_consweight_multi;
+extern unsigned char amino[0x100];
+extern double polarity[0x100];
+extern double volume[0x100];
extern int ribosumdis[37][37];
extern int ppid;
extern int check;
extern double cut;
extern int cooling;
+extern int trywarp;
extern int penalty, ppenalty, penaltyLN;
+extern int penalty_dist, ppenalty_dist;
extern int RNApenalty, RNAppenalty;
extern int RNApenalty_ex, RNAppenalty_ex;
extern int penalty_ex, ppenalty_ex, penalty_exLN;
extern int penalty_EX, ppenalty_EX;
extern int penalty_OP, ppenalty_OP;
+extern int penalty_shift;
+extern double penalty_shift_factor;
extern int offset, poffset, offsetLN, offsetFFT;
extern int RNAthr, RNApthr;
extern int scoremtx;
extern int disopt;
extern int pamN;
extern int checkC;
-extern float geta2;
+extern double geta2;
extern int treemethod;
extern int kimuraR;
extern char *swopt;
extern char *inputfile;
extern char *addfile;
extern int addprofile;
-extern float consweight_multi;
-extern float consweight_rna;
+extern double consweight_multi;
+extern double consweight_rna;
extern char RNAscoremtx;
extern char *signalSM;
extern double score_m_1( char **, int, int, double ** );
extern double score_calc0( char **, int, double **, int );
extern char seqcheck( char ** );
-extern float substitution( char *, char * );
-extern float substitution_score( char *, char * );
-extern float substitution_nid( char *, char * );
-extern float substitution_hosei( char *, char * );
+extern double substitution( char *, char * );
+extern double substitution_score( char *, char * );
+extern double substitution_nid( char *, char * );
+extern double substitution_hosei( char *, char * );
extern double ipower( double, int );
-extern float translate_and_Calign();
-extern float A__align();
-extern float A__align11();
-extern float A__align_gapmap();
-extern float partA__align();
-extern float L__align11();
-extern float G__align11();
-extern float Falign();
-extern float Falign_localhom();
-extern float Conalign();
-extern float Aalign();
-extern float imp_match_out_sc( int, int );
-extern float part_imp_match_out_sc( int, int );
+extern double translate_and_Calign();
+extern double A__align();
+extern double A__align11();
+extern double A__align_gapmap();
+extern double partA__align();
+extern double L__align11( double **scoringmtx, double scoreoffset, char **seq1, char **seq2, int alloclen, int *off1pt, int *off2pt );
+extern double G__align11();
+extern double Falign();
+extern double Falign_localhom();
+extern double Conalign();
+extern double Aalign();
+extern double imp_match_out_sc( int, int );
+extern double part_imp_match_out_sc( int, int );
extern void ErrorExit();
extern void cpmx_calc();
extern void intergroup_score( char **, char **, double *, double *, int, int, int, double * );
typedef struct _LocalHom
{
- int nokori;
struct _LocalHom *next;
struct _LocalHom *last;
int start1;
int overlapaa;
int extended;
double importance;
- float fimportance;
- double wimportance;
+ double rimportance;
+// double fimportance;
+// double wimportance;
char korh;
+ int nokori;
} LocalHom;
typedef struct _NodeInCub
typedef struct _Gappattern
{
int len;
- float freq;
+ double freq;
} Gappat;
typedef struct _RNApair
{
int uppos;
- float upscore;
+ double upscore;
int downpos;
- float downscore;
+ double downscore;
int bestpos;
- float bestscore;
+ double bestscore;
} RNApair;
typedef struct _Treedep
int child0;
int child1;
int done;
+ double distfromtip;
} Treedep;
+typedef struct _Addtree
+{
+ int nearest;
+ double dist1;
+ char *neighbors;
+ double dist2;
+} Addtree;
#include "fft.h"
#include "dp.h"
#define BAATARI2 3
extern int scoreout;
+extern int spscoreout;
extern int outnumber;
-extern char *newgapstr;
+extern int legacygapcost;
+extern double minimumweight;
+extern int nwildcard;
+
+extern TLS char *newgapstr;
+
+extern int nalphabets;
+extern int nscoredalphabets;
+extern double specificityconsideration;
+extern int ndistclass, maxdistclass;
+
+extern int gmsg;
+
+extern double sueff_global;
+extern double lenfaca, lenfacb, lenfacc, lenfacd;
+int maxl, tsize;