NCBI C++ ToolKit
seq_masker_cache_boost.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: seq_masker_cache_boost.hpp 33815 2007-05-04 17:18:18Z kazimird $
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: Aleksandr Morgulis
27  *
28  * File Description:
29  * CSeqMaskerCacheBoost class definition.
30  *
31  */
32 
33 #ifndef C_SEQ_MASKER_CACHE_BOOST_H
34 #define C_SEQ_MASKER_CACHE_BOOST_H
35 
36 #include <corelib/ncbiobj.hpp>
37 
40 
42 
43 /**\brief Interface to the bit array used to check if the score of a unit is
44  ** below t_extend.
45  **/
47 {
48  public:
49 
50  /**\brief Object constructor.
51  **\param window will advance the window if runs of low-value units
52  ** are found
53  **\param od pointer to the data structure containing the bit array
54  **/
57  : window_( window ), od_( od ), last_checked_( 0 )
58  { nu_ = window_.NumUnits(); }
59 
60  /**\brief Check if the current state of the window and advance.
61  **
62  ** If the current window has all units below the t_extend, then advance
63  ** it until the above condition does not hold true.
64  **
65  **\return true if the end of the sequence has been reached;
66  ** false otherwise
67  **/
68  bool Check();
69 
70  private:
71 
72  /**\internal
73  **\brief Type representing an Nmer.
74  **/
76 
77  /**\internal
78  **\brief Get the bit value corresponding to the given Nmer value.
79  **\param pos the Nmer value
80  **\return the bit value corresponding to pos
81  **/
82  Uint1 bit_at( TUnit pos ) const;
83 
84  /**\internal
85  **\brief Check if all units of the window are below t_extend.
86  **\return true if the above condition holds; false otherwise
87  **/
88  bool full_check() const;
89 
90  CSeqMaskerWindow & window_; /**<\internal Reference to the window object. */
91  const CSeqMaskerIstat::optimization_data * od_; /**<\internal Structure containing the bit array. */
92 
93  TSeqPos last_checked_; /**<\internal Last window state for which the check was done. */
94  Uint8 nu_; /**<\internal Number of units in a window. */
95 };
96 
98 
99 #endif
Interface to the bit array used to check if the score of a unit is below t_extend.
CSeqMaskerCacheBoost(CSeqMaskerWindow &window, const CSeqMaskerIstat::optimization_data *od)
Object constructor.
const CSeqMaskerIstat::optimization_data * od_
CSeqMaskerWindow::TUnit TUnit
Sliding window skipping over the ambiguities.
Uint4 TUnit
Integer type used to represent units within a window.
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
uint64_t Uint8
8-byte (64-bit) unsigned integer
Definition: ncbitype.h:105
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_XALGOWINMASK_EXPORT
Definition: ncbi_export.h:1033
void Check(const string &value)
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Structure containing information about optimization parameters used.
Modified on Thu May 23 12:34:30 2024 by modify_doxy.py rev. 669887