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

Go to the SVN repository for this file.

1 /* $Id: blast_diagnostics.h 50064 2011-06-13 18:22:23Z camacho $
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_diagnostics.h
30  * Various diagnostics (hit counts, etc.) returned from the BLAST engine
31  */
32 
33 #ifndef ALGO_BLAST_CORE__BLAST_DIAGNOSTICS__H
34 #define ALGO_BLAST_CORE__BLAST_DIAGNOSTICS__H
35 
37 #include <connect/ncbi_core.h>
38 
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
43 /** Structure holding raw cutoff and gap-x-drop values. */
44 typedef struct BlastRawCutoffs {
45  Int4 x_drop_ungapped; /**< Raw value of the x-dropoff for ungapped
46  extensions */
47  Int4 x_drop_gap; /**< Raw value of the x-dropoff for preliminary gapped
48  extensions */
49  Int4 x_drop_gap_final; /**< Raw value of the x-dropoff for gapped
50  extensions with traceback */
51  Int4 ungapped_cutoff; /**< Minimal raw score for starting gapped extension */
52  Int4 cutoff_score; /**< Cutoff score corresponding to given evalue. */
54 
55 /** Structure containing hit counts from the ungapped stage of a BLAST
56  * search */
57 typedef struct BlastUngappedStats {
58  Int8 lookup_hits; /**< Number of successful lookup table hits */
59  Int4 num_seqs_lookup_hits; /**< Number of sequences which had at least one
60  lookup table hit. */
61  Int4 init_extends; /**< Number of initial words found and extended */
62  Int4 good_init_extends; /**< Number of successful initial extensions,
63  i.e. number of HSPs saved after ungapped stage.*/
64  Int4 num_seqs_passed; /**< Number of sequences with at least one HSP saved
65  after ungapped stage. */
67 
68 /** Structure containing hit counts from the gapped stage of a BLAST
69  * search */
70 typedef struct BlastGappedStats {
71  Int4 seqs_ungapped_passed; /**< Number of sequences with top HSP
72  after ungapped extension passing the
73  e-value threshold. */
74  Int4 extensions; /**< Total number of gapped extensions performed. */
75  Int4 good_extensions; /**< Number of HSPs below the e-value threshold after
76  gapped extension */
77  Int4 num_seqs_passed; /**< Number of sequences with top HSP passing the
78  e-value threshold. */
80 
81 /** Return statistics from the BLAST search */
82 typedef struct BlastDiagnostics {
83  BlastUngappedStats* ungapped_stat; /**< Ungapped extension counts */
84  BlastGappedStats* gapped_stat; /**< Gapped extension counts */
85  BlastRawCutoffs* cutoffs; /**< Various raw values for the cutoffs */
86  MT_LOCK mt_lock; /**< Mutex for updating diagnostics data in a
87  multi-threaded search. */
89 
90 /** Free the BlastDiagnostics structure and all substructures. */
92 
93 /** Initialize the BlastDiagnostics structure and all its substructures. */
95 
96 /** Free the BlastDiagnostics structure and all substructures. */
98 
99 /** Initialize the BlastDiagnostics structure for a multi-threaded search.
100  * @param mt_lock Mutex locking mechanism to be used for updates. [in]
101  */
103 
104 /** Fill data in the ungapped hits diagnostics structure */
105 void Blast_UngappedStatsUpdate(BlastUngappedStats* ungapped_stats,
106  Int4 total_hits, Int4 extended_hits,
107  Int4 saved_hits);
108 
109 /** In a multi-threaded run, update global diagnostics data with the data
110  * coming from one of the preliminary search threads.
111  * @param diag_global Diagnostics for the entire BLAST search [in] [out]
112  * @param diag_local Diagnostics from one of the preliminary search threads [in]
113  */
114 void
116  BlastDiagnostics* diag_local);
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 #endif /* !ALGO_BLAST_CORE__BLAST_DIAGNOSTICS__H */
struct BlastGappedStats BlastGappedStats
Structure containing hit counts from the gapped stage of a BLAST search.
BlastDiagnostics * Blast_DiagnosticsInitMT(MT_LOCK mt_lock)
Initialize the BlastDiagnostics structure for a multi-threaded search.
void Blast_UngappedStatsUpdate(BlastUngappedStats *ungapped_stats, Int4 total_hits, Int4 extended_hits, Int4 saved_hits)
Fill data in the ungapped hits diagnostics structure.
BlastDiagnostics * Blast_DiagnosticsInit(void)
Initialize the BlastDiagnostics structure and all its substructures.
struct BlastRawCutoffs BlastRawCutoffs
Structure holding raw cutoff and gap-x-drop values.
struct BlastDiagnostics BlastDiagnostics
Return statistics from the BLAST search.
BlastDiagnostics * Blast_DiagnosticsFree(BlastDiagnostics *diagnostics)
Free the BlastDiagnostics structure and all substructures.
struct BlastUngappedStats BlastUngappedStats
Structure containing hit counts from the ungapped stage of a BLAST search.
BlastDiagnostics * Blast_DiagnosticsCopy(const BlastDiagnostics *diagnostics)
Free the BlastDiagnostics structure and all substructures.
void Blast_DiagnosticsUpdate(BlastDiagnostics *diag_global, BlastDiagnostics *diag_local)
In a multi-threaded run, update global diagnostics data with the data coming from one of the prelimin...
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
int64_t Int8
8-byte (64-bit) signed integer
Definition: ncbitype.h:104
Type and macro definitions from C toolkit that are not defined in C++ toolkit.
Return statistics from the BLAST search.
BlastUngappedStats * ungapped_stat
Ungapped extension counts.
BlastRawCutoffs * cutoffs
Various raw values for the cutoffs.
BlastGappedStats * gapped_stat
Gapped extension counts.
MT_LOCK mt_lock
Mutex for updating diagnostics data in a multi-threaded search.
Structure containing hit counts from the gapped stage of a BLAST search.
Int4 good_extensions
Number of HSPs below the e-value threshold after gapped extension.
Int4 num_seqs_passed
Number of sequences with top HSP passing the e-value threshold.
Int4 seqs_ungapped_passed
Number of sequences with top HSP after ungapped extension passing the e-value threshold.
Int4 extensions
Total number of gapped extensions performed.
Structure holding raw cutoff and gap-x-drop values.
Int4 ungapped_cutoff
Minimal raw score for starting gapped extension.
Int4 x_drop_gap_final
Raw value of the x-dropoff for gapped extensions with traceback.
Int4 x_drop_gap
Raw value of the x-dropoff for preliminary gapped extensions.
Int4 x_drop_ungapped
Raw value of the x-dropoff for ungapped extensions.
Int4 cutoff_score
Cutoff score corresponding to given evalue.
Structure containing hit counts from the ungapped stage of a BLAST search.
Int4 num_seqs_lookup_hits
Number of sequences which had at least one lookup table hit.
Int8 lookup_hits
Number of successful lookup table hits.
Int4 init_extends
Number of initial words found and extended.
Int4 good_init_extends
Number of successful initial extensions, i.e.
Int4 num_seqs_passed
Number of sequences with at least one HSP saved after ungapped stage.
Modified on Fri Sep 20 14:57:39 2024 by modify_doxy.py rev. 669887