1 /* $Id: profiles.h,v 6.15 2004/09/21 14:45:26 camacho Exp $
2 ***************************************************************************
3 *                                                                         *
4 *                             COPYRIGHT NOTICE                            *
5 *                                                                         *
6 * This software/database is categorized as "United States Government      *
7 * Work" under the terms of the United States Copyright Act.  It was       *
8 * produced as part of the author's official duties as a Government        *
9 * employee and thus can not be copyrighted.  This software/database is    *
10 * freely available to the public for use without a copyright notice.      *
11 * Restrictions can not be placed on its present or future use.            *
12 *                                                                         *
13 * Although all reasonable efforts have been taken to ensure the accuracy  *
14 * and reliability of the software and data, the National Library of       *
15 * Medicine (NLM) and the U.S. Government do not and can not warrant the   *
16 * performance or results that may be obtained by using this software,     *
17 * data, or derivative works thereof.  The NLM and the U.S. Government     *
18 * disclaim any and all warranties, expressed or implied, as to the        *
19 * performance, merchantability or fitness for any particular purpose or   *
20 * use.                                                                    *
21 *                                                                         *
22 * In any work or product derived from this material, proper attribution   *
23 * of the author(s) as the source of the software or data would be         *
24 * appreciated.                                                            *
25 *                                                                         *
26 **************************************************************************/
27 
28 /**************************************************************************
29 File name: profiles.h
30 
31 Author: Alejandro Schaffer
32 
33 Contents: utilities for IMPALA
34 
35 **************************************************************************/
36 
37 #ifndef __PROFILES_H
38 #define __PROFILES_H
39 
40 #define MAXLINELEN 2000
41 #define MAX_NAME_LENGTH 500
42 
43 #define   ARG_DB 0
44 #define   ARG_QUERY_FILE 1
45 #define   ARG_E_VALUE 2
46 #define   ARG_ALIGN_VIEW 3
47 #define   ARG_OUTPUT_FILE 4
48 #define   ARG_FILTER 5
49 #define   ARG_GAP_OPEN 6
50 #define   ARG_GAP_EXTEND 7
51 #define   ARG_X_DROP  8
52 #define   ARG_PROCESSORS 9
53 #define   ARG_SHOW_GI 10
54 #define   ARG_E_MULTIPASS 11
55 #define   ARG_PSEUDO 12
56 #define   ARG_NUM_PASS 13
57 #define   ARG_BELIEVE_DEF 14
58 #define   ARG_SEQALIGN_FILE 15
59 #define   ARG_MATRIX 16
60 #define   ARG_MATRICES_DB 17
61 #define   ARG_DB_LENGTH  18
62 #define   ARG_NUM_DEFLINES 20
63 #define   ARG_NUM_ALIGNS 21
64 
65 
66 #define PRO_VERSION "1.1"
67 #define PRO_DATE "20-December-1999"
68 #define PRO_MAX_HIT_LIST 250
69 #define PRO_NUM_TICKS 50
70 
71 #define PRO_ALPHABET_SIZE  26
72 #define SORT_THRESHOLD 20
73 
74 #define PRO_DEFAULT_SCALING_UP  100
75 #define PRO_DEFAULT_SCALING_DOWN 0.01
76 
77 #define RPS_MAGIC_NUMBER 7702
78 
79 #define Xchar 21
80 #define Xscore (-1)
81 
82 #define scoreRange 10000
83 
84 /*factor used to multiply the gapped K parameter to make it
85   more accurate in most cases*/
86 #define PRO_K_MULTIPLIER 1.2
87 
88 typedef BLAST_Score ScoreRow[PRO_ALPHABET_SIZE];
89 
90 typedef struct SWpairs {
91   Int4 noGap;
92   Int4 gapExists;
93 } SWpairs;
94 
95 typedef struct proDemographicsItems {
96   Uint1 matrixName[MAX_NAME_LENGTH];
97   Int4  numSequencesTested;
98   Int4  numBetterThanEthresh;
99   Int4  numCallsALIGN;
100   Int4  queryLength;
101   Int4  dbLength;
102   Nlm_FloatHi effDbLength;
103   Nlm_FloatHi effSearchSpace;
104   Nlm_FloatHi X;
105   Nlm_FloatHi XinBits;
106 } proDemographicsItems;
107 
108 #ifdef __cplusplus
109 extern "C" {
110 #endif
111 
112 Char * LIBCALL addSuffixToName PROTO((Char *prefix, Char *suffix));
113 
114 
115 Char LIBCALL getRes PROTO((Char input));
116 
117 Boolean LIBCALL IMPALAPrintReference PROTO((Boolean html, Int4 line_length, FILE *outfp));
118 
119 Nlm_FloatHi LIBCALL
120 impalaKarlinLambdaNR PROTO((BLAST_ScoreFreqPtr sfp, Nlm_FloatHi initialLambda));
121 
122 Boolean LIBCALL impalaScaling PROTO((posSearchItems *posSearch, compactSearchItems * compactSearch, Nlm_FloatHi scalingFactor, Boolean doBinarySearch));
123 
124 Boolean LIBCALL  impalaReadCheckpoint PROTO((posSearchItems * posSearch, compactSearchItems * compactSearch, CharPtr fileName, ValNodePtr * error_return,
125 Nlm_FloatHi scalingFactor));
126 
127 void  LIBCALL impalaMakeFileNames PROTO((Char * matrixDbName, Char * auxiliaryFileName, Char * mmapFileName, Char * seqFileName, Char *matrixFileName, Char * ckptFileName,  Char *directoryPrefix));
128 
129 Boolean LIBCALL IMPALAPrintHelp PROTO((Boolean html, Int4 line_length, Char * programName, FILE *outfp));
130 
131 Nlm_FloatHi LIBCALL IMPALAfindUngappedLambda PROTO((Char *matrixName));
132 
133 void LIBCALL IMPALAfillResidueProbability PROTO((Uint1Ptr sequence, Int4 length, Nlm_FloatHi * resProb));
134 
135 BLAST_ScoreFreqPtr LIBCALL IMPALAfillSfp PROTO((BLAST_Score **matrix, Int4 matrixLength, Nlm_FloatHi *queryProbArray, Nlm_FloatHi *scoreArray,  BLAST_ScoreFreqPtr return_sfp, Int4 range));
136 
137 ScorePtr LIBCALL addScoresToSeqAlign PROTO((Int4 rawScore, Nlm_FloatHi eValue, Nlm_FloatHi Lambda, Nlm_FloatHi logK));
138 
139 void LIBCALL pro_quicksort_hits PROTO((Int4 no_of_seq, SWResults **proResultsList));
140 
141 #ifdef __cplusplus
142 }
143 #endif
144 
145 #endif  /* __PROFILES_H */
146