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

Go to the SVN repository for this file.

1 /* $Id: blast_traceback.h 89480 2020-04-02 12:32:43Z fongah2 $
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  *
27  */
28 
29 /** @file blast_traceback.h
30  * Functions to do gapped alignment with traceback
31  */
32 
33 #ifndef ALGO_BLAST_CORE__BLAST_TRACEBACK__H
34 #define ALGO_BLAST_CORE__BLAST_TRACEBACK__H
35 
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 /** Compute gapped alignment with traceback for all HSPs from a single
55  * query/subject sequence pair.
56  * Final e-values are calculated here, except when sum statistics is used,
57  * in which case this is done in file link_hsps.c:
58  * @sa { BLAST_LinkHsps }
59  * @param program_number Type of BLAST program [in]
60  * @param hsp_list List of HSPs [in]
61  * @param query_blk The query sequence [in]
62  * @param subject_blk The subject sequence [in]
63  * @param query_info Query information, needed to get pointer to the
64  * start of this query within the concatenated sequence [in]
65  * @param gap_align Auxiliary structure used for gapped alignment [in]
66  * @param sbp Statistical parameters [in]
67  * @param score_params Scoring parameters (esp. scale factor) [in]
68  * @param ext_options Gapped extension options [in]
69  * @param hit_params Hit saving parameters [in]
70  * @param gen_code_string specifies genetic code [in]
71  * @param fence_hit True is returned here if overrun is detected. [in|out]
72  */
74 Int2
76  BlastHSPList* hsp_list, const BLAST_SequenceBlk* query_blk,
77  BLAST_SequenceBlk* subject_blk, const BlastQueryInfo* query_info,
78  BlastGapAlignStruct* gap_align, const BlastScoreBlk* sbp,
79  const BlastScoringParameters* score_params,
80  const BlastExtensionOptions* ext_options,
81  const BlastHitSavingParameters* hit_params,
82  const Uint1* gen_code_string,
83  Boolean * fence_hit);
84 
85 /** Get the subject sequence encoding type for the traceback,
86  * given a program number.
87  */
90 
91 /** Modifies the HSP data after the final gapped alignment.
92  * Input includes only data that likely needs modification. This function
93  * could be static in blast_traceback.c, but for a unit test which checks its
94  * functionality.
95  * @param gap_align Structure containing gapped alignment information [in]
96  * @param hsp Original HSP from the preliminary stage [in] [out]
97  */
99 Int2
101 
102 
103 /** Given the preliminary alignment results from a database search, redo
104  * the gapped alignment with traceback, if it has not yet been done.
105  * @param program_number Type of the BLAST program [in]
106  * @param hsp_stream A stream for reading HSP lists [in]
107  * @param query The query sequence [in]
108  * @param query_info Information about the query [in]
109  * @param seq_src Source of subject sequences [in]
110  * @param gap_align The auxiliary structure for gapped alignment [in]
111  * @param score_params Scoring parameters (esp. scale factor) [in]
112  * @param ext_params Gapped extension parameters [in]
113  * @param hit_params Parameters for saving hits. Can change if not a
114  database search [in]
115  * @param eff_len_params Parameters for recalculating effective search
116  * space. Can change if not a database search. [in]
117  * @param db_options Options containing database genetic code string [in]
118  * @param psi_options Options for iterative searches [in]
119  * @param rps_info RPS BLAST auxiliary data structure [in]
120  * @param pattern_blk PHI BLAST auxiliary data structure [in]
121  * @param results All results from the BLAST search [out]
122  * @param interrupt_search function callback to allow interruption of BLAST
123  * search [in, optional]
124  * @param progress_info contains information about the progress of the current
125  * BLAST search [in|out]
126  * @return nonzero indicates failure, otherwise zero
127  */
129 Int2
131  BlastHSPStream* hsp_stream, BLAST_SequenceBlk* query,
132  BlastQueryInfo* query_info,
133  const BlastSeqSrc* seq_src,
134  BlastGapAlignStruct* gap_align, BlastScoringParameters* score_params,
135  const BlastExtensionParameters* ext_params,
136  BlastHitSavingParameters* hit_params,
137  BlastEffectiveLengthsParameters* eff_len_params,
138  const BlastDatabaseOptions* db_options,
139  const PSIBlastOptions* psi_options, const BlastRPSInfo* rps_info,
141  TInterruptFnPtr interrupt_search, SBlastProgress* progress_info);
142 
143 /** Entry point from the API level to perform the traceback stage of a BLAST
144  * search, given the source of HSP lists, obtained from the preliminary stage.
145  * The parameters internal to the engine are calculated here independently of
146  * the similar calculation in the preliminary stage, effectively making the two
147  * stages independent of each other.
148  * @param program BLAST program type [in]
149  * @param query Query sequence(s) structure [in]
150  * @param query_info Additional query information [in]
151  * @param seq_src Source of subject sequences [in]
152  * @param score_options Scoring options [in]
153  * @param ext_options Word extension options, needed for cutoff scores
154  * calculation only [in]
155  * @param hit_options Hit saving options [in]
156  * @param eff_len_options Options for calculating effective lengths [in]
157  * @param db_options Database options (database genetic code) [in]
158  * @param psi_options PSI BLAST options [in]
159  * @param sbp Scoring block with statistical parameters and matrix [in]
160  * @param hsp_stream Source of HSP lists. [in]
161  * @param rps_info RPS database information structure [in]
162  * @param pattern_blk PHI BLAST auxiliary data structure [in]
163  * @param results Where to save the results after traceback. [out]
164  * @param num_threads Maximum number of threads to spawn [in]
165  */
167 Int2
169  BLAST_SequenceBlk* query, BlastQueryInfo* query_info,
170  const BlastSeqSrc* seq_src, const BlastScoringOptions* score_options,
171  const BlastExtensionOptions* ext_options,
172  const BlastHitSavingOptions* hit_options,
173  const BlastEffectiveLengthsOptions* eff_len_options,
174  const BlastDatabaseOptions* db_options,
175  const PSIBlastOptions* psi_options, BlastScoreBlk* sbp,
176  BlastHSPStream* hsp_stream, const BlastRPSInfo* rps_info,
178  size_t num_threads);
179 
180 
181 /** Entry point from the API level to perform the traceback stage of a BLAST
182  * search, given the source of HSP lists, obtained from the preliminary stage.
183  * The parameters internal to the engine are calculated here independently of
184  * the similar calculation in the preliminary stage, effectively making the two
185  * stages independent of each other.
186  * @param program BLAST program type [in]
187  * @param query Query sequence(s) structure [in]
188  * @param query_info Additional query information [in]
189  * @param seq_src Source of subject sequences [in]
190  * @param score_options Scoring options [in]
191  * @param ext_options Word extension options, needed for cutoff scores
192  * calculation only [in]
193  * @param hit_options Hit saving options [in]
194  * @param eff_len_options Options for calculating effective lengths [in]
195  * @param db_options Database options (database genetic code) [in]
196  * @param psi_options PSI BLAST options [in]
197  * @param sbp Scoring block with statistical parameters and matrix [in]
198  * @param hsp_stream Source of HSP lists. [in]
199  * @param rps_info RPS database information structure [in]
200  * @param pattern_blk PHI BLAST auxiliary data structure [in]
201  * @param results Where to save the results after traceback. [out]
202  * @param interrupt_search User specified function to interrupt search [in]
203  * @param progress_info User supplied data structure to aid interrupt [in]
204  * @param num_threads Maximum number of threads to spawn [in]
205  */
207 Int2
209  BLAST_SequenceBlk* query, BlastQueryInfo* query_info,
210  const BlastSeqSrc* seq_src, const BlastScoringOptions* score_options,
211  const BlastExtensionOptions* ext_options,
212  const BlastHitSavingOptions* hit_options,
213  const BlastEffectiveLengthsOptions* eff_len_options,
214  const BlastDatabaseOptions* db_options,
215  const PSIBlastOptions* psi_options, BlastScoreBlk* sbp,
216  BlastHSPStream* hsp_stream, const BlastRPSInfo* rps_info,
218  TInterruptFnPtr interrupt_search, SBlastProgress* progress_info,
219  size_t num_threads);
220 
224  BlastSeqSrc* seq_src,
225  const BlastHSPList** hsp_list,
226  Int4 num_hsplists);
227 #ifdef __cplusplus
228 }
229 #endif
230 #endif /* !ALGO_BLAST_CORE__BLAST_TRACEBACK__H */
Definitions used throughout BLAST.
Boolean(* TInterruptFnPtr)(SBlastProgress *progress_info)
Prototype for function pointer to determine whether the BLAST search should proceed or be interrupted...
Definition: blast_def.h:354
Declarations of static arrays used to define some NCBI encodings to be used in a toolkit independent ...
Defines to provide correct exporting from BLAST DLL in Windows.
#define NCBI_XBLAST_EXPORT
NULL operations for other cases.
Definition: blast_export.h:65
Structures and functions prototypes used for BLAST gapped extension.
Structures and API used for saving BLAST hits.
Declaration of ADT to save and retrieve lists of HSPs in the BLAST engine.
The structures and functions in blast_options.
Structure and function definitions for BLAST parameter structures, which are internal to the CORE of ...
Definitions for various programs supported by core BLAST.
EBlastProgramType
Defines the engine's notion of the different applications of the BLAST algorithm.
Definition: blast_program.h:72
Declaration of ADT to retrieve sequences for the BLAST engine.
Int2 Blast_HSPUpdateWithTraceback(BlastGapAlignStruct *gap_align, BlastHSP *hsp)
Modifies the HSP data after the final gapped alignment.
Int2 Blast_RunTracebackSearchWithInterrupt(EBlastProgramType program, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, const BlastSeqSrc *seq_src, const BlastScoringOptions *score_options, const BlastExtensionOptions *ext_options, const BlastHitSavingOptions *hit_options, const BlastEffectiveLengthsOptions *eff_len_options, const BlastDatabaseOptions *db_options, const PSIBlastOptions *psi_options, BlastScoreBlk *sbp, BlastHSPStream *hsp_stream, const BlastRPSInfo *rps_info, SPHIPatternSearchBlk *pattern_blk, BlastHSPResults **results, TInterruptFnPtr interrupt_search, SBlastProgress *progress_info, size_t num_threads)
Entry point from the API level to perform the traceback stage of a BLAST search, given the source of ...
BlastSeqSrcSetRangesArg * BLAST_SetupPartialFetching(EBlastProgramType program_number, BlastSeqSrc *seq_src, const BlastHSPList **hsp_list, Int4 num_hsplists)
Attempts to set up partial fetching, if it fails (e.g.
EBlastEncoding Blast_TracebackGetEncoding(EBlastProgramType program_number)
Get the subject sequence encoding type for the traceback, given a program number.
Int2 BLAST_ComputeTraceback(EBlastProgramType program_number, BlastHSPStream *hsp_stream, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, const BlastSeqSrc *seq_src, BlastGapAlignStruct *gap_align, BlastScoringParameters *score_params, const BlastExtensionParameters *ext_params, BlastHitSavingParameters *hit_params, BlastEffectiveLengthsParameters *eff_len_params, const BlastDatabaseOptions *db_options, const PSIBlastOptions *psi_options, const BlastRPSInfo *rps_info, SPHIPatternSearchBlk *pattern_blk, BlastHSPResults **results, TInterruptFnPtr interrupt_search, SBlastProgress *progress_info)
Given the preliminary alignment results from a database search, redo the gapped alignment with traceb...
Int2 Blast_RunTracebackSearch(EBlastProgramType program, BLAST_SequenceBlk *query, BlastQueryInfo *query_info, const BlastSeqSrc *seq_src, const BlastScoringOptions *score_options, const BlastExtensionOptions *ext_options, const BlastHitSavingOptions *hit_options, const BlastEffectiveLengthsOptions *eff_len_options, const BlastDatabaseOptions *db_options, const PSIBlastOptions *psi_options, BlastScoreBlk *sbp, BlastHSPStream *hsp_stream, const BlastRPSInfo *rps_info, SPHIPatternSearchBlk *pattern_blk, BlastHSPResults **results, size_t num_threads)
Entry point from the API level to perform the traceback stage of a BLAST search, given the source of ...
Int2 Blast_TracebackFromHSPList(EBlastProgramType program_number, BlastHSPList *hsp_list, const BLAST_SequenceBlk *query_blk, BLAST_SequenceBlk *subject_blk, const BlastQueryInfo *query_info, BlastGapAlignStruct *gap_align, const BlastScoreBlk *sbp, const BlastScoringParameters *score_params, const BlastExtensionOptions *ext_options, const BlastHitSavingParameters *hit_params, const Uint1 *gen_code_string, Boolean *fence_hit)
Compute gapped alignment with traceback for all HSPs from a single query/subject sequence pair.
EBlastEncoding
Different types of sequence encodings for sequence retrieval from the BLAST database.
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
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
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
Uint1 Boolean
bool replacment for C
Definition: ncbi_std.h:94
Functions for finding pattern matches in sequence (PHI-BLAST).
static int * results[]
Structure to hold a sequence.
Definition: blast_def.h:242
Options used to create the ReadDBFILE structure Include database name and various information for res...
Options for setting up effective lengths and search spaces.
Parameters for setting up effective lengths and search spaces.
Options used for gapped extension These include: a.
Computed values used as parameters for gapped alignments.
Structure supporting the gapped alignment.
The structure to hold all HSPs for a given sequence after the gapped alignment.
Definition: blast_hits.h:153
The structure to contain all BLAST results, for multiple queries.
Definition: blast_hits.h:183
Default implementation of BlastHSPStream.
Structure holding all information about an HSP.
Definition: blast_hits.h:126
Options used when evaluating and saving hits These include: a.
Parameter block that contains a pointer to BlastHitSavingOptions and the values derived from it.
The query related information.
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
Scoring options block Used to produce the BlastScoreBlk structure This structure may be needed for lo...
Scoring parameters block Contains scoring-related information that is actually used for the blast sea...
Structure used as the argument to function SetRanges.
Definition: blast_seqsrc.h:208
Complete type definition of Blast Sequence Source ADT.
Definition: blast_seqsrc.c:43
Options used in protein BLAST only (PSI, PHI, RPS and translated BLAST) Some of these possibly should...
Progress monitoring structure.
Definition: blast_def.h:341
Structure containing all auxiliary information needed in a pattern search.
Definition: pattern.h:155
static string query
Modified on Fri Sep 20 14:57:07 2024 by modify_doxy.py rev. 669887