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

Go to the SVN repository for this file.

1 /* $Id: seq_masker_window_ambig.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  * Header file for CSeqMaskerWindowAmbig class.
30  *
31  */
32 
33 #ifndef C_SEQ_MASKER_WINDOW_AMBIG_H
34 #define C_SEQ_MASKER_WINDOW_AMBIG_H
35 
37 
39 
40 
41 /**
42  **\brief Windows with units that may contain ambiguities.
43  **
44  ** Units with ambiguities are represented by a special unit value that
45  ** is passed at construction time.
46  **/
48 {
49 public:
50 
51  /**
52  **\brief Object constructor.
53  **
54  **\param arg_data the sequence data
55  **\param arg_unit_size the unit size
56  **\param arg_window_size the window size (must be >= unit size).
57  **\param window_step how much to advance when increment operator
58  ** is called.
59  **\param arg_ambig_unit the value to use for units containing
60  ** ambiguity characters.
61  **\param window_start offset of the first window
62  **\param arg_unit_step the distance between consequtive units within
63  ** a window
64  **
65  **/
66  CSeqMaskerWindowAmbig( const objects::CSeqVector & arg_data,
67  Uint1 arg_unit_size,
68  Uint1 arg_window_size,
69  Uint4 window_step,
70  TUnit arg_ambig_unit,
71  Uint4 window_start = 0,
72  Uint1 arg_unit_step = 1 );
73 
74  /**
75  **\brief Object destructor.
76  **
77  **/
79 
80 protected:
81 
82  /**
83  **\brief Advance the window by a specified number of characters.
84  **
85  ** This function always advances by the correct number of characters
86  ** (as opposed to CSeqMaskerWindow::Advance() that can jump over the
87  ** ambiguities).
88  **
89  **\param step advance by that many bases.
90  **/
91  virtual void Advance( Uint4 step );
92 
93  /**
94  **\brief Value to use for units containing ambiguity characters.
95  **
96  **/
98 
99 private:
100 
101  /**
102  **\brief Computes the units starting at specified position.
103  **
104  **\param winstart new start position of the window.
105  **/
106  void FillWindow( Uint4 winstart );
107 
108  /**
109  **\brief Ambiguity status of the window.
110  **
111  **The value is true if the window currently has units with
112  **ambiguity characters, false otherwise.
113  **/
114  bool ambig;
115 };
116 
118 
119 #endif
Windows with units that may contain ambiguities.
virtual ~CSeqMaskerWindowAmbig()
Object destructor.
bool ambig
Ambiguity status of the window.
TUnit ambig_unit
Value to use for units containing ambiguity characters.
Sliding window skipping over the ambiguities.
virtual void Advance(Uint4 step)
Slide the window by the given number of bases.
void FillWindow(Uint4 winstart)
Uint4 TUnit
Integer type used to represent units within a window.
uint8_t Uint1
1-byte (8-bit) unsigned integer
Definition: ncbitype.h:99
uint32_t Uint4
4-byte (32-bit) unsigned integer
Definition: ncbitype.h:103
#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
Modified on Tue May 21 10:58:50 2024 by modify_doxy.py rev. 669887