OSDN Git Service

Initial commit.
[crnpred/crnpred.git] / src / blast.h
1 #ifndef __blast_h_
2 #define __blast_h_
3
4 /*      $Id: blast.h,v 1.2 2006/02/20 08:29:20 akinjo Exp $      */
5
6 /* data structure for PSI-BLAST profile (PSSM) */
7
8 /* maximum sequence length */
9 #define MAXSEQ 1000
10 /* secondary structure */
11 #ifndef HALF_WINDOW_S
12 #define HALF_WINDOW_S 9
13 #endif
14
15 /* contact number */
16 #ifndef HALF_WINDOW_N
17 #define HALF_WINDOW_N 9
18 #endif
19
20 /* residue-wise contact order */
21 #ifndef HALF_WINDOW_O
22 #define HALF_WINDOW_O 26
23 #endif
24
25 #if NI_LEVEL==3
26 # define NI_UNITS_S ((2*HALF_WINDOW_S+1)*21 + 40)
27 # define NI_UNITS_N ((2*HALF_WINDOW_N+1)*21 + 40)
28 # define NI_UNITS_O ((2*HALF_WINDOW_O+1)*21 + 40)
29 #elif (NI_LEVEL==1 || NI_LEVEL==2)
30 # define NI_UNITS_S ((2*HALF_WINDOW_S+1)*21 + 20)
31 # define NI_UNITS_N ((2*HALF_WINDOW_N+1)*21 + 20)
32 # define NI_UNITS_O ((2*HALF_WINDOW_O+1)*21 + 20)
33 #else
34 # define NI_UNITS_S ((2*HALF_WINDOW_S+1)*21)
35 # define NI_UNITS_N ((2*HALF_WINDOW_N+1)*21)
36 # define NI_UNITS_O ((2*HALF_WINDOW_O+1)*21)
37 #endif
38
39 #define NO_UNITS_S (3)  
40 #define NO_UNITS_N (1)  
41 #define NO_UNITS_O (1)  
42
43 typedef struct _pssm {
44   int len;
45   char *fname;
46   char seq[MAXSEQ];
47   double prof[MAXSEQ][21];
48   double compo[20]; /* AA composition */
49
50   /* site-dependent composition weighted by seq. sep.*/
51   double wlcompo[MAXSEQ][20]; 
52 } pssm_t;
53
54 typedef struct _ans {
55   int len;
56   int nh, ne, nc;
57   double ave_cn,sd_cn;
58   double ave_co,sd_co;
59   char ss[MAXSEQ];
60   double svec[MAXSEQ][NO_UNITS_S]; 
61   double nvec[MAXSEQ];
62   double ovec[MAXSEQ];
63 } ans_t;
64
65
66 #define MAXFILES 720
67
68 typedef struct _mydata {
69   int nent;
70   long ndat;
71   pssm_t pssm[MAXFILES];
72   ans_t ans[MAXFILES];
73   char *xxfile[MAXFILES];
74 } mydata_t;
75
76 extern const char amino1[]; /* one-letter amino acid code */
77
78 extern void read_pssm(const char *file, pssm_t *prof);
79 extern void read_ans(const char *file, ans_t *ans);
80 extern void pssm2iunit(const int window, const int ind, const pssm_t *apssm, 
81                        double iunit[]);
82 extern int read_file_list(char list[], mydata_t *adata);
83
84 double mymax3(double st[], int *ind);
85 extern void secdp(int len, double y[][3], char psec[]);
86 extern void secmax(int len, double y[][3], char psec[]);
87 #endif /* __blast_h_ */