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

Go to the SVN repository for this file.

1 /* $Id: lookup_wrap.h 75675 2016-12-06 15:28:14Z 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 lookup_wrap.h
31  * Wrapper for all lookup tables used in BLAST
32  */
33 
34 #ifndef ALGO_BLAST_CORE__LOOKUP_WRAP__H
35 #define ALGO_BLAST_CORE__LOOKUP_WRAP__H
36 
42 
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 /** Wrapper structure for different types of BLAST lookup tables */
50 typedef struct LookupTableWrap {
51  ELookupTableType lut_type; /**< What kind of a lookup table it is? */
52  void* lut; /**< Pointer to the actual lookup table structure */
53  void* read_indexed_db; /**< function used to retrieve hits
54  from an indexed database */
55  void* check_index_oid; /**< function used to check if seeds
56  for a given oid are present */
57  void * end_search_indication; /**< function used to report that
58  a thread is done iterating over
59  the database in preliminary
60  search */
61  void* lookup_callback; /**< function used to look up an
62  index->q_off pair */
64 
65 /** Function pointer type to check the presence of index->q_off pair */
67 
68 /** Create the lookup table for all query words.
69  * @param query The query sequence [in]
70  * @param lookup_options What kind of lookup table to build? [in]
71  * @param query_options options for query setup [in]
72  * @param lookup_segments Locations on query to be used for lookup table
73  * construction [in]
74  * @param sbp Scoring block containing matrix [in]
75  * @param lookup_wrap_ptr The initialized lookup table [out]
76  * @param rps_info Structure containing RPS blast setup information [in]
77  * @param error_msg message with warning or errors [in|out]
78  * @param seqsrc Database sequences [in]
79  */
82  const LookupTableOptions* lookup_options,
83  const QuerySetUpOptions* query_options,
84  BlastSeqLoc* lookup_segments, BlastScoreBlk* sbp,
85  LookupTableWrap** lookup_wrap_ptr, const BlastRPSInfo *rps_info,
86  Blast_Message* *error_msg,
87  BlastSeqSrc* seqsrc);
88 
89 /** Create the lookup table for all query words (possibly multithreaded,
90  depends on implementation).
91  * @param query The query sequence [in]
92  * @param lookup_options What kind of lookup table to build? [in]
93  * @param query_options options for query setup [in]
94  * @param lookup_segments Locations on query to be used for lookup table
95  * construction [in]
96  * @param sbp Scoring block containing matrix [in]
97  * @param lookup_wrap_ptr The initialized lookup table [out]
98  * @param rps_info Structure containing RPS blast setup information [in]
99  * @param error_msg message with warning or errors [in|out]
100  * @param seqsrc Database sequences [in]
101  * @param num_threads Number of threads to use [in]
102  */
105  const LookupTableOptions* lookup_options,
106  const QuerySetUpOptions* query_options,
107  BlastSeqLoc* lookup_segments, BlastScoreBlk* sbp,
108  LookupTableWrap** lookup_wrap_ptr, const BlastRPSInfo *rps_info,
109  Blast_Message* *error_msg,
110  BlastSeqSrc* seqsrc,
111  Uint4 num_threads);
112 
113 
114 /** Deallocate memory for the lookup table */
117 
118 /** Default size of offset arrays filled in a single ScanSubject call. */
119 #define OFFSET_ARRAY_SIZE 4096
120 
121 /** Determine the size of the offsets arrays to be filled by
122  * the ScanSubject function.
123  */
126 
127 #ifdef __cplusplus
128 }
129 #endif
130 #endif /* !ALGO_BLAST_CORE__LOOKUP_WRAP__H */
Definitions used throughout BLAST.
#define NCBI_XBLAST_EXPORT
NULL operations for other cases.
Definition: blast_export.h:65
The structures and functions in blast_options.
ELookupTableType
Types of the lookup table.
RPS BLAST structure definitions.
Declaration of ADT to retrieve sequences for the BLAST engine.
Definitions and prototypes used by blast_stat.c to calculate BLAST statistics.
static int lookup(const char *name, const struct lookup_int *table)
Definition: attributes.c:50
#define Boolean
Definition: ncbistd.hpp:136
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
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
Int2 LookupTableWrapInit_MT(BLAST_SequenceBlk *query, const LookupTableOptions *lookup_options, const QuerySetUpOptions *query_options, BlastSeqLoc *lookup_segments, BlastScoreBlk *sbp, LookupTableWrap **lookup_wrap_ptr, const BlastRPSInfo *rps_info, Blast_Message **error_msg, BlastSeqSrc *seqsrc, Uint4 num_threads)
Create the lookup table for all query words (possibly multithreaded, depends on implementation).
Definition: lookup_wrap.c:61
Int4 GetOffsetArraySize(LookupTableWrap *lookup)
Determine the size of the offsets arrays to be filled by the ScanSubject function.
Definition: lookup_wrap.c:255
LookupTableWrap * LookupTableWrapFree(LookupTableWrap *lookup)
Deallocate memory for the lookup table.
Definition: lookup_wrap.c:197
Int2 LookupTableWrapInit(BLAST_SequenceBlk *query, const LookupTableOptions *lookup_options, const QuerySetUpOptions *query_options, BlastSeqLoc *lookup_segments, BlastScoreBlk *sbp, LookupTableWrap **lookup_wrap_ptr, const BlastRPSInfo *rps_info, Blast_Message **error_msg, BlastSeqSrc *seqsrc)
Create the lookup table for all query words.
Definition: lookup_wrap.c:47
struct LookupTableWrap LookupTableWrap
Wrapper structure for different types of BLAST lookup tables.
Boolean(* T_Lookup_Callback)(const LookupTableWrap *, Int4, Int4)
Function pointer type to check the presence of index->q_off pair.
Definition: lookup_wrap.h:66
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
Structure to hold a sequence.
Definition: blast_def.h:242
The RPS engine uses this structure to access all of the RPS blast related data (assumed to be collect...
Definition: blast_rps.h:120
Structure used for scoring calculations.
Definition: blast_stat.h:177
Used to hold a set of positions, mostly used for filtering.
Definition: blast_def.h:204
Complete type definition of Blast Sequence Source ADT.
Definition: blast_seqsrc.c:43
Structure to hold the a message from the core of the BLAST engine.
Definition: blast_message.h:70
Options needed to construct a lookup table Also needed: query sequence and query length.
Wrapper structure for different types of BLAST lookup tables.
Definition: lookup_wrap.h:50
void * lookup_callback
function used to look up an index->q_off pair
Definition: lookup_wrap.h:61
void * lut
Pointer to the actual lookup table structure.
Definition: lookup_wrap.h:52
void * end_search_indication
function used to report that a thread is done iterating over the database in preliminary search
Definition: lookup_wrap.h:57
void * check_index_oid
function used to check if seeds for a given oid are present
Definition: lookup_wrap.h:55
ELookupTableType lut_type
What kind of a lookup table it is?
Definition: lookup_wrap.h:51
void * read_indexed_db
function used to retrieve hits from an indexed database
Definition: lookup_wrap.h:53
Options required for setting up the query sequence.
static string query
Modified on Sun Jun 16 04:37:04 2024 by modify_doxy.py rev. 669887