~ubuntu-branches/ubuntu/oneiric/ncbi-tools6/oneiric

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Aaron M. Ucko
  • Date: 2008-07-14 19:43:15 UTC
  • mfrom: (2.1.12 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080714194315-ed44u9ek7txva2rz
Tags: 6.1.20080302-3
tools/readdb.c: enable madvise()-based code on all glibc (hence all
Debian) systems, not just Linux.  (Closes: #490437.)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: blast_filter.h,v 1.37 2006/09/18 15:30:24 camacho Exp $
 
1
/* $Id: blast_filter.h,v 1.41 2007/12/20 22:55:46 kazimird Exp $
2
2
 * ===========================================================================
3
3
 *
4
4
 *                            PUBLIC DOMAIN NOTICE
32
32
 * functions, combine with blast_dust.h?
33
33
 */
34
34
 
35
 
#ifndef __BLAST_FILTER__
36
 
#define __BLAST_FILTER__
 
35
#ifndef ALGO_BLAST_CORE__BLAST_FILTER__H
 
36
#define ALGO_BLAST_CORE__BLAST_FILTER__H
37
37
 
 
38
#include <algo/blast/core/ncbi_std.h>
38
39
#include <algo/blast/core/blast_def.h>
 
40
#include <algo/blast/core/blast_program.h>
 
41
#include <algo/blast/core/blast_query_info.h>
39
42
#include <algo/blast/core/blast_message.h>
40
43
#include <algo/blast/core/blast_options.h>
41
44
 
44
47
#endif
45
48
 
46
49
/** BLASTNA element used to mask bases in BLAST */
 
50
NCBI_XBLAST_EXPORT
47
51
extern const Uint1 kNuclMask;
48
52
/** NCBISTDAA element used to mask residues in BLAST */
 
53
NCBI_XBLAST_EXPORT
49
54
extern const Uint1 kProtMask;
50
55
 
51
56
/** Repeats filtering default options. */
52
57
#define REPEATS_SEARCH_EVALUE 0.1       /**< Default e-value threshold */
53
58
#define REPEATS_SEARCH_PENALTY -1       /**< Default mismatch penalty */
 
59
#define REPEATS_SEARCH_REWARD 1       /**< Default match reward */
54
60
#define REPEATS_SEARCH_GAP_OPEN 2       /**< Default gap opening cost */
55
61
#define REPEATS_SEARCH_GAP_EXTEND 1     /**< Default gap extension cost */
56
62
#define REPEATS_SEARCH_WORD_SIZE 11     /**< Default word size */
82
88
 * @returns pointer to the second argument to this function (i.e.: tail of the
83
89
 * list)
84
90
 */
 
91
NCBI_XBLAST_EXPORT
85
92
BlastSeqLoc* BlastSeqLocAppend(BlastSeqLoc** head, BlastSeqLoc* node);
86
93
 
87
94
/** Deallocate a single BlastSeqLoc structure and its contents, without
89
96
 * @param node structure to deallocate [in]
90
97
 * @return NULL
91
98
 */
 
99
NCBI_XBLAST_EXPORT
92
100
BlastSeqLoc* BlastSeqLocNodeFree(BlastSeqLoc* node);
93
101
 
94
102
/** Deallocate all BlastSeqLoc objects in a chain.
104
112
 * @return NULL on NULL input or memory allocation failure, else a copy of the
105
113
 * list and its contents
106
114
 */
 
115
NCBI_XBLAST_EXPORT
107
116
BlastSeqLoc* BlastSeqLocListDup(BlastSeqLoc* head);
108
117
 
109
 
/** Converts reverse strand coordinates to forward strand.
110
 
 * @param filter_in BlastSeqLoc to be reversed [in]
 
118
/** Converts reverse strand coordinates to forward strand in place.
 
119
 * @param masks BlastSeqLoc to be reversed [in|out]
111
120
 * @param query_length length of query [in]
112
 
 * @return reversed BlastSeqLoc
113
121
 */
114
122
NCBI_XBLAST_EXPORT
115
 
BlastSeqLoc* BlastSeqLocReverse(const BlastSeqLoc* filter_in, 
116
 
                                Int4 query_length);
 
123
void BlastSeqLocReverse(BlastSeqLoc* masks, Int4 query_length);
117
124
 
118
 
/** Go through all mask locations in one sequence, 
119
 
 * combine any that overlap. Deallocate the memory for the locations that 
120
 
 * were on the list, produce a new (merged) list of locations. 
121
 
 * @param mask_loc The list of masks to be merged [in] 
 
125
/** Go through all mask locations in one sequence and combine any that overlap,
 
126
 * deallocating the unneeded locations.
 
127
 * @param mask_loc The list of masks to be merged (in place) [in|out] 
122
128
 * @param link_value Largest gap size between locations for which they
123
129
 *                   should be linked together [in] 
124
 
 * @return The new (merged) list of masks or NULL if mask_loc is NULL or memory
125
 
 * allocation failure.
126
130
*/
127
131
NCBI_XBLAST_EXPORT
128
 
BlastSeqLoc*
129
 
BlastSeqLocCombine(BlastSeqLoc* mask_loc, Int4 link_value);
 
132
void
 
133
BlastSeqLocCombine(BlastSeqLoc** mask_loc, Int4 link_value);
130
134
 
131
135
/** Allocate memory for a BlastMaskLoc.
132
136
 * @param total number of contexts for which SSeqLocs should be allocated 
168
172
 * @note This function does NOT take into consideration the strands requested
169
173
 * to be searched, which is INCONSISTENT with what the C++ API does.
170
174
 */
 
175
NCBI_XBLAST_EXPORT
171
176
Int2 BlastMaskLocDNAToProtein(BlastMaskLoc* mask_loc, 
172
177
                              const BlastQueryInfo* query_info);
173
178
 
176
181
 * @param mask_loc Mask locations structure [in|out]
177
182
 * @param query_info Query information structure, containing contexts data [in]
178
183
 */
 
184
NCBI_XBLAST_EXPORT
179
185
Int2 BlastMaskLocProteinToDNA(BlastMaskLoc* mask_loc, 
180
186
                              const BlastQueryInfo* query_info);
181
187
 
194
200
 * @param complement_mask Linked list of SSeqRange*s in the concatenated 
195
201
 *                        sequence to be indexed in the lookup table . [out]
196
202
 */
 
203
NCBI_XBLAST_EXPORT
197
204
Int2 
198
205
BLAST_ComplementMaskLocations(EBlastProgramType program_number, 
199
206
   const BlastQueryInfo* query_info, const BlastMaskLoc* mask_loc, 
296
303
                                SBlastFilterOptions* *filtering_options, 
297
304
                                Blast_Message* *blast_message);
298
305
 
 
306
/** Determines whether this is a nucleotide query and whether this a minus strand or not
 
307
 *
 
308
 * @param is_na the query is nucleotide
 
309
 * @param context offset in the QueryInfo array
 
310
 * @return TRUE if this is minus strand
 
311
 */
 
312
static NCBI_INLINE Boolean BlastIsReverseStrand(Boolean is_na, Int4 context)
 
313
{
 
314
     return (is_na && ((context & 1) != 0));
 
315
 
 
316
}
 
317
 
299
318
#ifdef __cplusplus
300
319
}
301
320
#endif
302
 
#endif /* !__BLAST_FILTER__ */
 
321
#endif /* !ALGO_BLAST_CORE__BLAST_FILTER__H */