NCBI C++ ToolKit
Seq_entry.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: Seq_entry.cpp 93341 2021-04-05 12:29:47Z grichenk $
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: .......
27  *
28  * File Description:
29  * .......
30  *
31  * Remark:
32  * This code was originally generated by application DATATOOL
33  * using specifications from the ASN data definition file
34  * 'seqset.asn'.
35  */
36 
37 // standard includes
38 
39 // generated includes
40 #include <ncbi_pch.hpp>
43 
44 #include <objects/seq/Bioseq.hpp>
45 
49 
50 // generated classes
51 
53 
54 BEGIN_objects_SCOPE // namespace ncbi::objects::
55 
56 // destructor
58 {
59 }
60 
62 {
63  m_ParentEntry = 0;
64 }
65 
67 {
68  m_ParentEntry = entry;
69 }
70 
72 {
73  switch ( Which() ) {
74  case e_Seq:
75  SetSeq().SetParentEntry(this);
76  break;
77  case e_Set:
78  SetSet().SetParentEntry(this);
79  NON_CONST_ITERATE ( CBioseq_set::TSeq_set, si, SetSet().SetSeq_set() ) {
80  (*si)->SetParentEntry(this);
81  (*si)->Parentize();
82  }
83  break;
84  case e_not_set:
85  break;
86  }
87 }
88 
90 {
91  switch ( Which() ) {
92  case e_Seq:
93  SetSeq().SetParentEntry(this);
94  break;
95  case e_Set:
96  SetSet().SetParentEntry(this);
97  NON_CONST_ITERATE ( CBioseq_set::TSeq_set, si, SetSet().SetSeq_set() ) {
98  (*si)->SetParentEntry(this);
99  }
100  break;
101  case e_not_set:
102  break;
103  }
104 }
105 
106 bool CSeq_entry::IsSetDescr(void) const
107 {
108  switch ( Which() ) {
109  case e_Seq:
110  return (GetSeq().IsSetDescr());
111  case e_Set:
112  return (GetSet().IsSetDescr());
113  default:
114  break;
115  }
116 
117  return false;
118 }
119 
121 {
122  switch ( Which() ) {
123  case e_Seq:
124  return (GetSeq().GetDescr());
125  case e_Set:
126  return (GetSet().GetDescr());
127  default:
128  NCBI_THROW(CSerialException, eNotImplemented,
129  "CSeq_entry::GetDescr: unsupported entry type "
130  + SelectionName(Which()));
131  }
132 }
133 
135 {
136  switch ( Which() ) {
137  case e_Seq:
138  SetSeq().SetDescr(value);
139  break;
140  case e_Set:
141  SetSet().SetDescr(value);
142  break;
143  default:
144  NCBI_THROW(CSerialException, eNotImplemented,
145  "CSeq_entry::SetDescr: unsupported entry type "
146  + SelectionName(Which()));
147  }
148 }
149 
151 {
152  switch ( Which() ) {
153  case e_Seq:
154  return (SetSeq().SetDescr());
155  case e_Set:
156  return (SetSet().SetDescr());
157  default:
158  NCBI_THROW(CSerialException, eNotImplemented,
159  "CSeq_entry::SetDescr: unsupported entry type "
160  + SelectionName(Which()));
161  }
162 }
163 
164 
165 bool CSeq_entry::IsSetAnnot(void) const
166 {
167  switch ( Which() ) {
168  case e_Seq:
169  return (GetSeq().IsSetAnnot());
170  case e_Set:
171  return (GetSet().IsSetAnnot());
172  default:
173  break;
174  }
175 
176  return false;
177 }
178 
180 {
181  switch ( Which() ) {
182  case e_Seq:
183  return (GetSeq().GetAnnot());
184  case e_Set:
185  return (GetSet().GetAnnot());
186  default:
187  NCBI_THROW(CSerialException, eNotImplemented,
188  "CSeq_entry::GetAnnot: unsupported entry type "
189  + SelectionName(Which()));
190  }
191 }
192 
193 
194 
196 {
197  switch ( Which() ) {
198  case e_Seq:
199  return (SetSeq().SetAnnot());
200  case e_Set:
201  return (SetSet().SetAnnot());
202  default:
203  NCBI_THROW(CSerialException, eNotImplemented,
204  "CSeq_entry::SetAnnot: unsupported entry type "
205  + SelectionName(Which()));
206  }
207 }
208 
209 
210 
211 // Implemented here to prevent CBioseq dependency on CSeq_entry
213 {
214  CSeq_entry* se;
215  int lvl = 0;
216 
217  for (se = GetParentEntry(); se; se = se->GetParentEntry(), lvl++) {
218  if (se->IsSetDescr()) {
219  ITERATE (CSeq_descr::Tdata, sd_itr, se->GetDescr().Get()) {
220  const CSeqdesc& desc = **sd_itr;
221  if ( desc.Which() == choice ) {
222  if (level != NULL) {
223  *level = lvl;
224  }
225  return *sd_itr;
226  }
227  }
228  }
229  }
230 
231  if (level != NULL) {
232  *level = lvl;
233  }
234  return CConstRef<CSeqdesc> ();
235 }
236 
237 
238 void CSeq_entry::UserOp_Assign(const CSerialUserOp& /* source */)
239 {
240  m_ParentEntry = 0;
242 }
243 
244 bool CSeq_entry::UserOp_Equals(const CSerialUserOp& /*object*/) const
245 {
246  return true;
247 }
248 
249 
251 {
252  switch (lt) {
253  case CSeq_entry::eType: return CBioseq::eType;
255  default:
257  return CBioseq::eBoth;
258  }
259 }
260 
261 
263 {
264  switch (lt) {
267  default:
269  return CBioseq_set::eBoth;
270  }
271 }
272 
273 
275 {
276  switch ( Which() ) {
277  case e_Seq:
279  break;
280  case e_Set:
282  break;
283  case e_not_set:
284  default:
285  *label += "???";
286  }
287 }
288 
289 
291 
292 // mapping entries:
293 // [Seq-id, null] == null - no replacement for the Seq-id.
294 // [Seq-id, null] == gi - needs replacement, gi is the next suffix number.
295 // [Seq-id, Bioseq] == null - needs replacement id, not yet assigned.
296 // [Seq-id, Bioseq] == gi - no need for replacement.
297 // [Seq-id, Bioseq] == new Seq-id - replacement id.
298 typedef pair<CSeq_id_Handle, CConstRef<CBioseq> > TIdKey;
300 typedef pair<TIdMap::iterator, bool> TIdInsert;
301 
302 
304 {
305  return type == CSeq_id::e_Local || type == CSeq_id::e_General ||
308 }
309 
310 
311 TIdInsert
312 sx_AddId(TIdMap& id_map, const CSeq_id_Handle& id, const CBioseq* seq = 0)
313 {
314  return id_map.insert(TIdMap::value_type(TIdKey(id, ConstRef(seq)), null));
315 }
316 
317 
319 {
320  CRef<CSeq_id> new_id(SerialClone(*idh.GetSeqId()));
321  CObject_id* obj_id = 0;
322  switch ( new_id->Which() ) {
323  case CSeq_id::e_Local: obj_id = &new_id->SetLocal(); break;
324  case CSeq_id::e_General: obj_id = &new_id->SetGeneral().SetTag(); break;
325  case CSeq_id::e_Ddbj:
326  case CSeq_id::e_Genbank:
327  case CSeq_id::e_Embl:
328  case CSeq_id::e_Other:
329  {
330  string lcl = new_id->AsFastaString();
331  NStr::ReplaceInPlace(lcl, "|", "_");
332  new_id->SetLocal().SetStr(lcl);
333  obj_id = &new_id->SetLocal();
334  break;
335  }
336  default:
338  "CSeq_entry::ReassignConflictingIds: "
339  "bad type of conflicting id: "+new_id->AsFastaString());
340  }
341  string base;
342  if ( obj_id->IsStr() ) {
343  base = obj_id->GetStr();
344  }
345  else {
346  base = NStr::NumericToString(obj_id->GetId());
347  }
348  base += "_";
349  CSeq_id_Handle& suffix_id = id_map[TIdKey(idh, null)];
350  for ( TGi k = suffix_id.GetGi(); ; ++k ) {
351  obj_id->SetStr(base+NStr::NumericToString(k));
352  CSeq_id_Handle new_idh = CSeq_id_Handle::GetHandle(*new_id);
353  if ( sx_AddId(id_map, new_idh).second ) {
354  suffix_id = CSeq_id_Handle::GetGiHandle(k+GI_CONST(1));
355  return new_idh;
356  }
357  }
358 }
359 
360 
361 inline
362 size_t sx_Level(const CSeq_entry* entry)
363 {
364  size_t level = 0;
365  while ( entry ) {
366  ++level;
367  entry = entry->GetParentEntry();
368  }
369  return level;
370 }
371 
372 
373 inline
374 size_t sx_GetParentLevel(const CSeq_entry* entry1, size_t level1,
375  const CSeq_entry* entry2, size_t level2)
376 {
377  if ( level2 > level1 ) {
378  return sx_GetParentLevel(entry2, level2, entry1, level1);
379  }
380  // go to the same level
381  while ( level1 > level2 ) {
382  entry1 = entry1->GetParentEntry();
383  --level1;
384  }
385  // find common parent
386  while ( entry1 != entry2 ) {
387  entry1 = entry1->GetParentEntry();
388  entry2 = entry2->GetParentEntry();
389  --level1;
390  }
391  return level1;
392 }
393 
394 
395 inline
396 bool sx_ComesBefore(const CSeq_entry* entry1, size_t level1,
397  const CSeq_entry* entry2, size_t level2)
398 {
399  if ( level2 > level1 ) {
400  return !sx_ComesBefore(entry2, level2, entry1, level1);
401  }
402  // go to the same level
403  while ( level1 > level2 ) {
404  entry1 = entry1->GetParentEntry();
405  --level1;
406  }
407  // find common parent
408  const CSeq_entry* parent = 0;
409  for ( ;; ) {
410  parent = entry1->GetParentEntry();
411  const CSeq_entry* parent2 = entry2->GetParentEntry();
412  if ( parent == parent2 ) {
413  break;
414  }
415  entry1 = parent;
416  entry2 = parent2;
417  }
418  // look which entry comes first in the common parent
419  const CBioseq_set& set = parent->GetSet();
420  ITERATE ( CBioseq_set::TSeq_set, it, set.GetSeq_set() ) {
421  if ( *it == entry1 ) {
422  return true;
423  }
424  if ( *it == entry2 ) {
425  return false;
426  }
427  }
428  // should not come here, but we'll return false anyway
429  return false;
430 }
431 
432 
434 
435 const CSeq_id_Handle& sx_FindBestId(const TIdMap& id_map,
436  TIdMapCache& cache,
437  const CSeq_entry& annot_entry,
438  const CSeq_id_Handle& id)
439 {
440  CSeq_id_Handle& cached = cache[id];
441  if ( cached ) {
442  // use cached value
443  return cached;
444  }
445  // find correct replacement
446  // first scan for closest inner sequence, it's easier and usually succeeds
447  const CSeq_entry* closest_entry = 0;
448  size_t closest_level = kMax_Int;
449  for ( TIdMap::const_iterator it = id_map.lower_bound(TIdKey(id, null));
450  it != id_map.end() && it->first.first == id; ++it ) {
451  if ( !it->first.second ) { // skip non-bioseq entry
452  continue;
453  }
454  const CBioseq& seq = *it->first.second;
455  const CSeq_entry* seq_entry = seq.GetParentEntry();
456  size_t seq_level = 0;
457  for ( const CSeq_entry* entry = seq_entry;
458  entry; entry = entry->GetParentEntry(), ++seq_level ) {
459  if ( entry == &annot_entry ) {
460  // inner
461  if ( seq_level < closest_level ) {
462  closest_level = seq_level;
463  closest_entry = seq_entry;
464  cached = it->second;
465  }
466  else if ( seq_level == closest_level &&
467  sx_ComesBefore(seq_entry, seq_level,
468  closest_entry, closest_level) ) {
469  // same level, use the one that comes first
470  closest_entry = seq_entry;
471  cached = it->second;
472  }
473  break;
474  }
475  }
476  }
477  if ( cached ) {
478  // found inner sequence
479  return cached;
480  }
481  // now scan for closest outer sequence in order:
482  // 1. closest commont parent
483  // 2. closest distance (through the commont parent)
484  // 3. comes first at fork
485  size_t annot_level = sx_Level(&annot_entry);
486  size_t closest_seq_level = kMax_Int;
487  // full scan for best candidate
488  for ( TIdMap::const_iterator it = id_map.lower_bound(TIdKey(id, null));
489  it != id_map.end() && it->first.first == id; ++it ) {
490  if ( !it->first.second ) {
491  continue;
492  }
493  const CBioseq& seq = *it->first.second;
494  const CSeq_entry* seq_entry = seq.GetParentEntry();
495  size_t seq_level = sx_Level(seq_entry);
496  size_t parent_level = sx_GetParentLevel(&annot_entry, annot_level,
497  seq_entry, seq_level);
498  size_t level = annot_level - parent_level;
499  if ( level < closest_level ) {
500  closest_level = level;
501  closest_seq_level = seq_level;
502  closest_entry = seq_entry;
503  cached = it->second;
504  }
505  else if ( level == closest_level &&
506  seq_level < closest_seq_level ) {
507  closest_seq_level = seq_level;
508  closest_entry = seq_entry;
509  cached = it->second;
510  }
511  else if ( level == closest_level &&
512  seq_level == closest_seq_level &&
513  sx_ComesBefore(seq_entry, seq_level,
514  closest_entry, closest_seq_level) ) {
515  closest_entry = seq_entry;
516  cached = it->second;
517  }
518  }
519  return cached;
520 }
521 
522 
523 inline
524 void sx_ProcessId(const TIdMap& id_map,
525  TIdMapCache& cache,
526  const CSeq_entry& entry,
527  CSeq_id& id)
528 {
529  if ( !sx_CanReassign(id.Which()) ) {
530  return;
531  }
533  auto id_it = id_map.find(TIdKey(idh, null));
534  if ( id_it == id_map.end() || !id_it->second ) {
535  // no mapping is necessary
536  return;
537  }
538  const CSeq_id_Handle& new_id = sx_FindBestId(id_map, cache, entry, idh);
539  if ( !new_id.IsGi() ) {
540  id.Assign(*new_id.GetSeqId());
541  }
542 }
543 
544 
546 
547 
549 {
550  TIdMap id_map;
551  // id_map states:
552  // [{id, null}] -> null : unique/first id - no change
553  // [{id, null}] -> gi : next replacement suffix to try for the id
554  // [{id, seq}] -> new_id : replace 'id' of 'seq' with 'new_id'
555  // [{id, seq}] -> null : slot for replacement
556 
557  // gather conflicting ids
558  bool has_conflict = false;
560  for ( CTypeConstIterator<CBioseq> it(ConstBegin(*this)); it; ++it ) {
561  ITERATE ( CBioseq::TId, idit, it->GetId() ) {
562  if ( !sx_CanReassign((**idit).Which()) ) {
563  // only local ids can be reassigned
564  continue;
566  "CSeq_entry::ReassignConflictingIds: "
567  "conflicting id is not a Seq-id.local: "<<
568  (*idit)->AsFastaString());
569  }
571  TIdInsert ins = sx_AddId(id_map, id);
572  if ( ins.second ) {
573  // first time occurence - keep it as it is
574  // make slot marking no replacement
575  sx_AddId(id_map, id, &*it).first->second = gi1;
576  }
577  else {
578  has_conflict = true;
579  // duplicate id, start replacement search with suffix 1
580  if ( !ins.first->second ) {
581  ins.first->second = gi1;
582  }
583  // make mapping slot
584  sx_AddId(id_map, id, &*it);
585  }
586  }
587  }
588  if ( !has_conflict ) {
589  // no conflicts
590  return;
591  }
592  Parentize();
593  // assign new ids to Bioseqs
594  for ( CTypeIterator<CBioseq> it(*this); it; ++it ) {
595  NON_CONST_ITERATE ( CBioseq::TId, idit, it->SetId() ) {
596  if ( !sx_CanReassign((**idit).Which()) ) {
597  continue;
598  }
600  TIdMap::iterator map_it = id_map.find(TIdKey(id, ConstRef(&*it)));
601  if ( map_it != id_map.end() && !map_it->second ) {
602  // make replacement id
603  map_it->second = sx_MakeUniqueId(id, id_map);
604  // change it in the Bioseq
605  *idit = SerialClone(*map_it->second.GetSeqId());
606  }
607  }
608  }
609  // replace annotation ids
610  for ( CTypeIterator<CSeq_entry> it(*this); it; ++it ) {
611  if ( it->IsSetAnnot() ) {
612  TIdMapCache cache;
613  NON_CONST_ITERATE ( CSeq_entry::TAnnot, ait, it->SetAnnot() ) {
614  for ( CTypeIterator<CSeq_id> idit(**ait); idit; ++idit ) {
615  sx_ProcessId(id_map, cache, *it, *idit);
616  }
617  }
618  }
619  }
620 }
621 
622 
623 END_objects_SCOPE // namespace ncbi::objects::
624 
static CBioseq_set::ELabelType s_GetBioseqSetLabelType(CSeq_entry::ELabelType lt)
Definition: Seq_entry.cpp:262
size_t sx_Level(const CSeq_entry *entry)
Definition: Seq_entry.cpp:362
TIdInsert sx_AddId(TIdMap &id_map, const CSeq_id_Handle &id, const CBioseq *seq=0)
Definition: Seq_entry.cpp:312
const CSeq_id_Handle & sx_FindBestId(const TIdMap &id_map, TIdMapCache &cache, const CSeq_entry &annot_entry, const CSeq_id_Handle &id)
Definition: Seq_entry.cpp:435
BEGIN_LOCAL_NAMESPACE
Definition: Seq_entry.cpp:290
map< TIdKey, CSeq_id_Handle > TIdMap
Definition: Seq_entry.cpp:299
map< CSeq_id_Handle, CSeq_id_Handle > TIdMapCache
Definition: Seq_entry.cpp:433
bool sx_ComesBefore(const CSeq_entry *entry1, size_t level1, const CSeq_entry *entry2, size_t level2)
Definition: Seq_entry.cpp:396
static CBioseq::ELabelType s_GetBioseqLabelType(CSeq_entry::ELabelType lt)
Definition: Seq_entry.cpp:250
END_LOCAL_NAMESPACE
Definition: Seq_entry.cpp:545
CSeq_id_Handle sx_MakeUniqueId(const CSeq_id_Handle &idh, TIdMap &id_map)
Definition: Seq_entry.cpp:318
size_t sx_GetParentLevel(const CSeq_entry *entry1, size_t level1, const CSeq_entry *entry2, size_t level2)
Definition: Seq_entry.cpp:374
bool sx_CanReassign(CSeq_id::E_Choice type)
Definition: Seq_entry.cpp:303
pair< TIdMap::iterator, bool > TIdInsert
Definition: Seq_entry.cpp:300
pair< CSeq_id_Handle, CConstRef< CBioseq > > TIdKey
Definition: Seq_entry.cpp:298
void sx_ProcessId(const TIdMap &id_map, TIdMapCache &cache, const CSeq_entry &entry, CSeq_id &id)
Definition: Seq_entry.cpp:524
void SetParentEntry(CSeq_entry *entry)
Definition: Bioseq_set.hpp:116
void GetLabel(string *label, ELabelType type) const
Definition: Bioseq_set.cpp:107
CSeq_entry * GetParentEntry(void) const
Definition: Bioseq.hpp:174
void SetParentEntry(CSeq_entry *entry)
Definition: Bioseq.hpp:168
ELabelType
Definition: Bioseq.hpp:101
@ eContent
Definition: Bioseq.hpp:103
@ eType
Definition: Bioseq.hpp:102
@ eBoth
Definition: Bioseq.hpp:104
CConstRef< CSeqdesc > GetClosestDescriptor(CSeqdesc::E_Choice choice, int *level=NULL) const
Definition: Seq_entry.cpp:212
void GetLabel(string *label, ELabelType type, bool worst=false) const
Definition: Bioseq.cpp:202
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
Definition: Seq_entry.hpp:56
CSeq_entry * m_ParentEntry
Definition: Seq_entry.hpp:117
const TAnnot & GetAnnot(void) const
Definition: Seq_entry.cpp:179
const CSeq_descr & GetDescr(void) const
Definition: Seq_entry.cpp:120
ELabelType
Definition: Seq_entry.hpp:91
@ eBoth
Definition: Seq_entry.hpp:94
@ eType
Definition: Seq_entry.hpp:92
@ eContent
Definition: Seq_entry.hpp:93
bool IsSetAnnot(void) const
Definition: Seq_entry.cpp:165
void ResetParentEntry(void)
Definition: Seq_entry.cpp:61
CSeq_descr & SetDescr(void)
Definition: Seq_entry.cpp:150
~CSeq_entry(void)
Definition: Seq_entry.cpp:57
virtual bool UserOp_Equals(const CSerialUserOp &object) const
Will be called after comparing the datatool-generated members.
Definition: Seq_entry.cpp:244
void ReassignConflictingIds(void)
Definition: Seq_entry.cpp:548
void GetLabel(string *label, ELabelType type) const
Definition: Seq_entry.cpp:274
virtual void UserOp_Assign(const CSerialUserOp &source)
Will be called after copying the datatool-generated members.
Definition: Seq_entry.cpp:238
TAnnot & SetAnnot(void)
Definition: Seq_entry.cpp:195
void Parentize(void)
Definition: Seq_entry.cpp:71
void ParentizeOneLevel(void)
Definition: Seq_entry.cpp:89
bool IsSetDescr(void) const
Definition: Seq_entry.cpp:106
void SetParentEntry(CSeq_entry *entry)
Definition: Seq_entry.cpp:66
list< CRef< CSeq_annot > > TAnnot
Definition: Seq_entry.hpp:86
CSeq_entry * GetParentEntry(void) const
Definition: Seq_entry.hpp:131
Root class for all serialization exceptions.
Definition: exception.hpp:50
Base class for user-defined serializable classes to allow for objects assignment and comparison.
Definition: serialbase.hpp:319
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
container_type::const_iterator const_iterator
Definition: map.hpp:53
const_iterator end() const
Definition: map.hpp:152
const_iterator lower_bound(const key_type &key) const
Definition: map.hpp:154
iterator_bool insert(const value_type &val)
Definition: map.hpp:165
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: map.hpp:338
Definition: set.hpp:45
static const char si[8][64]
Definition: des.c:146
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:822
#define GI_CONST(gi)
Definition: ncbimisc.hpp:1087
#define NULL
Definition: ncbistd.hpp:225
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
Definition: ncbiexpt.hpp:704
#define NCBI_THROW_FMT(exception_class, err_code, message)
The same as NCBI_THROW but with message processed as output to ostream.
Definition: ncbiexpt.hpp:719
@ eUnknown
Definition: app_popup.hpp:72
C * SerialClone(const C &src)
Create on heap a clone of the source object.
Definition: serialbase.hpp:512
const string AsFastaString(void) const
Definition: Seq_id.cpp:2266
CConstRef< CSeq_id > GetSeqId(void) const
static CSeq_id_Handle GetGiHandle(TGi gi)
Faster way to create a handle for a gi.
bool IsGi(void) const
static CSeq_id_Handle GetHandle(const CSeq_id &id)
Normal way of getting a handle, works for any seq-id.
TGi GetGi(void) const
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
Definition: iterator.hpp:1012
CConstRef< C > ConstRef(const C *object)
Template function for conversion of const object pointer to CConstRef.
Definition: ncbiobj.hpp:2024
#define kMax_Int
Definition: ncbi_limits.h:184
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
Definition: ncbistr.hpp:673
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
Definition: ncbistr.cpp:3405
static const char label[]
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
void SetTag(TTag &value)
Assign a value to Tag data member.
Definition: Dbtag_.cpp:66
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
TStr & SetStr(void)
Select the variant.
Definition: Object_id_.hpp:304
TId GetId(void) const
Get the variant data.
Definition: Object_id_.hpp:270
TGeneral & SetGeneral(void)
Select the variant.
Definition: Seq_id_.cpp:375
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_id_.hpp:746
E_Choice
Choice variants.
Definition: Seq_id_.hpp:93
TLocal & SetLocal(void)
Select the variant.
Definition: Seq_id_.cpp:199
@ e_Other
for historical reasons, 'other' = 'refseq'
Definition: Seq_id_.hpp:104
@ e_General
for other databases
Definition: Seq_id_.hpp:105
@ e_Ddbj
DDBJ.
Definition: Seq_id_.hpp:107
@ e_Local
local use
Definition: Seq_id_.hpp:95
const TSeq & GetSeq(void) const
Get the variant data.
Definition: Seq_entry_.cpp:102
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
static string SelectionName(E_Choice index)
Retrieve selection name (for diagnostic purposes).
Definition: Seq_entry_.cpp:92
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seq_entry_.hpp:228
void SetDescr(TDescr &value)
Assign a value to Descr data member.
list< CRef< CSeq_entry > > TSeq_set
TSeq & SetSeq(void)
Select the variant.
Definition: Seq_entry_.cpp:108
@ e_not_set
No variant selected.
Definition: Seq_entry_.hpp:88
list< CRef< CSeqdesc > > Tdata
Definition: Seq_descr_.hpp:91
const Tdata & Get(void) const
Get the member data.
Definition: Seq_descr_.hpp:166
list< CRef< CSeq_id > > TId
Definition: Bioseq_.hpp:94
E_Choice
Choice variants.
Definition: Seqdesc_.hpp:109
void SetDescr(TDescr &value)
Assign a value to Descr data member.
Definition: Bioseq_.cpp:65
E_Choice Which(void) const
Which variant is currently selected.
Definition: Seqdesc_.hpp:903
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Definition: type.c:6
#define _ASSERT
Modified on Sun Apr 14 05:26:35 2024 by modify_doxy.py rev. 669887