13 #include <sys/types.h>
21 #ifdef enablemultithread
25 #include <sys/resource.h> // for setstacksize, 2016/Jun
28 #define VERSION "7.310"
29 #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 )
31 #define FFT_THRESHOLD 80
32 #define FFT_WINSIZE_P 20
33 #define FFT_WINSIZE_D 100
36 #define MAXITERATION 500
37 #define M 500000 /* njob no saidaiti */
38 #define N 5000000 /* nlen no saidaiti */
41 #define C 60 /* 1 gyou no mojisuu */
43 #define DFORMAT "%#6.3f"
44 #define rnd() ( ( 1.0 / ( RAND_MAX + 1.0 ) ) * rand() )
45 #define MAX(X,Y) ( ((X)>(Y))?(X):(Y) )
46 #define MIN(X,Y) ( ((X)<(Y))?(X):(Y) )
47 #define G(X) ( ((X)>(0))?(X):(0) )
48 #define BEFF 1.0 /* 0.6 ni suruto zureru */
53 #define NOTSPECIFIED 100009
54 #define SUEFF 0.1 /* upg/(spg+upg) -> sueff.sed */
56 #define INTMTXSCALE 1000000.0
60 extern char modelname[500];
61 extern int njob, nlenmax;
62 extern int amino_n[0x100];
63 extern char amino_grp[0x100];
64 //extern int amino_dis[0x100][0x100];
65 extern int **amino_dis;
66 extern double **n_disLN;
67 //extern double amino_dis_consweight_multi[0x100][0x100];
68 extern double **amino_dis_consweight_multi;
70 extern int **n_disFFT;
71 extern double **n_dis_consweight_multi;
72 extern unsigned char amino[0x100];
73 extern double polarity[0x100];
74 extern double volume[0x100];
75 extern int ribosumdis[37][37];
78 extern double thrinter;
79 extern double fastathreshold;
80 extern int pslocal, ppslocal;
81 extern int constraint;
82 extern int divpairscore;
83 extern int fmodel; // 1-> fmodel 0->default -1->raw
84 extern int nblosum; // 45, 50, 62, 80
85 extern int kobetsubunkatsu;
90 extern int calledByXced;
101 extern int penalty, ppenalty, penaltyLN;
102 extern int penalty_dist, ppenalty_dist;
103 extern int RNApenalty, RNAppenalty;
104 extern int RNApenalty_ex, RNAppenalty_ex;
105 extern int penalty_ex, ppenalty_ex, penalty_exLN;
106 extern int penalty_EX, ppenalty_EX;
107 extern int penalty_OP, ppenalty_OP;
108 extern int penalty_shift;
109 extern double penalty_shift_factor;
110 extern int offset, poffset, offsetLN, offsetFFT;
111 extern int RNAthr, RNApthr;
115 extern char force_fft;
116 extern int nevermemsave;
118 extern int fftWinSize;
119 extern int fftThreshold;
120 extern int fftRepeatStop;
121 extern int fftNoAnchStop;
122 extern int divWinSize;
123 extern int divThreshold;
131 extern int tbrweight;
136 extern int treemethod;
140 extern int score_check;
141 extern char *inputfile;
142 extern char *addfile;
143 extern int addprofile;
144 extern double consweight_multi;
145 extern double consweight_rna;
146 extern char RNAscoremtx;
148 extern char *signalSM;
154 extern char rnaprediction;
156 /* sengen no ichi ha koko dake de ha nai */
157 extern void constants();
158 extern char **Calignm1();
159 extern char **Dalignm1();
160 extern char **align0();
161 extern double Cscore_m_1( char **, int, int, double ** );
162 extern double score_m_1( char **, int, int, double ** );
163 extern double score_calc0( char **, int, double **, int );
164 extern char seqcheck( char ** );
165 extern double substitution( char *, char * );
166 extern double substitution_score( char *, char * );
167 extern double substitution_nid( char *, char * );
168 extern double substitution_hosei( char *, char * );
169 extern double ipower( double, int );
170 extern double translate_and_Calign();
171 extern double A__align();
172 extern double A__align11();
173 extern double A__align_gapmap();
174 extern double partA__align();
175 extern double L__align11( double **scoringmtx, double scoreoffset, char **seq1, char **seq2, int alloclen, int *off1pt, int *off2pt );
176 extern double G__align11();
177 extern double Falign();
178 extern double Falign_localhom();
179 extern double Conalign();
180 extern double Aalign();
181 extern double imp_match_out_sc( int, int );
182 extern double part_imp_match_out_sc( int, int );
183 extern void ErrorExit();
184 extern void cpmx_calc();
185 extern void intergroup_score( char **, char **, double *, double *, int, int, int, double * );
186 extern int conjuctionfortbfast();
187 extern int fastconjuction();
188 extern char seqcheck( char ** );
190 typedef struct _LocalHom
192 struct _LocalHom *next;
193 struct _LocalHom *last;
203 // double fimportance;
204 // double wimportance;
209 typedef struct _NodeInCub
217 struct _Node *children[3];
220 double *weightptr[3];
225 typedef struct _Segment
233 struct _Segment *pair;
237 typedef struct _Segments
245 typedef struct _Bchain
247 struct _Bchain *next;
248 struct _Bchain *prev;
252 typedef struct _Achain
260 typedef struct _Fukusosuu
266 typedef struct _Gappattern
272 typedef struct _RNApair
282 typedef struct _Treedep
290 typedef struct _Addtree
300 #include "functions.h"
302 #ifdef enablemultithread
308 extern TLS int commonAlloc1;
309 extern TLS int commonAlloc2;
310 extern TLS int **commonIP;
311 extern TLS int **commonJP;
313 extern int randomseed;
314 extern int parallelizationstrategy;
321 extern int spscoreout;
322 extern int outnumber;
324 extern int legacygapcost;
325 extern double minimumweight;
326 extern int nwildcard;
328 extern TLS char *newgapstr;
330 extern int nalphabets;
331 extern int nscoredalphabets;
332 extern double specificityconsideration;
333 extern int ndistclass, maxdistclass;
337 extern double sueff_global;
338 extern double lenfaca, lenfacb, lenfacc, lenfacd;