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
* ===========================================================================
4
4
* PUBLIC DOMAIN NOTICE
32
32
* functions, combine with blast_dust.h?
35
#ifndef __BLAST_FILTER__
36
#define __BLAST_FILTER__
35
#ifndef ALGO_BLAST_CORE__BLAST_FILTER__H
36
#define ALGO_BLAST_CORE__BLAST_FILTER__H
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>
46
49
/** BLASTNA element used to mask bases in BLAST */
47
51
extern const Uint1 kNuclMask;
48
52
/** NCBISTDAA element used to mask residues in BLAST */
49
54
extern const Uint1 kProtMask;
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
85
92
BlastSeqLoc* BlastSeqLocAppend(BlastSeqLoc** head, BlastSeqLoc* node);
87
94
/** Deallocate a single BlastSeqLoc structure and its contents, without
104
112
* @return NULL on NULL input or memory allocation failure, else a copy of the
105
113
* list and its contents
107
116
BlastSeqLoc* BlastSeqLocListDup(BlastSeqLoc* head);
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
114
122
NCBI_XBLAST_EXPORT
115
BlastSeqLoc* BlastSeqLocReverse(const BlastSeqLoc* filter_in,
123
void BlastSeqLocReverse(BlastSeqLoc* masks, Int4 query_length);
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.
127
131
NCBI_XBLAST_EXPORT
129
BlastSeqLocCombine(BlastSeqLoc* mask_loc, Int4 link_value);
133
BlastSeqLocCombine(BlastSeqLoc** mask_loc, Int4 link_value);
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.
171
176
Int2 BlastMaskLocDNAToProtein(BlastMaskLoc* mask_loc,
172
177
const BlastQueryInfo* query_info);
176
181
* @param mask_loc Mask locations structure [in|out]
177
182
* @param query_info Query information structure, containing contexts data [in]
179
185
Int2 BlastMaskLocProteinToDNA(BlastMaskLoc* mask_loc,
180
186
const BlastQueryInfo* query_info);
194
200
* @param complement_mask Linked list of SSeqRange*s in the concatenated
195
201
* sequence to be indexed in the lookup table . [out]
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);
306
/** Determines whether this is a nucleotide query and whether this a minus strand or not
308
* @param is_na the query is nucleotide
309
* @param context offset in the QueryInfo array
310
* @return TRUE if this is minus strand
312
static NCBI_INLINE Boolean BlastIsReverseStrand(Boolean is_na, Int4 context)
314
return (is_na && ((context & 1) != 0));
299
318
#ifdef __cplusplus
302
#endif /* !__BLAST_FILTER__ */
321
#endif /* !ALGO_BLAST_CORE__BLAST_FILTER__H */