1 /* $Id: structs.h 1259 2014-05-28 19:28:06Z wrp $ */
2 
3 #include "rstruct.h"
4 
5 #include "aln_structs.h"
6 
7 #include "param.h"
8 
9 struct hist_str {
10   int histflg;
11   int *hist_a;
12   int histint, min_hist, max_hist, maxh;
13   long entries;
14   int z_calls;
15   char stat_info[MAX_STR];
16 };
17 
18 struct db_str {
19   long entries;
20   unsigned long length;
21   int carry;
22 };
23 
24 struct mng_thr {	/* structure to keep track of thread buffers */
25   int max_work_buf;	/* number of threads buffers */
26   int max_buf2_res;	/* number of results/thread buffer */
27   int max_chain_seqs;	/* number of sequences/seqr chain */
28   int seq_buf_size;	/* size of sequence buffer in each max_seq_cnt chain */
29 };
30 
31 /* values required for successive calles to getlib() */
32 struct lib_seq_info {
33   int ldnaseq;
34   int term_code;
35   int maxn;
36   int dupn;
37   int l_overlap;
38   int maxt3;
39 };
40 
41 /* used by help system to describe optional arguments */
42 struct opt_def_str {
43   char opt_char;
44   int has_arg;
45   char *opt_str;
46   char *opt_descr_s;
47   char *opt_descr_l;
48   int opt_rank;
49   int fmt_type;
50   int i_param1;
51   int i_param2;
52   double d_param1;
53   double d_param2;
54   char *s_param;
55 };
56 
57 struct markx_str {
58   /* values to be copied into m_msg to modify format */
59   int markx;
60   int nohist;
61   int ashow;
62   int show_code;
63   int long_info;
64   int aln_llen;
65   int aln_llcntx;
66   int aln_llcntx_set;
67   int std_output;
68 
69   char *out_file;
70   FILE *out_fd;
71   struct markx_str *next;
72 };
73 
74 struct mngmsg 		/* Message from host to manager */
75 {
76   char pgm_name[MAX_FN];	/* program name from argv[0] */
77   long max_memK;	/* maximum amount of sequence buffer memory */
78   int cur_seqr_cnt;	/* current number of seqr chains */
79   int n0;		/* query length ^qm_msg */
80   int nm0;		/* number of segments ^qm_msg */
81   int nmoff;		/* length of fastf segment */
82   unsigned char *aa0a;	/* annotation array */
83   struct annot_str *annot_p;	/* annot_str for query */
84   unsigned char ann_arr[MAX_FN]; /* annotation characters */
85   int ann_arr_n;	/* number of annotation characters */
86   char *ann_arr_def[MAX_FN];	/* definitions of ann_arr characters */
87   int ann_flg;		/* have annotation array, characters */
88   int have_ann;		/* have annotation on this query */
89   char tname[MAX_FN];	/* Query sequence name */
90   int tnamesize;	/* Query name size */
91   char lname[MAX_LSTR];	/* Library  file  name */
92   char link_lname[MAX_LSTR]; /* link-library name */
93   char annot0_sname[MAX_LSTR]; /* query annotation script name */
94   char annot1_sname[MAX_LSTR]; /* library annotation script name */
95   int max_tot;		/* function defined total sequence area */
96   int qdnaseq;		/* query is protein (0)/dna (1) */
97   int q_overlap;	/* overlap when segmenting long query sequence */
98   long q_offset;	/* q_offset, l_offset are set outside getlib()
99 			   and report the number of residues that were
100 			   skipped/read-previously to get to this
101 			   version of aa0/aa1 (0-based) */
102   long q_off;		/* q_off, l_off are set by getlib(); starting
103 			   at 1 but modified by @C: the position of
104 			   the first residue of aa0/aa1 in the
105 			   original sequence */
106   int qframe;		/* number of possible query frames */
107   int nframe;		/* frame for TFASTA */
108   int nitt1;		/* nframe-1 */
109   int thr_fact;		/* fudge factor for threads */
110   int s_int;		/* sampling interval for statistics */
111   int ql_start;		/* starting query sequence */
112   int ql_stop;		/* ending query sequence */
113   int pbuf_siz;		/* buffer size for sequences send in p2_complib */
114   char qtitle[MAX_STR];	/* query title */
115   char ltitle[MAX_STR];	/* library title */
116   char flstr[MAX_FN];	/* FASTLIBS string */
117   int std_output;	/* produce normal output */
118   char outfile[MAX_FN];
119   FILE *outfd;	/* indicates outfile is already open */
120   char label [MAX_SSTR];	/* Output label, "opt", "s-w", "initn init1", "initn opt"  */
121   char alabel[MAX_SSTR];	/* Output label, "Smith-Waterman", "banded Smith-Waterman", etc  */
122   char f_id0[4];	/* function id for markx==10 */
123   char f_id1[4];	/* function id for markx==10 */
124   char sqnam[4];	/* "aa" or "nt" */
125   char sqtype[10];	/* "DNA" or "protein" */
126   int long_info;	/* long description flag*/
127   long sq0off, sq1off;	/* virtual offset into aa0, aa1 */
128   int markx;		/* alignment display type */
129   int tot_markx;	/* markx as summ of all alternative markx */
130   struct markx_str *markx_list;	/* list of alternate outputs */
131   int nbr_seq;		/* number of library sequences */
132   int n1_high;		/* upper limit on sequence length */
133   int n1_low;		/* lower limit on sequence length */
134   double e_cut;		/* e_value for display */
135   double e_low;		/* e_value for display */
136   int e_cut_set;	/* e_value deliberately set */
137   int zsflag;		/* zsflag for all searches */
138   int zsflag2;		/* zsflag2 for all searches */
139   int pamd1;		/* 1st dimension of pam matrix */
140   int pamd2;		/* 2nd dimension of pam matrix */
141   int revcomp;		/* flag to do reverse complement */
142   int quiet;		/* quiet option */
143   int nrelv;		/* number of interesting scores */
144   int srelv;		/* number of scores to show in showbest */
145   int arelv;		/* number of scores to show at alignment */
146   int z_bits;		/* z_bits==1: show bit score, ==0 show z-score */
147   int tot_ident;	/* tot_ident=1 -> no mismatches for 100% identity */
148   char alab[3][24];	/* labels for alignment scores */
149   int nohist;		/* no histogram option */
150   int do_showbest;	/* do not showbest() */
151   int nshow;		/* number shown in showbest() */
152   int nskip;		/* number skipped by e_low */
153   int mshow;		/* number of scores to show */
154   int mshow_set;	/* mshow set with -b */
155   int mshow_min;	/* at least mshow scores must be shown, but limited by e_cut */
156   int ashow;		/* number of alignments to show */
157   int ashow_set;	/* ashow set with -d */
158   int nmlen;		/* length of name label */
159   int show_code;	/* show alignment code in -m 9;  ==1 => identity only, ==2 alignment code*/
160   int tot_show_code;	/* show alignment for all outputs */
161   int pre_load_done;	/* set after pre_load_best() call */
162   int align_done;	/* do_walign() called */
163   unsigned char *aa1save_buf_b; /* buffer for re_getlib() sequences for alignments */
164   char *bline_buf_b; /* buffer for re_getlib() sequences for alignments */
165   int thold;		/* threshold */
166   int max_repeat;	/* max number of non-intersecting local alignments */
167   int last_calc_flg;	/* needs a last calculation stage */
168   int qshuffle;		/* shuffle the query and do additional comparisons ^qm_msg*/
169   int shuff_max;	/* number of shuffles to perform */
170   int shuff_max_save;	/* number of shuffles to perform */
171   int shuff_node;	/* number of shuffles/worker node */
172   int shuff_wid;
173   int stages;		/* number of stages */
174   double Lambda, K, H;	/* (ungapped) Karlin-Altschul parameters */
175   int escore_flg;	/* use escore calculated by do_work() */
176   struct lib_seq_info ldb_info;	/* maxn, maxt, l_overlap, ldnaseq */
177   struct db_str db;	/* the database size as read */
178   struct db_str ldb;	/* the database size via save_best() */
179   struct score_count_s s_info;	/* counts of different score types */
180   struct score_count_s ss_info;	/* counts of different score types from shuffles */
181   struct hist_str hist;
182   void *pstat_void;	/* pstat structure for standard statistics */
183   void *pstat_void2;	/* pstat structure for zsflag > 2 */
184   struct a_struct aln;	/* has llen, llnctx, llnctx_flg, showall */
185   struct a_res_str a_res; /* has individual alignment coordinates */
186   char dfile [MAX_FN];	/* file for dumping scores to */
187 };
188 
189 struct lib_struct {
190   char *file_name; /* this library file */
191   int lib_type;	   /* the library type can be specified here, for files in an indirect list */
192   /* struct lib_mol_info *lib_params; */ /* parameters (ldnaseq, term_code, constant for all libraries */
193   struct lmf_str *acc_file_p;
194   struct lmf_str *m_file_p;	/* magic *m_file_p for reading */
195   struct lib_struct *next;	/* next in the list */
196 };
197