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

Go to the SVN repository for this file.

1 #ifndef ALIGN_CI__HPP
2 #define ALIGN_CI__HPP
3 
4 /* $Id: align_ci.hpp 90166 2020-05-18 18:50:58Z vasilche $
5 * ===========================================================================
6 *
7 * PUBLIC DOMAIN NOTICE
8 * National Center for Biotechnology Information
9 *
10 * This software/database is a "United States Government Work" under the
11 * terms of the United States Copyright Act. It was written as part of
12 * the author's official duties as a United States Government employee and
13 * thus cannot be copyrighted. This software/database is freely available
14 * to the public for use. The National Library of Medicine and the U.S.
15 * Government have not placed any restriction on its use or reproduction.
16 *
17 * Although all reasonable efforts have been taken to ensure the accuracy
18 * and reliability of the software and data, the NLM and the U.S.
19 * Government do not and cannot warrant the performance or results that
20 * may be obtained by using this software or data. The NLM and the U.S.
21 * Government disclaim all warranties, express or implied, including
22 * warranties of performance, merchantability or fitness for any particular
23 * purpose.
24 *
25 * Please cite the author in any work or product based on this material.
26 *
27 * ===========================================================================
28 *
29 * Author: Aleksey Grichenko, Michael Kimelman, Eugene Vasilchenko
30 *
31 * File Description:
32 * Object manager iterators
33 *
34 */
35 
36 #include <corelib/ncbistd.hpp>
37 
42 
44 
47 
48 
49 /** @addtogroup ObjectManagerIterators
50  *
51  * @{
52  */
53 
54 
55 /////////////////////////////////////////////////////////////////////////////
56 ///
57 /// CAlign_CI --
58 ///
59 /// Enumerate CSeq_align objects related to the specified bioseq or seq-loc
60 ///
61 
63 {
64 public:
65  /// Create an empty iterator
66  CAlign_CI(void);
67 
68  /// Create an iterator that enumerates CSeq_align objects
69  /// related to the given bioseq
70  explicit
71  CAlign_CI(const CBioseq_Handle& bioseq);
72 
73  /// Create an iterator that enumerates CSeq_align objects
74  /// related to the given bioseq
75  CAlign_CI(const CBioseq_Handle& bioseq,
76  const CRange<TSeqPos>& range,
78 
79  /// Create an iterator that enumerates CSeq_align objects
80  /// related to the given bioseq
81  ///
82  /// @sa
83  /// SAnnotSelector
84  CAlign_CI(const CBioseq_Handle& bioseq,
85  const SAnnotSelector& sel);
86 
87  /// Create an iterator that enumerates CSeq_align objects
88  /// related to the given bioseq
89  ///
90  /// @sa
91  /// SAnnotSelector
92  CAlign_CI(const CBioseq_Handle& bioseq,
93  const CRange<TSeqPos>& range,
94  const SAnnotSelector& sel);
95 
96  /// Create an iterator that enumerates CSeq_align objects
97  /// related to the given bioseq
98  ///
99  /// @sa
100  /// SAnnotSelector
101  CAlign_CI(const CBioseq_Handle& bioseq,
102  const CRange<TSeqPos>& range,
103  ENa_strand strand,
104  const SAnnotSelector& sel);
105 
106  /// Create an iterator that enumerates CSeq_align objects
107  /// related to the given seq-loc
108  ///
109  /// @sa
110  /// SAnnotSelector
111  CAlign_CI(CScope& scope,
112  const CSeq_loc& loc,
113  const SAnnotSelector& sel);
114 
115  /// Create an iterator that enumerates CSeq_align objects
116  /// related to the given seq-loc
117  CAlign_CI(CScope& scope,
118  const CSeq_loc& loc);
119 
120  // Iterate all features from the object regardless of their location
121 
122  /// Create an iterator that enumerates CSeq_align objects
123  /// from the annotation regardless of their location
124  explicit
125  CAlign_CI(const CSeq_annot_Handle& annot);
126 
127  /// Create an iterator that enumerates CSeq_align objects
128  /// from the annotation regardless of their location
129  /// based on selection
130  ///
131  /// @sa
132  /// SAnnotSelector
133  CAlign_CI(const CSeq_annot_Handle& annot,
134  const SAnnotSelector& sel);
135 
136  /// Iterate all alignments from the seq-annot that annotate the location
137  CAlign_CI(const CSeq_loc& loc,
138  const CSeq_annot_Handle& annot);
139 
140  /// Iterate all alignments from the seq-annot that annotate the location
141  ///
142  /// @sa
143  /// SAnnotSelector
144  CAlign_CI(const CSeq_loc& loc,
145  const CSeq_annot_Handle& annot,
146  const SAnnotSelector& sel);
147 
148  /// Create an iterator that enumerates CSeq_align objects
149  /// from the seq-entry regardless of their location
150  explicit
151  CAlign_CI(const CSeq_entry_Handle& entry);
152 
153  /// Create an iterator that enumerates CSeq_align objects
154  /// from the seq-entry regardless of their location
155  /// based on selection
156  ///
157  /// @sa
158  /// SAnnotSelector
159  CAlign_CI(const CSeq_entry_Handle& entry,
160  const SAnnotSelector& sel);
161 
162  CAlign_CI(const CAlign_CI& iter);
163  CAlign_CI& operator= (const CAlign_CI& iter);
164 
165  virtual ~CAlign_CI(void);
166 
167  /// Move to the next object in iterated sequence
168  CAlign_CI& operator++ (void);
169 
170  /// Move to the pervious object in iterated sequence
171  CAlign_CI& operator-- (void);
172 
173  /// Move to the first object in iterated sequence
174  void Rewind(void);
175 
176  /// Check if iterator points to an object
178 
179  const CAlign_CI& begin() const
180  {
181  return *this;
182  }
183  CAlign_CI end() const
184  {
185  return CAlign_CI(*this, at_end);
186  }
187  bool operator!=(const CAlign_CI& it) const
188  {
189  return CAnnotTypes_CI::operator!=(it);
190  }
191 
192  /// Mapped alignment, not the original one
193  const CSeq_align& operator* (void) const;
194 
195  /// Mapped alignment, not the original one
196  const CSeq_align* operator-> (void) const;
197 
198  /// Get original alignment
199  const CSeq_align& GetOriginalSeq_align(void) const;
200 
201  /// Get original alignment handle
202  CSeq_align_Handle GetSeq_align_Handle(void) const;
203 
204 private:
205  CAlign_CI operator++ (int);
207 
209  : CAnnotTypes_CI(it, at_end)
210  {
211  }
212 
214 };
215 
216 
217 inline
219 {
220 }
221 
222 
223 inline
225  : CAnnotTypes_CI(iter)
226 {
227 }
228 
229 
230 /* @} */
231 
232 
235 
236 #endif // ALIGN_CI__HPP
CAlign_CI –.
Definition: align_ci.hpp:63
bool operator!=(const CAnnotTypes_CI &it) const
CBioseq_Handle –.
CScope –.
Definition: scope.hpp:92
CSeq_annot_Handle –.
CSeq_entry_Handle –.
Include a standard set of the NCBI C++ Toolkit most basic headers.
CVect2< NCBI_PROMOTE(int,U) > operator*(int v1, const CVect2< U > &v2)
Definition: globals.hpp:371
bool IsValid(const CSeq_point &pt, CScope *scope)
Checks that point >= 0 and point < length of Bioseq.
CAlign_CI(const CAlign_CI &it, EAtEnd)
Definition: align_ci.hpp:208
bool operator!=(const CAlign_CI &it) const
Definition: align_ci.hpp:187
DECLARE_OPERATOR_BOOL(IsValid())
Check if iterator points to an object.
const CAlign_CI & begin() const
Definition: align_ci.hpp:179
CConstRef< CSeq_align > m_MappedAlign
Definition: align_ci.hpp:213
CAlign_CI(void)
Create an empty iterator.
Definition: align_ci.hpp:218
CAlign_CI end() const
Definition: align_ci.hpp:183
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_XOBJMGR_EXPORT
Definition: ncbi_export.h:1307
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
range(_Ty, _Ty) -> range< _Ty >
S & operator--(CNetRef< S > &r, int)
SAnnotSelector –.
Modified on Tue May 21 11:00:52 2024 by modify_doxy.py rev. 669887