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

Go to the SVN repository for this file.

1 /* $Id: validator.cpp 101247 2023-11-20 15:20:49Z stakhovv $
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: Jonathan Kans, Clifford Clausen, Aaron Ucko.......
27  *
28  * File Description:
29  * Validates CSeq_entries and CSeq_submits
30  *
31  */
32 #include <ncbi_pch.hpp>
33 #include <corelib/ncbistd.hpp>
34 #include <serial/serialbase.hpp>
36 #include <objects/seq/Bioseq.hpp>
37 #include <objects/seq/Seqdesc.hpp>
39 #include <objmgr/util/sequence.hpp>
41 #include <util/static_map.hpp>
42 #include <util/sgml_entity.hpp>
46 
51 
52 
55 BEGIN_SCOPE(validator)
56 USING_SCOPE(sequence);
57 
58 
59 // *********************** CValidator implementation *******************
60 //
62  CValidator(objmgr, make_shared<SValidatorContext>())
63 {
64  SetTaxon3(make_shared<CTaxon3>());
65 }
66 
68  shared_ptr<SValidatorContext> pContext):
69  m_ObjMgr{&objmgr},
70  m_pContext{pContext}
71 {}
72 
73 
74 void CValidator::SetTaxon3(shared_ptr<ITaxon3> pTaxon)
75 {
76  m_pOwnTaxon = pTaxon;
77  if (m_pOwnTaxon)
78  m_pContext->m_taxon_update = MakeTaxUpdateFunction(m_pOwnTaxon);
79 }
80 
82 {}
83 
85 {
86  taxon->Init();
87  return [remote = taxon](const vector< CRef<COrg_ref> >& query) -> CRef<CTaxon3_reply>
88  { // we need to make a copy of record to prevent changes put back to cache
89  if (!query.empty() && remote) {
90  CConstRef<CTaxon3_reply> res = remote->SendOrgRefList(query);
92  copied->Assign(*res);
93  return copied;
94  } else {
95  return {};
96  }
97  };
98 }
99 
101  const CSeq_entry& se,
102  CScope* scope,
103  Uint4 options)
104 {
105  CRef<CValidError> errors(new CValidError(&se));
107  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
109  if ( !imp.Validate(se, nullptr, scope) ) {
110  errors.Reset();
111  }
114  ctx.NumGenes += imp.GetGeneCount();
115  ctx.NumGeneXrefs += imp.GetGeneXrefCount();
116  return errors;
117 }
118 
119 
120 //LCOV_EXCL_START
121 // not used by asnvalidate, used by external programs
123  const CSeq_entry_Handle& seh,
124  Uint4 options)
125 {
128  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
130  if ( !imp.Validate(seh) ) {
131  errors.Reset();
132  }
135  ctx.NumGenes += imp.GetGeneCount();
136  ctx.NumGeneXrefs += imp.GetGeneXrefCount();
137  return errors;
138 }
139 
140 
142 {
145  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), 0);
147  if ( !imp.GetTSANStretchErrors(se) ) {
148  errors.Reset();
149  }
150  return errors;
151 }
152 
153 
155 {
158  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), 0);
160  if ( !imp.GetTSACDSOnMinusStrandErrors(se) ) {
161  errors.Reset();
162  }
163  return errors;
164 }
165 
166 
168 {
171  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), 0);
173  if ( !imp.GetTSAConflictingBiomolTechErrors(se) ) {
174  errors.Reset();
175  }
176  return errors;
177 }
178 
179 
181 {
182 
183  CRef<CValidError> errors(new CValidError(&seq));
185  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), 0);
187  if ( !imp.GetTSANStretchErrors(seq) ) {
188  errors.Reset();
189  }
190  return errors;
191 }
192 
193 
195 {
196  CRef<CValidError> errors(new CValidError(&f));
198  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), 0);
200  if ( !imp.GetTSACDSOnMinusStrandErrors(f, seq) ) {
201  errors.Reset();
202  }
203  return errors;
204 }
205 
206 
208 {
209  CRef<CValidError> errors(new CValidError(&seq));
211  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), 0);
213  if ( !imp.GetTSAConflictingBiomolTechErrors(seq) ) {
214  errors.Reset();
215  }
216  return errors;
217 }
218 //LCOV_EXCL_STOP
219 
220 
222  const CSeq_submit& ss,
223  CScope* scope,
224  Uint4 options)
225 {
227  CRef<CValidError> errors(new CValidError(&ss));
229  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
230  imp.Validate(ss, scope);
231 
233 
234  return errors;
235 }
236 
237 
239  const CSeq_annot_Handle& sah,
240  Uint4 options)
241 {
242  auto errors = Ref(new CValidError(&*(sah.GetCompleteSeq_annot())));
243  Validate(sah, options, *errors);
244  return errors;
245 }
246 
247 
249  const CSeq_annot_Handle& sah,
250  Uint4 options,
251  CValidError& errors)
252 {
253  CValidError_imp imp(*m_ObjMgr, m_pContext, &errors, options);
254  imp.Validate(sah);
255 }
256 
257 
259  const CSeq_feat& feat,
260  CScope* scope,
261  Uint4 options)
262 {
263  CRef<CValidError> errors(new CValidError(&feat));
264  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
265  imp.Validate(feat, scope);
266  return errors;
267 }
268 
269 
271  const CBioSource& src,
272  CScope* scope,
273  Uint4 options)
274 {
275  CRef<CValidError> errors(new CValidError(&src));
276  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
277  imp.Validate(src, scope);
278  return errors;
279 }
280 
282  const CPubdesc& pubdesc,
283  CScope* scope,
284  Uint4 options)
285 {
286  CRef<CValidError> errors(new CValidError(&pubdesc));
287  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
288  imp.Validate(pubdesc, scope);
289  return errors;
290 }
291 
293  const CSeqdesc& desc,
294  const CSeq_entry& ctx,
295  Uint4 options)
296 {
297  CRef<CValidError> errors(new CValidError(&desc));
298  CValidError_imp imp(*m_ObjMgr, m_pContext, &(*errors), options);
299  imp.Validate(desc, ctx);
300  return errors;
301 }
302 
303 
305  const CSeqdesc& desc) const
306 {
307  if (!desc.IsUser()) {
308  return false;
309  }
310 
311  CValidError_imp imp(const_cast<CObjectManager&>(*m_ObjMgr), m_pContext, nullptr);
312  return CValidError_desc(imp).IsValidStructuredComment(desc);
313 }
314 
315 
316 void CValidator::SetProgressCallback(TProgressCallback callback, void* user_data)
317 {
318  m_PrgCallback = callback;
319  m_UserData = user_data;
320 }
321 
322 
323 bool CValidator::BadCharsInAuthorName(const string& str, bool allowcomma, bool allowperiod, bool last)
324 {
325  if (NStr::IsBlank(str)) {
326  return false;
327  }
328 
329 
330  size_t stp = string::npos;
331  if (last) {
332  if (NStr::StartsWith(str, "St.")) {
333  stp = 2;
334  }
335  else if (NStr::StartsWith(str, "de M.")) {
336  stp = 4;
337  }
338  }
339 
340  size_t pos = 0;
341  const char *ptr = str.c_str();
342 
343  while (*ptr != 0) {
344  if (isalpha(*ptr)
345  || *ptr == '-'
346  || *ptr == '\''
347  || *ptr == ' '
348  || (*ptr == ',' && allowcomma)
349  || (*ptr == '.' && (allowperiod || pos == stp))) {
350  // all these are ok
351  ptr++;
352  pos++;
353  } else {
354  string tail = str.substr(pos);
355  if (NStr::Equal(tail, "2nd") ||
356  NStr::Equal(tail, "3rd") ||
357  NStr::Equal(tail, "4th") ||
358  NStr::Equal(tail, "5th") ||
359  NStr::Equal(tail, "6th")) {
360  return false;
361  }
362  return true;
363  }
364  }
365  return false;
366 }
367 
368 
370 {
371  if (NStr::EqualNocase(str, "et al.")) {
372  // this is ok
373  return false;
374  } else {
375  return BadCharsInAuthorName(str, false, false, true);
376  }
377 }
378 
380 {
381  return BadCharsInAuthorName(str, false, true, false);
382 }
383 
384 
386 {
387  return BadCharsInAuthorName(str, false, true, false);
388 }
389 
390 
392 {
393  return BadCharsInAuthorName(str, false, true, false);
394 }
395 
396 
397 string CValidator::BadCharsInAuthor(const CName_std& author, bool& last_is_bad)
398 {
399  string badauthor;
400  last_is_bad = false;
401 
402  if (author.IsSetLast() && BadCharsInAuthorLastName(author.GetLast())) {
403  last_is_bad = true;
404  badauthor = author.GetLast();
405  } else if (author.IsSetFirst() && BadCharsInAuthorFirstName(author.GetFirst())) {
406  badauthor = author.GetFirst();
407  }
408  else if (author.IsSetInitials() && BadCharsInAuthorInitials(author.GetInitials())) {
409  badauthor = author.GetInitials();
410  } else if (author.IsSetSuffix() && BadCharsInAuthorSuffix(author.GetSuffix())) {
411  badauthor = author.GetSuffix();
412  }
413  return badauthor;
414 }
415 
416 
417 string CValidator::BadCharsInAuthor(const CAuthor& author, bool& last_is_bad)
418 {
419  last_is_bad = false;
420  if (author.IsSetName() && author.GetName().IsName()) {
421  return BadCharsInAuthor(author.GetName().GetName(), last_is_bad);
422  } else {
423  return kEmptyStr;
424  }
425 }
426 
427 
428 typedef bool(*CompareConsecutiveIntervalProc) (const CSeq_interval& int1, const CSeq_interval& int2, CScope *scope);
429 
431  const CPacked_seqint& packed_int,
432  CConstRef<CSeq_interval>& int_cur,
433  CConstRef<CSeq_interval>& int_prv,
434  CScope* scope,
436 {
437  bool ok = true;
438  ITERATE(CPacked_seqint::Tdata, it, packed_int.Get()) {
439  int_cur = (*it);
440  if (int_prv && !compar(*int_cur, *int_prv, scope)) {
441  ok = false;
442  break;
443  }
444 
445  int_prv = int_cur;
446  }
447  return ok;
448 }
449 
450 
452 {
453  bool ok = true;
454  const CSeq_interval *int_cur = nullptr, *int_prv = nullptr;
455 
457  for (; lit && ok; ++lit) {
458  CSeq_loc::E_Choice loc_choice = lit->Which();
459  switch (loc_choice) {
460  case CSeq_loc::e_Int: {
461  int_cur = &lit->GetInt();
462  if (int_prv) {
463  ok = compar(*int_cur, *int_prv, &scope);
464  }
465  int_prv = int_cur;
466  } break;
467  case CSeq_loc::e_Pnt:
468  int_prv = nullptr;
469  break;
471  int_prv = nullptr;
472  break;
473  case CSeq_loc::e_Packed_int: {
474  CConstRef<CSeq_interval> this_int_cur(int_cur);
475  CConstRef<CSeq_interval> this_int_prv(int_prv);
477  (lit->GetPacked_int(), this_int_cur, this_int_prv, &scope, compar);
478  } break;
479  case CSeq_loc::e_Null:
480  break;
481  default:
482  int_prv = nullptr;
483  break;
484  }
485  }
486  return ok;
487 }
488 
489 
491  const CSeq_interval& int_cur,
492  const CSeq_interval& int_prv,
493  CScope* scope)
494 {
495  ENa_strand strand_cur = int_cur.IsSetStrand() ?
496  int_cur.GetStrand() : eNa_strand_unknown;
497 
498  if (IsSameBioseq(int_prv.GetId(), int_cur.GetId(), scope)) {
499  if (strand_cur == eNa_strand_minus) {
500  if (int_prv.GetTo() < int_cur.GetTo()) {
501  return false;
502  }
503  }
504  else {
505  if (int_prv.GetTo() > int_cur.GetTo()) {
506  return false;
507  }
508  }
509  }
510  return true;
511 }
512 
513 
515 {
516  CBioseq_Handle seq;
517  try {
518  CBioseq_Handle seq = scope.GetBioseqHandle(loc);
519  } catch (CObjMgrException& ) {
520  // no way to tell
521  return true;
522  } catch (const exception& ) {
523  // no way to tell
524  return true;
525  }
526  if (seq && seq.GetInst_Topology() == CSeq_inst::eTopology_circular) {
527  // no way to check if topology is circular
528  return true;
529  }
530 
532 }
533 
534 
536  const CSeq_interval& int_cur,
537  const CSeq_interval& int_prv,
538  CScope* scope)
539 {
540  ENa_strand strand_cur = int_cur.IsSetStrand() ?
541  int_cur.GetStrand() : eNa_strand_unknown;
542 
543  bool ok = true;
544  if (IsSameBioseq(int_prv.GetId(), int_cur.GetId(), scope)) {
545  if (strand_cur == eNa_strand_minus) {
546  if (int_cur.GetTo() + 1 == int_prv.GetFrom()) {
547  ok = false;
548  }
549  }
550  else {
551  if (int_prv.GetTo() + 1 == int_cur.GetFrom()) {
552  ok = false;
553  }
554  }
555  }
556  return ok;
557 }
558 
559 
561 (const CSeq_loc& loc, CScope &scope)
562 {
563  return !CheckConsecutiveIntervals(loc, scope, x_IsNotAdjacent);
564 }
565 
566 
567 bool x_SameStrand(const CSeq_interval& int1, const CSeq_interval& int2)
568 {
569  ENa_strand strand1 = int1.IsSetStrand() ?
570  int1.GetStrand() : eNa_strand_unknown;
571  ENa_strand strand2 = int2.IsSetStrand() ?
572  int2.GetStrand() : eNa_strand_unknown;
573  return (strand1 == strand2);
574 }
575 
576 
577 bool IsNotDuplicateInterval(const CSeq_interval& int1, const CSeq_interval& int2, CScope* scope)
578 {
579  if (IsSameBioseq(int1.GetId(), int2.GetId(), scope) &&
580  x_SameStrand(int1, int2) &&
581  int1.GetFrom() == int2.GetFrom() &&
582  int1.GetTo() == int2.GetTo()) {
583  return false;
584  }
585  return true;
586 }
587 
589 {
591 }
592 
593 
595 {
596  EErrType rval = eErr_UNKNOWN;
597  switch (errcode) {
600  break;
603  break;
606  break;
609  break;
610  default:
611  break;
612  }
613  return rval;
614 }
615 
616 
617 CValidator::TDbxrefValidFlags CValidator::IsValidDbxref(const CDbtag& xref, bool is_biosource, bool is_refseq_or_gps)
618 {
620 
621  if (xref.IsSetTag() && xref.GetTag().IsStr()) {
622  if (ContainsSgml(xref.GetTag().GetStr())) {
623  flags |= eTagHasSgml;
624  }
625 
626  if (xref.GetTag().GetStr().find(' ') != string::npos) {
628  }
629  }
630 
631  if (!xref.IsSetDb()) {
632  return flags;
633  }
634  const string& db = xref.GetDb();
635  string dbv;
636  if (xref.IsSetTag() && xref.GetTag().IsStr()) {
637  dbv = xref.GetTag().GetStr();
638  }
639  else if (xref.IsSetTag() && xref.GetTag().IsId()) {
640  dbv = NStr::NumericToString(xref.GetTag().GetId());
641  }
642 
643  if (ContainsSgml(db)) {
644  flags |= eDbHasSgml;
645  }
646 
647  bool src_db = false;
648  bool refseq_db = false;
649  string correct_caps;
650 
651  if (xref.GetDBFlags(refseq_db, src_db, correct_caps)) {
652  if (!NStr::EqualCase(correct_caps, db)) {
653  // capitalization is bad
655  }
656 
657  if (is_biosource && !src_db) {
658  flags |= eNotForSource;
659  if (refseq_db && is_refseq_or_gps) {
661  }
662  } else if (!is_biosource && src_db && NStr::EqualNocase(db, "taxon")) {
664  }
665  if (refseq_db && !is_refseq_or_gps) {
667  }
668  } else {
669  flags |= eUnrecognized;
670  }
671  return flags;
672 }
673 
675 {
676  m_pEntryInfo.reset(new TEntryInfo(info));
677 }
678 
679 
681 {
682  return m_pEntryInfo.get() != nullptr;
683 }
684 
685 
687 {
688  return *m_pEntryInfo;
689 }
690 
691 
692 //LCOV_EXCL_START
693 //code is not used
695 {
696  m_impl = new CCacheImpl;
697 }
698 
700 {
701  delete m_impl;
702 }
703 
706 {
707  return Ref(new CCache);
708 }
709 //LCOV_EXCL_STOP
710 
711 END_SCOPE(validator)
User-defined methods of the data storage class.
EErrType
@ eErr_SEQ_DESCR_LatLonWater
@ eErr_SEQ_DESCR_LatLonCountry
@ eErr_SEQ_DESCR_LatLonValue
@ eErr_SEQ_DESCR_LatLonState
@ eErr_UNKNOWN
#define bool
Definition: bool.h:34
CValidator::CCacheImpl CCacheImpl
Definition: cache_impl.hpp:264
CAuthor –.
Definition: Author.hpp:59
CBioseq_Handle –.
CConstRef –.
Definition: ncbiobj.hpp:1266
Definition: Dbtag.hpp:53
bool GetDBFlags(bool &is_refseq, bool &is_src, string &correct_caps) const
Definition: Dbtag.cpp:327
@Name_std.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:56
Base class for all object manager exceptions.
CObjectManager –.
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
CRef –.
Definition: ncbiobj.hpp:618
CScope –.
Definition: scope.hpp:92
CSeq_annot_Handle –.
CSeq_entry_Handle –.
Definition: Seq_entry.hpp:56
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
@ eLatLonCountryErr_Value
Definition: SubSource.hpp:191
@ eLatLonCountryErr_State
Definition: SubSource.hpp:189
@ eLatLonCountryErr_Water
Definition: SubSource.hpp:190
@ eLatLonCountryErr_Country
Definition: SubSource.hpp:188
CTaxon3_reply –.
Template class for iteration on objects of class C (non-medifiable version)
Definition: iterator.hpp:767
static void SetSuppressionRules(const CUser_object &user, CValidError &errors)
bool IsValidStructuredComment(const CSeqdesc &desc)
SIZE_TYPE GetGeneCount(void) const
bool GetTSAConflictingBiomolTechErrors(const CSeq_entry_Handle &se)
bool Validate(const CSeq_entry &se, const CCit_sub *cs=nullptr, CScope *scope=nullptr)
SIZE_TYPE GetGeneXrefCount(void) const
const CValidatorEntryInfo & GetEntryInfo() const
SValidatorContext & SetContext()
Definition: validatorp.cpp:194
void SetProgressCallback(CValidator::TProgressCallback callback, void *user_data)
bool GetTSACDSOnMinusStrandErrors(const CSeq_entry_Handle &se)
bool GetTSANStretchErrors(const CSeq_entry_Handle &se)
CRef< CValidError > Validate(const CSeq_entry &se, CScope *scope=nullptr, Uint4 options=0)
Definition: validator.cpp:100
CRef< CObjectManager > m_ObjMgr
Definition: validator.hpp:277
CConstRef< CValidError > GetTSANStretchErrors(const CSeq_entry_Handle &se)
Definition: validator.cpp:141
void x_SetEntryInfo(const TEntryInfo &info)
Definition: validator.cpp:674
CConstRef< CValidError > GetTSACDSOnMinusStrandErrors(const CSeq_entry_Handle &se)
Definition: validator.cpp:154
unique_ptr< CValidatorEntryInfo > m_pEntryInfo
Definition: validator.hpp:283
static CRef< CCache > MakeEmptyCache()
Definition: validator.cpp:705
TProgressCallback m_PrgCallback
Definition: validator.hpp:280
@ eVal_seqsubmit_parent
Definition: validator.hpp:83
static TDbxrefValidFlags IsValidDbxref(const CDbtag &xref, bool is_biosource, bool is_refseq_or_gps)
Definition: validator.cpp:617
int TDbxrefValidFlags
Definition: validator.hpp:265
static bool BadCharsInAuthorFirstName(const string &str)
Definition: validator.cpp:379
@ eRefSeqNotForSource
Definition: validator.hpp:261
@ eBadCapitalization
Definition: validator.hpp:262
shared_ptr< SValidatorContext > m_pContext
Definition: validator.hpp:282
static bool DoesSeqLocContainDuplicateIntervals(const CSeq_loc &loc, CScope &scope)
Definition: validator.cpp:588
void SetProgressCallback(TProgressCallback callback, void *user_data=nullptr)
Definition: validator.cpp:316
CConstRef< CValidError > GetTSAConflictingBiomolTechErrors(const CSeq_entry_Handle &se)
Definition: validator.cpp:167
const TEntryInfo & GetEntryInfo() const
Definition: validator.cpp:686
void * m_UserData
Definition: validator.hpp:281
static bool BadCharsInAuthorInitials(const string &str)
Definition: validator.cpp:385
static EErrType ConvertCode(CSubSource::ELatLonCountryErr errcode)
Definition: validator.cpp:594
static bool DoesSeqLocContainAdjacentIntervals(const CSeq_loc &loc, CScope &scope)
Definition: validator.cpp:561
static bool BadCharsInAuthorName(const string &str, bool allowcomma, bool allowperiod, bool last)
Definition: validator.cpp:323
bool IsValidStructuredComment(const CSeqdesc &desc) const
Definition: validator.cpp:304
shared_ptr< ITaxon3 > m_pOwnTaxon
Definition: validator.hpp:278
CValidatorEntryInfo TEntryInfo
Definition: validator.hpp:270
static string BadCharsInAuthor(const CName_std &author, bool &last_is_bad)
Definition: validator.cpp:397
static bool IsSeqLocCorrectlyOrdered(const CSeq_loc &loc, CScope &scope)
Definition: validator.cpp:514
static bool BadCharsInAuthorLastName(const string &str)
Definition: validator.cpp:369
void SetTaxon3(shared_ptr< ITaxon3 > taxon)
Definition: validator.cpp:74
bool IsSetEntryInfo() const
Definition: validator.cpp:680
static taxupdate_func_t MakeTaxUpdateFunction(shared_ptr< ITaxon3 > taxon)
Definition: validator.cpp:84
static bool BadCharsInAuthorSuffix(const string &str)
Definition: validator.cpp:391
CValidator(CObjectManager &objmgr)
Definition: validator.cpp:61
Include a standard set of the NCBI C++ Toolkit most basic headers.
static uch flags
CS_CONTEXT * ctx
Definition: t0006.c:12
static DLIST_TYPE *DLIST_NAME() last(DLIST_LIST_TYPE *list)
Definition: dlist.tmpl.h:51
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
~CCache(void)
Definition: ncbi_cache.hpp:338
CCache(TSizeType capacity, THandler *handler=NULL)
Create cache object with the given capacity.
Definition: ncbi_cache.hpp:326
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
Definition: iterator.hpp:1012
bool IsSameBioseq(const CSeq_id &id1, const CSeq_id &id2, CScope *scope, CScope::EGetBioseqFlag get_flag=CScope::eGetBioseq_All)
Determines if two CSeq_ids represent the same CBioseq.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
Definition: scope.cpp:95
CConstRef< CSeq_annot > GetCompleteSeq_annot(void) const
Complete and return const reference to the current seq-annot.
TInst_Topology GetInst_Topology(void) const
CConstRef< CSeq_entry > GetCompleteSeq_entry(void) const
Complete and get const reference to the seq-entry.
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
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 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 kEmptyStr
Definition: ncbistr.hpp:123
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:106
static bool EqualCase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-sensitive equality of a substring with another string.
Definition: ncbistr.hpp:5324
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5411
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
Definition: ncbistr.hpp:5352
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 bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
Definition: ncbistr.hpp:5383
const TName & GetName(void) const
Get the Name member data.
Definition: Author_.hpp:352
bool IsSetName(void) const
Author, Primary or Secondary Check if a value has been assigned to Name data member.
Definition: Author_.hpp:340
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
bool IsSetDb(void) const
name of database or system Check if a value has been assigned to Db data member.
Definition: Dbtag_.hpp:208
const TTag & GetTag(void) const
Get the Tag member data.
Definition: Dbtag_.hpp:267
bool IsSetSuffix(void) const
Jr, Sr, III Check if a value has been assigned to Suffix data member.
Definition: Name_std_.hpp:645
bool IsId(void) const
Check if variant Id is selected.
Definition: Object_id_.hpp:264
bool IsSetTag(void) const
appropriate tag Check if a value has been assigned to Tag data member.
Definition: Dbtag_.hpp:255
const TInitials & GetInitials(void) const
Get the Initials member data.
Definition: Name_std_.hpp:610
bool IsName(void) const
Check if variant Name is selected.
Definition: Person_id_.hpp:359
const TDb & GetDb(void) const
Get the Db member data.
Definition: Dbtag_.hpp:220
bool IsSetInitials(void) const
first + middle initials Check if a value has been assigned to Initials data member.
Definition: Name_std_.hpp:598
bool IsSetLast(void) const
Check if a value has been assigned to Last data member.
Definition: Name_std_.hpp:410
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
const TSuffix & GetSuffix(void) const
Get the Suffix member data.
Definition: Name_std_.hpp:657
const TFirst & GetFirst(void) const
Get the First member data.
Definition: Name_std_.hpp:469
const TLast & GetLast(void) const
Get the Last member data.
Definition: Name_std_.hpp:422
const TName & GetName(void) const
Get the variant data.
Definition: Person_id_.cpp:137
bool IsSetFirst(void) const
Check if a value has been assigned to First data member.
Definition: Name_std_.hpp:457
TId GetId(void) const
Get the variant data.
Definition: Object_id_.hpp:270
list< CRef< CSeq_interval > > Tdata
ENa_strand
strand of nucleic acid
Definition: Na_strand_.hpp:64
const Tdata & Get(void) const
Get the member data.
const TId & GetId(void) const
Get the Id member data.
TFrom GetFrom(void) const
Get the From member data.
bool IsSetStrand(void) const
Check if a value has been assigned to Strand data member.
TStrand GetStrand(void) const
Get the Strand member data.
TTo GetTo(void) const
Get the To member data.
E_Choice
Choice variants.
Definition: Seq_loc_.hpp:96
@ eNa_strand_minus
Definition: Na_strand_.hpp:67
@ eNa_strand_unknown
Definition: Na_strand_.hpp:65
@ e_Null
not placed
Definition: Seq_loc_.hpp:98
@ e_Int
from to
Definition: Seq_loc_.hpp:101
bool IsUser(void) const
Check if variant User is selected.
Definition: Seqdesc_.hpp:1122
function< CRef< CTaxon3_reply >(const vector< CRef< COrg_ref > > &list)> taxupdate_func_t
Definition: itaxon3.hpp:60
static MDB_envinfo info
Definition: mdb_load.c:37
int isalpha(Uchar c)
Definition: ncbictype.hpp:61
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
The Object manager core.
bool ContainsSgml(const string &str)
static const char * str(char *buf, int n)
Definition: stats.c:84
static string query
bool x_CompareConsecutiveIntervals(const CPacked_seqint &packed_int, CConstRef< CSeq_interval > &int_cur, CConstRef< CSeq_interval > &int_prv, CScope *scope, CompareConsecutiveIntervalProc compar)
Definition: validator.cpp:430
bool x_IsNotAdjacent(const CSeq_interval &int_cur, const CSeq_interval &int_prv, CScope *scope)
Definition: validator.cpp:535
bool x_IsCorrectlyOrdered(const CSeq_interval &int_cur, const CSeq_interval &int_prv, CScope *scope)
Definition: validator.cpp:490
bool CheckConsecutiveIntervals(const CSeq_loc &loc, CScope &scope, CompareConsecutiveIntervalProc compar)
Definition: validator.cpp:451
bool(* CompareConsecutiveIntervalProc)(const CSeq_interval &int1, const CSeq_interval &int2, CScope *scope)
Definition: validator.cpp:428
bool IsNotDuplicateInterval(const CSeq_interval &int1, const CSeq_interval &int2, CScope *scope)
Definition: validator.cpp:577
USING_SCOPE(sequence)
bool x_SameStrand(const CSeq_interval &int1, const CSeq_interval &int2)
Definition: validator.cpp:567
Modified on Mon Dec 11 02:34:56 2023 by modify_doxy.py rev. 669887