NCBI C Toolkit Cross Reference

C/algo/blast/core/blast_diagnostics.h


  1 /* $Id: blast_diagnostics.h,v 1.12 2011/06/13 18:24:31 kazimird Exp $
  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 
 36 #include <algo/blast/core/ncbi_std.h>
 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. */
 53 } BlastRawCutoffs;
 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. */
 66 } BlastUngappedStats;
 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. */
 79 } BlastGappedStats;
 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. */
 88 } BlastDiagnostics;
 89 
 90 /** Free the BlastDiagnostics structure and all substructures. */
 91 BlastDiagnostics* Blast_DiagnosticsFree(BlastDiagnostics* diagnostics);
 92 
 93 /** Initialize the BlastDiagnostics structure and all its substructures. */
 94 BlastDiagnostics* Blast_DiagnosticsInit(void);
 95 
 96 /** Free the BlastDiagnostics structure and all substructures. */
 97 BlastDiagnostics* Blast_DiagnosticsCopy(const BlastDiagnostics* diagnostics);
 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  */
102 BlastDiagnostics* Blast_DiagnosticsInitMT(MT_LOCK mt_lock);
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 
115 Blast_DiagnosticsUpdate(BlastDiagnostics* diag_global,
116                         BlastDiagnostics* diag_local);
117 
118 #ifdef __cplusplus
119 }
120 #endif
121 #endif /* !ALGO_BLAST_CORE__BLAST_DIAGNOSTICS__H */
122 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.