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

Go to the SVN repository for this file.

1 #ifndef NCBI_OBJMGR_SPLIT_OBJECT_SPLITINFO__HPP
2 #define NCBI_OBJMGR_SPLIT_OBJECT_SPLITINFO__HPP
3 
4 /* $Id: object_splitinfo.hpp 87845 2019-10-10 16:05:19Z 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: Eugene Vasilchenko
30 *
31 * File Description:
32 * Application for splitting blobs withing ID1 cache
33 *
34 * ===========================================================================
35 */
36 
37 
38 #include <corelib/ncbistd.hpp>
39 #include <corelib/ncbiobj.hpp>
40 
42 #include <objects/seq/Seq_inst.hpp>
43 #include <objects/seq/Seq_data.hpp>
45 #include <objects/seq/Bioseq.hpp>
46 #include <objects/seq/Seq_hist.hpp>
48 
49 #include <objmgr/annot_name.hpp>
51 
52 #include <memory>
53 #include <map>
54 #include <vector>
55 
57 #include <objmgr/split/size.hpp>
59 
61 
62 class CObjectOStream;
63 
65 
66 class CSeq_entry;
67 class CBioseq;
68 class CBioseq_set;
69 class CSeq_annot;
70 class CSeq_feat;
71 class CSeq_align;
72 class CSeq_graph;
73 class CSeq_data;
74 class CSeq_inst;
75 class CSeq_descr;
76 class CID2S_Split_Info;
77 class CID2S_Chunk_Id;
78 class CID2S_Chunk;
79 class CBlobSplitter;
80 class CBlobSplitterImpl;
81 struct SSplitterParams;
82 
83 
85 {
93 };
94 typedef unsigned TAnnotPriority;
95 
96 
98 {
99 public:
101  : m_ObjectType(0)
102  {
103  }
105  const CBlobSplitterImpl& impl,
106  CSize::TSizeRatio ratio);
108  const CBlobSplitterImpl& impl,
109  CSize::TSizeRatio ratio);
111  const CBlobSplitterImpl& impl,
112  CSize::TSizeRatio ratio);
114  const CBlobSplitterImpl& impl,
115  CSize::TSizeRatio ratio);
116 
117  TAnnotPriority GetPriority(void) const;
119 
120  int Compare(const CAnnotObject_SplitInfo& other) const;
121 
124 
126 
129 };
130 
131 
133 {
134 public:
135  typedef vector<CAnnotObject_SplitInfo> TObjects;
136  typedef TObjects::const_iterator const_iterator;
137 
138  void Add(const CAnnotObject_SplitInfo& obj);
140 
141  bool empty(void) const
142  {
143  return m_Objects.empty();
144  }
145  size_t size(void) const
146  {
147  return m_Objects.size();
148  }
149  void clear(void)
150  {
151  m_Objects.clear();
152  m_Size.clear();
153  m_Location.clear();
154  }
155  const_iterator begin(void) const
156  {
157  return m_Objects.begin();
158  }
159  const_iterator end(void) const
160  {
161  return m_Objects.end();
162  }
163 
165 
168 };
169 
170 
171 inline
173 {
174  return info.Print(out);
175 }
176 
177 
179 {
180 public:
181  typedef vector< CRef<CLocObjects_SplitInfo> > TObjects;
182 
183  CSeq_annot_SplitInfo(void);
184 
185  void SetSeq_annot(const CSeq_annot& annot,
186  const SSplitterParams& params,
187  const CBlobSplitterImpl& impl);
188  void Add(const CAnnotObject_SplitInfo& obj);
189 
191 
192  static CAnnotName GetName(const CSeq_annot& annot);
193  static size_t CountAnnotObjects(const CSeq_annot& annot);
194 
195  TAnnotPriority GetPriority(void) const;
197 
198  int Compare(const CSeq_annot_SplitInfo& other) const;
199 
202 
206 
209 };
210 
211 
212 inline
214 {
215  return info.Print(out);
216 }
217 
218 
220 {
221 public:
222  CSeq_descr_SplitInfo(const CPlaceId& place_id,
223  TSeqPos seq_length,
224  const CSeq_descr& descr,
225  const SSplitterParams& params);
226 
227  TAnnotPriority GetPriority(void) const;
228 
229  int Compare(const CSeq_descr_SplitInfo& other) const;
230 
232 
234 
237  mutable vector< CRef<CSeq_descr_SplitInfo> > m_SubPieces;
238 };
239 
240 
242 {
243 public:
244  CSeq_hist_SplitInfo(const CPlaceId& place_id,
245  const CSeq_hist& hist,
246  const SSplitterParams& params);
247  CSeq_hist_SplitInfo(const CPlaceId& place_id,
248  const CSeq_align& align,
249  const SSplitterParams& params);
250 
251  TAnnotPriority GetPriority(void) const;
252 
254 
259 };
260 
261 
263 {
264 public:
266  void SetSeq_data(const CPlaceId& place_id, const TRange& range,
267  TSeqPos seq_length,
268  const CSeq_data& data,
269  const SSplitterParams& params);
270 
271  TAnnotPriority GetPriority(void) const;
272 
273  TRange GetRange(void) const;
274 
276 
278 
281 };
282 
283 
285 {
286 public:
287  typedef vector<CSeq_data_SplitInfo> TSeq_data;
288 
289  void Add(const CSeq_data_SplitInfo& data);
290 
292 
294 };
295 
296 
298 {
299 public:
300  CBioseq_SplitInfo(const CBioseq& bioseq, const SSplitterParams& params);
301 
302  bool CanSplit(void) const;
303  TAnnotPriority GetPriority(void) const;
304 
306 
308 
311 };
312 
313 
315 {
316 public:
318  typedef vector<CBioseq_SplitInfo> TBioseqs;
319 
320  CPlace_SplitInfo(void);
321  ~CPlace_SplitInfo(void);
322 
325 
332 };
333 
334 
337 
338 #endif//NCBI_OBJMGR_SPLIT_OBJECT_SPLITINFO__HPP
User-defined methods of the data storage class.
CConstRef< CObject > m_Object
TAnnotPriority CalcPriority(void) const
TAnnotPriority GetPriority(void) const
int Compare(const CAnnotObject_SplitInfo &other) const
TAnnotPriority m_Priority
CBioseq_SplitInfo(const CBioseq &bioseq, const SSplitterParams &params)
bool CanSplit(void) const
CConstRef< CBioseq > m_Bioseq
TAnnotPriority GetPriority(void) const
CID2S_Chunk_Id –.
CID2S_Chunk –.
Definition: ID2S_Chunk.hpp:66
CID2S_Split_Info –.
vector< CAnnotObject_SplitInfo > TObjects
size_t size(void) const
const_iterator end(void) const
TObjects::const_iterator const_iterator
CNcbiOstream & Print(CNcbiOstream &out) const
const_iterator begin(void) const
void Add(const CAnnotObject_SplitInfo &obj)
CObjectOStream –.
Definition: objostr.hpp:83
CObject –.
Definition: ncbiobj.hpp:180
map< CConstRef< CSeq_annot >, CSeq_annot_SplitInfo > TSeq_annots
CRef< CSeq_inst_SplitInfo > m_Inst
vector< CBioseq_SplitInfo > TBioseqs
CRef< CSeq_descr_SplitInfo > m_Descr
CRef< CBioseq > m_Bioseq
CRef< CSeq_hist_SplitInfo > m_Hist
CRef< CBioseq_set > m_Bioseq_set
CNcbiOstream & Print(CNcbiOstream &out) const
vector< CRef< CLocObjects_SplitInfo > > TObjects
TAnnotPriority m_TopPriority
void SetSeq_annot(const CSeq_annot &annot, const SSplitterParams &params, const CBlobSplitterImpl &impl)
CConstRef< CSeq_annot > m_Src_annot
void Add(const CAnnotObject_SplitInfo &obj)
static CAnnotName GetName(const CSeq_annot &annot)
TAnnotPriority m_NamePriority
TAnnotPriority GetPriority(void) const
int Compare(const CSeq_annot_SplitInfo &other) const
static size_t CountAnnotObjects(const CSeq_annot &annot)
TAnnotPriority m_Priority
CConstRef< CSeq_data > m_Data
CRange< TSeqPos > TRange
TRange GetRange(void) const
TAnnotPriority GetPriority(void) const
void SetSeq_data(const CPlaceId &place_id, const TRange &range, TSeqPos seq_length, const CSeq_data &data, const SSplitterParams &params)
CSeq_descr_SplitInfo(const CPlaceId &place_id, TSeqPos seq_length, const CSeq_descr &descr, const SSplitterParams &params)
CConstRef< CSeq_descr > m_Descr
int Compare(const CSeq_descr_SplitInfo &other) const
TAnnotPriority GetPriority(void) const
vector< CRef< CSeq_descr_SplitInfo > > m_SubPieces
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
Definition: Seq_entry.hpp:56
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
TAnnotPriority GetPriority(void) const
TAnnotPriority m_Priority
CSeq_hist::TAssembly TAssembly
CSeq_hist_SplitInfo(const CPlaceId &place_id, const CSeq_hist &hist, const SSplitterParams &params)
CSeq_hist –.
Definition: Seq_hist.hpp:66
vector< CSeq_data_SplitInfo > TSeq_data
CConstRef< CSeq_inst > m_Seq_inst
void Add(const CSeq_data_SplitInfo &data)
void clear(void)
Definition: id_range.hpp:125
Definition: size.hpp:46
void clear(void)
Definition: size.hpp:58
pair< TDataSize, TDataSize > TSizeRatio
Definition: size.hpp:49
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
char data[12]
Definition: iconv.c:80
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
#define kMax_Int
Definition: ncbi_limits.h:184
#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
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
list< CRef< CSeq_align > > TAssembly
Definition: Seq_hist_.hpp:248
static MDB_envinfo info
Definition: mdb_load.c:37
range(_Ty, _Ty) -> range< _Ty >
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
EAnnotPriority
@ eAnnotPriority_skeleton
@ eAnnotPriority_lowest
@ eAnnotPriority_max
@ eAnnotPriority_low
@ eAnnotPriority_regular
@ eAnnotPriority_zoomed
@ eAnnotPriority_landmark
CNcbiOstream & operator<<(CNcbiOstream &out, const CLocObjects_SplitInfo &info)
unsigned TAnnotPriority
Modified on Tue Jun 11 09:22:56 2024 by modify_doxy.py rev. 669887