~ubuntu-branches/ubuntu/edgy/ncbi-tools6/edgy

« back to all changes in this revision

Viewing changes to algo/blast/core/blast_def.h

  • Committer: Bazaar Package Importer
  • Author(s): Barry deFreese
  • Date: 2006-07-19 23:28:07 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20060719232807-et3cdmcjgmnyleyx
Tags: 6.1.20060507-3ubuntu1
Re-merge with Debian

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: blast_def.h,v 1.64 2005/11/16 14:31:36 madden Exp $
 
1
/* $Id: blast_def.h,v 1.71 2006/05/04 15:52:51 camacho Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
62
62
#define CODON_LENGTH 3
63
63
#endif
64
64
 
65
 
/** for traslated gapped searches, this is the default value in nucleotides of
66
 
 *  longest_intron */
 
65
/** For translated gapped searches, this is the default value in
 
66
 * nucleotides of longest_intron (for ungapped translated searches,
 
67
 * the default value of longest_intron is zero, which causes a legacy
 
68
 * method of HSP linking that does not use longest_intron to be
 
69
 * invoked).
 
70
 *
 
71
 * The value 122 corresponds to 40 amino acids: 40 codons * 3
 
72
 * nucleotides per codon + up to 2 frame shifts.  40 amino acids is
 
73
 * the maximum gap size in the untranslated sequence, so
 
74
 * DEFAULT_LONGEST_INTRON makes these two gap sizes equal.
 
75
 */ 
67
76
#ifndef DEFAULT_LONGEST_INTRON
68
77
#define DEFAULT_LONGEST_INTRON 122
69
78
#endif
107
116
 * lookup table.
108
117
 */
109
118
typedef struct SSeqRange {
110
 
   Int4 left;
111
 
   Int4 right;
 
119
   Int4 left;  /**< left endpoint of range (zero based) */
 
120
   Int4 right;  /**< right endpoint of range (zero based) */
112
121
} SSeqRange;
113
122
 
114
123
/** Used to hold a set of positions, mostly used for filtering. 
150
159
   Uint1* sequence_start; /**< Start of sequence, usually one byte before 
151
160
                               sequence as that byte is a NULL sentinel byte.*/
152
161
   Int4     length;         /**< Length of sequence. */
153
 
   Int4 context; /**< Context of the query, needed for multi-query searches */
154
162
   Int2 frame; /**< Frame of the query, needed for translated searches */
155
163
   Int4 oid; /**< The ordinal id of the current sequence */
156
164
   Boolean sequence_allocated; /**< TRUE if memory has been allocated for 
168
176
                                    lcase_mask */
169
177
} BLAST_SequenceBlk;
170
178
 
171
 
/** The context related information
172
 
 */
173
 
typedef struct BlastContextInfo {
174
 
    Int4 query_offset;      /**< Offset of this query, strand or frame in the
175
 
                               concatenated super-query. */
176
 
    Int4 query_length;      /**< Length of this query, strand or frame */
177
 
    Int8 eff_searchsp;      /**< Effective search space for this context. */
178
 
    Int4 length_adjustment; /**< Length adjustment for boundary conditions */
179
 
    Int4 query_index;       /**< Index of query (same for all frames) */
180
 
    Int1 frame;             /**< Frame number (-1, -2, -3, 0, 1, 2, or 3) */
181
 
} BlastContextInfo;
182
 
 
183
179
/** Information about a single pattern occurence in the query. */
184
180
typedef struct SPHIPatternInfo {
185
181
    Int4 offset;  /**< Starting offset of this pattern occurrence. */
197
193
    double probability; /**< Probability of the pattern */
198
194
} SPHIQueryInfo;
199
195
 
200
 
/** The query related information 
201
 
 */
202
 
typedef struct BlastQueryInfo {
203
 
    Int4 first_context;  /**< Index of the first element of the context array */
204
 
    Int4 last_context;   /**< Index of the last element of the context array */
205
 
    int num_queries;     /**< Number of query sequences */
206
 
    BlastContextInfo * contexts; /**< Information per context */
207
 
    Uint4 max_length;    /**< Length of the longest among the concatenated
208
 
                            queries */
209
 
    SPHIQueryInfo* pattern_info; /**< Counts of PHI BLAST pattern
210
 
                                      occurrences, used in PHI BLAST only. */
211
 
} BlastQueryInfo;
212
 
 
 
196
/************************* Progress monitoring/interruptible API *************/
 
197
 
 
198
/** Enumeration for the stages in the BLAST search */
 
199
typedef enum EBlastStage {
 
200
    ePrelimSearch,
 
201
    eTracebackSearch
 
202
} EBlastStage;
 
203
 
 
204
/** Progress monitoring structure. This is updated by the engine to provided to
 
205
 * the user as an argument to the user-supplied callback function 
 
206
 * (TInterruptFnPtr). This function then can assess whether the search 
 
207
 * should proceed or exit prematurely.
 
208
 * @sa TInterruptFnPtr
 
209
 */
 
210
typedef struct SBlastProgress {
 
211
    EBlastStage stage;      /**< Stage of the BLAST search currently in
 
212
                              progress */
 
213
    void* user_data;        /**< Pointer to user-provided data */
 
214
} SBlastProgress;
 
215
 
 
216
/** Prototype for function pointer to determine whether the BLAST search
 
217
 * should proceed or be interrupted. If this function returns true, all 
 
218
 * processing must stop and the search must discard all interim results 
 
219
 * @note In order to avoid undue overhead, this function should not perform any
 
220
 * time consuming operations and should always return (i.e.: it should never 
 
221
 * block)
 
222
 */
 
223
typedef Boolean (*TInterruptFnPtr) (SBlastProgress* progress_info);
 
224
 
 
225
/** Allocates and initializes a new SBlastProgress structure.
 
226
 * @param user_data user-provided data (not owned by the resulting structure)
 
227
 * [in]
 
228
 * Implemented in blast_util.c 
 
229
 */
 
230
SBlastProgress* SBlastProgressNew(void* user_data);
 
231
 
 
232
/** Deallocates a SBlastProgress structure.
 
233
 * Implemented in blast_util.c */
 
234
SBlastProgress* SBlastProgressFree(SBlastProgress* progress_info);
 
235
 
 
236
/** Resets the progress structure to its original state (as if newly allocated)
 
237
 * for a fresh start without touching the user_data field */
 
238
void SBlastProgressReset(SBlastProgress* progress_info);
213
239
 
214
240
#ifdef __cplusplus
215
241
}