NCBI C++ ToolKit
na_ungapped.h
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: na_ungapped.h 73100 2016-06-20 15:45:40Z boratyng $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Author: Ilya Dondoshansky
27  *
28  */
29 
30 /** @file na_ungapped.h
31  * Nucleotide ungapped extension code.
32  */
33 
34 #ifndef ALGO_BLAST_CORE__NA_UNGAPPED__H
35 #define ALGO_BLAST_CORE__NA_UNGAPPED__H
36 
45 
47 
48 #ifdef __cplusplus
49 extern "C" {
50 #endif
51 
52 /** Signature of function used to compute ungapped alignments */
53 typedef Int4 (*TNaExtendFunction)(const BlastOffsetPair* offset_pairs,
54  Int4 num_hits,
55  const BlastInitialWordParameters* word_params,
56  LookupTableWrap* lookup_wrap,
58  Int4** matrix, BlastQueryInfo* query_info,
59  Blast_ExtendWord* ewp,
60  BlastInitHitList* init_hitlist,
61  Int4 range);
62 
63 /** Find all words for a given subject sequence and perform
64  * ungapped extensions, assuming ordinary blastn.
65  * @param subject The subject sequence [in]
66  * @param query The query sequence (needed only for the discontiguous word
67  * case) [in]
68  * @param query_info concatenated query information [in]
69  * @param lookup_wrap Pointer to the (wrapper) lookup table structure. Only
70  * traditional BLASTn lookup table supported. [in]
71  * @param matrix The scoring matrix [in]
72  * @param word_params Parameters for the initial word extension [in]
73  * @param ewp Structure needed for initial word information maintenance [in]
74  * @param offset_pairs Array for storing query and subject offsets. [in]
75  * @param max_hits size of offset arrays [in]
76  * @param init_hitlist Structure to hold all hits information. Has to be
77  * allocated up front [out]
78  * @param ungapped_stats Various hit counts. Not filled if NULL [out]
79  */
83  BlastQueryInfo* query_info,
84  LookupTableWrap* lookup_wrap,
85  Int4** matrix,
86  const BlastInitialWordParameters* word_params,
87  Blast_ExtendWord* ewp,
88  BlastOffsetPair* offset_pairs,
89  Int4 max_hits,
90  BlastInitHitList* init_hitlist,
91  BlastUngappedStats* ungapped_stats);
92 
93 
94 /** Choose the best routine to use for creating ungapped alignments
95  * @param lookup_wrap Lookup table that influences routine choice [in][out]
96  */
98 void BlastChooseNaExtend(LookupTableWrap *lookup_wrap);
99 
100 
101 /* A structure to hold several lists of word hits for groups of queries */
102 typedef struct MapperWordHits
103 {
104  BlastOffsetPair** pair_arrays; /**< lists of word hits */
105  Int4* num; /**< number of hits in the list */
106  Int4 num_arrays; /**< number of pair_arrays */
107  Int4 array_size; /**< size of each array */
108  Int4* last_diag; /**< diagnal for the last word hit for each
109  query context */
110  Int4* last_pos; /**< subject position for the last word hit
111  for each query context */
112 
113  Int4 divisor; /**< divisor used to find pair_arrays index
114  based on query offset */
116 
119  const BlastQueryInfo* query_info);
120 
121 
123 Int2
126  BlastQueryInfo * query_info,
127  LookupTableWrap * lookup_wrap,
128  const BlastInitialWordParameters * word_params,
129  const BlastScoringParameters* score_params,
130  const BlastHitSavingParameters* hit_params,
131  BlastOffsetPair * offset_pairs,
132  MapperWordHits* word_hits,
133  Int4 max_hits,
134  BlastGapAlignStruct* gap_align,
135  BlastInitHitList* init_hitlist,
136  BlastHSPList** hsp_list_ptr,
137  BlastUngappedStats * ungapped_stats,
138  BlastGappedStats* gapped_stats);
139 
140 
145  BlastQueryInfo * query_info,
146  LookupTableWrap * lookup_wrap,
147  const BlastInitialWordParameters * word_params,
148  const BlastScoringParameters* score_params,
149  const BlastHitSavingParameters* hit_params,
150  BlastOffsetPair * offset_pairs,
151  MapperWordHits* word_hits,
152  Int4 max_hits,
153  BlastGapAlignStruct* gap_align,
154  BlastInitHitList* init_hitlist,
155  BlastHSPList** hsp_list,
156  BlastUngappedStats* ungapped_stats,
157  BlastGappedStats* gapped_stats);
158 
159 
160 
161 #ifdef __cplusplus
162 }
163 #endif
164 #endif /* !ALGO_BLAST_CORE__NA_UNGAPPED__H */
Definitions used throughout BLAST.
Various diagnostics (hit counts, etc.) returned from the BLAST engine.
#define NCBI_XBLAST_EXPORT
NULL operations for other cases.
Definition: blast_export.h:65
Ungapped extension structures that are common to nucleotide and protein extension routines.
Structures and functions prototypes used for BLAST gapped extension.
Structures and API used for saving BLAST hits.
Structure and function definitions for BLAST parameter structures, which are internal to the CORE of ...
Definitions and functions associated with the BlastQueryInfo structure.
int16_t Int2
2-byte (16-bit) signed integer
Definition: ncbitype.h:100
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
Wrapper for all lookup tables used in BLAST.
Int4(* TNaExtendFunction)(const BlastOffsetPair *offset_pairs, Int4 num_hits, const BlastInitialWordParameters *word_params, LookupTableWrap *lookup_wrap, BLAST_SequenceBlk *query, BLAST_SequenceBlk *subject, Int4 **matrix, BlastQueryInfo *query_info, Blast_ExtendWord *ewp, BlastInitHitList *init_hitlist, Int4 range)
Signature of function used to compute ungapped alignments.
Definition: na_ungapped.h:53
void BlastChooseNaExtend(LookupTableWrap *lookup_wrap)
Choose the best routine to use for creating ungapped alignments.
Definition: na_ungapped.c:1791
Int2 BlastNaWordFinder(BLAST_SequenceBlk *subject, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, LookupTableWrap *lookup_wrap, Int4 **matrix, const BlastInitialWordParameters *word_params, Blast_ExtendWord *ewp, BlastOffsetPair *offset_pairs, Int4 max_hits, BlastInitHitList *init_hitlist, BlastUngappedStats *ungapped_stats)
Find all words for a given subject sequence and perform ungapped extensions, assuming ordinary blastn...
Definition: na_ungapped.c:1597
Int2 JumperNaWordFinder(BLAST_SequenceBlk *subject, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, LookupTableWrap *lookup_wrap, const BlastInitialWordParameters *word_params, const BlastScoringParameters *score_params, const BlastHitSavingParameters *hit_params, BlastOffsetPair *offset_pairs, MapperWordHits *word_hits, Int4 max_hits, BlastGapAlignStruct *gap_align, BlastInitHitList *init_hitlist, BlastHSPList **hsp_list_ptr, BlastUngappedStats *ungapped_stats, BlastGappedStats *gapped_stats)
Definition: na_ungapped.c:1930
struct MapperWordHits MapperWordHits
MapperWordHits * MapperWordHitsFree(MapperWordHits *wh)
Definition: na_ungapped.c:1839
MapperWordHits * MapperWordHitsNew(const BLAST_SequenceBlk *query, const BlastQueryInfo *query_info)
Definition: na_ungapped.c:1867
Int2 ShortRead_IndexedWordFinder(BLAST_SequenceBlk *subject, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, LookupTableWrap *lookup_wrap, const BlastInitialWordParameters *word_params, const BlastScoringParameters *score_params, const BlastHitSavingParameters *hit_params, BlastOffsetPair *offset_pairs, MapperWordHits *word_hits, Int4 max_hits, BlastGapAlignStruct *gap_align, BlastInitHitList *init_hitlist, BlastHSPList **hsp_list, BlastUngappedStats *ungapped_stats, BlastGappedStats *gapped_stats)
Definition: na_ungapped.c:2162
range(_Ty, _Ty) -> range< _Ty >
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
Structure to hold a sequence.
Definition: blast_def.h:242
Structure supporting the gapped alignment.
Structure containing hit counts from the gapped stage of a BLAST search.
The structure to hold all HSPs for a given sequence after the gapped alignment.
Definition: blast_hits.h:153
Parameter block that contains a pointer to BlastHitSavingOptions and the values derived from it.
Structure to hold all initial HSPs for a given subject sequence.
Definition: blast_extend.h:158
Parameter block that contains a pointer to BlastInitialWordOptions and the values derived from it.
The query related information.
Scoring parameters block Contains scoring-related information that is actually used for the blast sea...
Structure containing hit counts from the ungapped stage of a BLAST search.
Structure for keeping initial word extension information.
Definition: blast_extend.h:109
Wrapper structure for different types of BLAST lookup tables.
Definition: lookup_wrap.h:50
Int4 num_arrays
number of pair_arrays
Definition: na_ungapped.h:106
BlastOffsetPair ** pair_arrays
lists of word hits
Definition: na_ungapped.h:104
Int4 * last_diag
diagnal for the last word hit for each query context
Definition: na_ungapped.h:108
Int4 array_size
size of each array
Definition: na_ungapped.h:107
Int4 * last_pos
subject position for the last word hit for each query context
Definition: na_ungapped.h:110
Int4 * num
number of hits in the list
Definition: na_ungapped.h:105
Int4 divisor
divisor used to find pair_arrays index based on query offset
Definition: na_ungapped.h:113
static string subject
static string query
This symbol enables the verbose option in makeblastdb and other BLAST+ search command line applicatio...
Definition: blast_def.h:141
Modified on Sun Jun 23 05:17:12 2024 by modify_doxy.py rev. 669887