1 /* Concurrent read version */
2 
3 /* $Id: defs.h 1261 2014-06-11 19:38:36Z wrp $ */
4 /* $Revision: 1261 $  */
5 
6 #ifdef SUNOS
7 #include <sys/stdtypes.h>
8 #endif
9 
10 #ifndef IS_BIG_ENDIAN
11 #if defined(__BIG_ENDIAN__) || defined(_BIG_ENDIAN)
12 #define IS_BIG_ENDIAN
13 #else
14 #undef IS_BIG_ENDIAN
15 #endif
16 #endif
17 
18 #if !defined(MAX_WORKERS) && !defined(PCOMPLIB)
19 #define MAX_WORKERS 1
20 #endif
21 #if defined(PCOMPLIB) && !defined(MAXWRKR)
22 #define MAXWRKR	64
23 #endif
24 
25 #define SAFE_STRNCPY(dest,src,dest_len) strncpy(dest,src,dest_len); dest[dest_len-1]='\0'
26 #define SAFE_STRNCAT(str,cat,str_len) strncat(str,cat,str_len-strlen(str)-1)
27 
28 /* constants associated with displaying annotation links */
29 #ifndef DESCR_OFFSET
30 #define DESCR_OFFSET 15
31 #endif
32 
33 #define NO_FILE_EXIT 4
34 
35 
36 /* 3-Oct-2003 - we can now have 2 nucleotide query types, DNA
37    and RNA.  pst.dnaseq can also be SEQT_RNA.
38    ldnaseq can only be DNA */
39 
40 #define SEQT_DNA 1
41 #define SEQT_RNA 3	/* DNA and RNA seqtypes must be odd */
42 
43 #define SEQT_PROT 0
44 #define SEQT_UNK -1
45 #define SEQT_OTHER 2
46 
47 #ifndef DEF_NMLEN
48 #define DEF_NMLEN 6
49 #endif
50 
51 #define DEF_MIN_BITS 40	/* minimum number of bits required, appropriate for swissprot */
52 
53 /* unfortunately, there is an important relationship between MAXTRN and
54    MAXLIB embedded here.  MAXTRN must be >= (MAXLIB)/3
55    or it will be possible for a translated DNA sequence to be longer
56    than the translation space available */
57 
58 #define MAX_STR	512 /* standard label/message buffer */
59 #define MAX_SSTR 32 /* short string */
60 #define MAX_LSTR 4096 /* long label/message buffer */
61 #define MAX_FN  120 /* maximum size of a file name */
62 #define MAX_CH	40 /* maximum number of library choices */
63 #ifndef SMALLMEM
64 #define MAX_LF  2000 /* maximum numer of library files */
65 #else
66 #define MAX_LF  80 /* maximum numer of library files */
67 #endif
68 
69 #ifndef MAX_MEMK
70 #if defined(BIG_LIB64) && (defined(COMP_THR) || defined(PCOMPLIB))
71 #define MAX_MEMK 8*1024*1024	/* 12 GB (<<10) for library in memory */
72 #else
73 #define MAX_MEMK 2*1024*1024	/* 2 GB (<<10) for library in memory */
74 #endif
75 #endif
76 
77 /* padding at the end of sequences for ALTIVEC, other vector
78    processors */
79 #define SEQ_PAD 16
80 
81 #define MAX_UID 20 /* length of libstr, used for character keys with SQL */
82 
83 #define BUF_MULT 2	/* increase to increase the number of buffers */
84 #define DEF_WORKER_BUF 6000000
85 #define AVE_AA_LEN 400
86 #define AVE_NT_LEN 1200
87 
88 #define MAX_RSTATS 500		/* number of random shuffle stats */
89 #define MIN_LOCAL_LEN 33	/* minimum length for addn'l local alignments
90 				   (should be in pstruct)*/
91 #ifndef SMALLMEM
92 #define MAXTST	40000		/* longest query */
93 #define MAXLIB	150000		/* longest library sequence*/
94 #define MAXLIB_P 45000
95 #define MIN_RES 2000		/* minimum amount allocated for alignment */
96 #ifndef TFAST
97 #define MAXTRN  45000		/* buffer for fastx translation */
98 #else
99 #define MAXTRN 165000		/* buffer for tfastx translation, must be > 3 * MAXTST */
100 #endif
101 #define SEQDUP	150		/* future - overlap */
102 #ifndef PCOMPLIB
103 #ifndef MAX_BEST
104 #define MAX_BEST	60000	/* max number of best scores */
105 #endif
106 #define MAX_STATS 60000
107 #else
108 #ifndef MAX_BEST
109 #define MAX_BEST	60000	/* max number of best scores */
110 #endif
111 #define MAX_STATS 60000
112 #endif
113 #define BIGNUM  1000000000
114 #ifndef MAXINT
115 #define MAXINT 2147483647
116 #endif
117 #define MAXLN	120	/* size of a library name */
118 #else
119 #define MAXTST	1500
120 #define MAXLIB	10000
121 #define MAXLIB_P MAXLIB
122 #define MIN_RES 1000
123 #ifndef TFAST
124 #define MAXTRN  4500
125 #else
126 #define MAXTRN 11500
127 #endif
128 #define SEQDUP	300
129 #define MAX_BEST 2000
130 #define MAX_STATS 20000
131 #define BIGNUM  32767
132 #define MAXINT  32767
133 #define MAXLN	40	/* size of a library name */
134 #endif
135 #if !defined(TFAST)
136 #define MAXDIAG	(MAXTST+MAXLIB)
137 #else
138 #define MAXDIAG	(MAXTST+MAXTRN)
139 #endif
140 
141 #define MAXPAM	600	/* maximum allowable size of the pam matrix */
142 #define PROF_MAX 500
143 #define ALF_MAX 30
144 
145 #define max(a,b) (((a) > (b)) ? (a) : (b))
146 #define min(a,b) (((a) < (b)) ? (a) : (b))
147 
148 #define MX_ATYPE 7	/* markx==0,1,2 7=> no alignment */
149 #define MX_ASEP  8	/* markx==3  - separate lines */
150 #define MX_AMAP  16	/* markx==4,5 - graphic map */
151 #define MX_HTML  32	/* markx==6  - HTML */
152 #define MX_M9SUMM 64	/* markx==9(c) */
153 #define MX_M10FORM 128	/* markx==10 - verbose output */
154 #define MX_M11OUT 256	/* markx==11 - lalign lav */
155 #define MX_M8OUT 512	/* markx==8 blast8 output */
156 #define MX_M8COMMENT 1024	/* markx==8 blast8 output */
157 #define MX_MBLAST 2048	/* markx=B blast output */
158 #define MX_MBLAST2 4096	/* markx=BB more blast output */
159 #define MX_ANNOT_COORD 16384 /* -m 0, use -m 0B for both */
160 #define MX_ANNOT_MID  32768 /* markx 0M, 1M, 2M annotations in middle */
161 #define MX_RES_ALIGN_SCORE (1<<20)  /* show residue alignment score, not alignment */
162 
163 /* codes for -m 9 */
164 #define SHOW_CODE_ID	1	/* identity only */
165 #define SHOW_CODE_ALIGN 2	/* encoded alignment */
166 #define SHOW_CODE_CIGAR 3	/* encoded alignment */
167 #define SHOW_CODE_MASK  3	/* use higher bits for annotation format */
168 #define SHOW_CODE_EXT   4	/* encode identity, mismatch state */
169 #define SHOW_ANNOT_FULL 8	/* show full-length annot in calc_code */
170