JPRED-2 Add sources of all binaries (except alscript) to Git
[jpred.git] / sources / multicoil / sc2seq.h
1 /*  Bonnie Berger, David Wilson and Theodore Tonchev 1992  */
2 /*      C Header File: modified Ethan Wolf 1995      */
3
4 /*  Defines function names called by sc2seq.c.       */
5
6 #ifndef __ScFreq_h__
7 #define __ScFreq_h__ 1
8
9 #include "scconst.h"
10 #include "sc.h"
11 #include "interface.h"
12
13
14 /* For Coil_Interface.  */
15 void PairCoilData (FILE *fgin, FILE **fpin,
16                    int ProlineFree, int table_to_remove_from,
17                    char *input_filename, int mode,
18                    long pfreqp[MAX_TABLE_NUMBER][AANUM][AANUM][POSNUM][POSNUM]);
19 void switch_tables(int table);
20 void recalc_prob(Sequence sequence, int input_table, int mode, long pfreqp[MAX_TABLE_NUMBER][AANUM][AANUM][POSNUM][POSNUM]);
21 void average_many_pprob(int current_table);
22
23
24
25
26 void  preprocessor_score(char lib[MAXFUNCTNUM], 
27                          char multi_lib[MAX_TABLE_NUMBER][MAXFUNCTNUM],
28                          double *m, double *b, 
29                        double *m_single, double *b_single, int mode, 
30                          int Preprocessor_Method, int Offset_to_Use, 
31                double preprocessor_like[MAX_TABLE_NUMBER][MAXSEQLEN][POSNUM+1],
32                          Sequence sequence,
33                        char all_preproc_offsets[MAX_NUM_SCORE_DIM][MAXSEQLEN],
34                          double bound);
35
36 double *ScoreSeq (char lib[MAXFUNCTNUM],
37                   char multi_lib[MAX_TABLE_NUMBER][MAXFUNCTNUM],
38                   double *m_paircoil, double *b_paircoil,
39                   double *m_single, double *b_single,
40                   int mode, int Table, int Method, 
41                   int Preprocessor_Method, int Offset_to_Use,
42                   double *maxscore, 
43                   int rescore_seq, int rescore_preproc, double bound);
44
45 void DimerTrimerScore (int mode, Sequence sequence, 
46                           double PairCoilLike[MAXSEQLEN][POSNUM+1],
47                           double *maxscore,
48                           int pairs, int coils, 
49                           double m, double b, int offset_to_use,
50                           double scores[MAXSEQLEN][POSNUM+1],int like2or3,
51                           int CoilDiffMethod, int start_coil_at_reg_shift);
52
53 void PairCoilScore (int mode, Sequence sequence, char lib[MAXFUNCTNUM], 
54                        double m, double b, 
55                        double *maxscore, int table, char offsets[MAXSEQLEN],
56                        double like[MAXSEQLEN][POSNUM+1], int offset_to_use,
57                        int raw_score);
58 void PairCoilDiffer (int mode, Sequence sequence, char lib[MAXFUNCTNUM], 
59                        double *maxscore,  char offsets[MAXSEQLEN],
60                        double like[MAXSEQLEN][POSNUM+1], int offset_to_use,
61                        int table,double scores[MAXSEQLEN][POSNUM+1],
62                        int Avg_Coil_Score,
63                        int CoilDiffMethod, int start_coil_at_reg_shift);
64 void SingleCoilScore(int mode, Sequence sequence, double m, double b,
65                         double *maxscore, int table, 
66                         double scores[MAXSEQLEN][POSNUM+1],int offset_to_use,
67                         int raw_score);
68 void NEWCOILSScore(int mode, Sequence sequence, double *maxscore,
69                    double scores[MAXSEQLEN][POSNUM+1], int offset_to_use);
70
71 void ActualCoils (Sequence sequence,double scores[MAXSEQLEN][POSNUM+1],
72                   int offset_to_use, int preprocessor); 
73                 /** Do "all offsets method" differently for a preprocessor **/
74 /***************************/
75
76
77 /* Proceduere in get_defaults.c. */
78 void get_defaults(char *command_line_config,
79                   char *input_location, int *mode, double *bound, 
80                     FILE **fgin, FILE **fpin,
81                     FILE **ftotal_like, FILE **fout, 
82                     FILE **flog,
83                     FILE **fout_coils,  
84                     int *by_coil_or_seq,
85                     char likelihoods[MAX_TABLE_NUMBER][MAXLINE],
86                     char *pir_name, char *lib, 
87                     char multi_lib[MAX_TABLE_NUMBER][MAXFUNCTNUM],
88                     int *functnum, 
89                     int combine_dist[MAX_TABLE_NUMBER],
90                     char *print, int *main_method, 
91                     int *main_preprocessor_method, int *main_table, 
92                     int *offset_to_use,
93                     int *avg_max,
94                     int *Coil_Score,
95                     int *ps_res_per_line,
96                     char class_sc_filenames[2][MAX_CLASS_NUMBER][MAXLINE],
97                     char gaussian_parameters[2][MAXLINE],
98                     int num_dist[MAX_TABLE_NUMBER],
99                     double init_class_prob[MAX_CLASS_NUMBER],
100                     int *table_to_remove_from,
101                     char *command_line, 
102                     int window_length[MAX_TABLE_NUMBER],
103                     double scale0s[MAX_TABLE_NUMBER],
104                     double scale0p[MAX_TABLE_NUMBER]);
105
106 /* Procedure Prototypes */
107 void init();
108
109 void done();
110
111 long calcseq(FILE* fgin, FILE* fpin, FILE* ftest, FILE* fout, FILE* flog,
112              FILE* regionfile, int ver_mode, double bound, double upper_bound,
113              char *lib);
114
115
116 /* These functions are def'd in scpos.c for reading sequences in the pos */
117 /* format (listing coiled region and registers) and for removing and     */
118 /* adding these sequences from the positive table when necessary.        */
119 void add_seq2(long pfreqs[AANUM][POSNUM], 
120         long ptotals[POSNUM],
121         long pfreqp[AANUM][AANUM][POSNUM][POSNUM], 
122         long ptotalp[POSNUM][POSNUM],
123         char reg[MAXSEQLEN],
124         char seq[MAXSEQLEN], int seqlen, int bias);
125
126 int getpos (FILE *fl, Sequence *sequence);
127
128 /*****************************************************************************/
129
130 /* These functions are def'd in output.c for various forms of result output. */
131
132 void log_output_ver(int prog, double score, double stockscore, 
133                     double scoresc2seq, int cnt, char *title, 
134                     char *code, FILE *flog);
135
136 void log_output_prn(int mode, double score, double scs[MAXSEQLEN][POSNUM], 
137                     char offsets[MAXSEQLEN], int seqlen, int cnt, 
138                     Sequence sequence, double bound, 
139                     double upper_bound, FILE *flog);
140
141 void txt_output(Sequence sequence, int mode, 
142                 FILE *fout, double scs[MAXSEQLEN][POSNUM], 
143                 double like[MAXSEQLEN][POSNUM +1],
144                 char offsets[MAXSEQLEN], double bound);
145
146 void print_coil(int mode, int seqlen, char reg[MAXSEQLEN], 
147                 double scs[MAXSEQLEN][POSNUM], double bound,
148                 double  upper_bound, char offsets[MAXSEQLEN], 
149                 char seq[MAXSEQLEN], FILE *flog);
150 /****************************************************************************/
151
152 void usage(char *prog_command);
153
154 int getpos (FILE *fl, Sequence *sequence);
155
156 void dumpvals (FILE *out, char seq[], char reg[], char offsets[], int seqlen,
157                double scs[MAXSEQLEN][POSNUM], double bound);
158
159
160 #endif   /* __ScFreq_h__ */
161
162 /*       End of Code       */
163
164
165
166