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

Go to the SVN repository for this file.

1 /* $Id: discrepancy_core.hpp 101518 2023-12-23 18:46:16Z gotvyans $
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  * Authors: Sema
27  * Created: 01/29/2015
28  */
29 
30 #ifndef _MISC_DISCREPANCY_DISCREPANCY_CORE_H_
31 #define _MISC_DISCREPANCY_DISCREPANCY_CORE_H_
32 
38 #include <objects/pub/Pub.hpp>
40 #include <objects/seq/Pubdesc.hpp>
45 #include <objmgr/util/sequence.hpp>
46 
50 
51 /// Housekeeping classes
52 
53 // forward declararions
54 class CDiscrepancyCore;
56 class CDiscrepancyObject;
57 class CReportNode;
58 
60 {
64  eTestNames Name;
65  string_view sName;
66  string_view Descr;
68  const std::initializer_list<const char*>* Aliases;
69 };
70 
71 template<eTestNames _Name>
73 {
74 public:
76 };
77 
78 
79 template<typename T> struct CSimpleTypeObject : public CObject
80 {
82  CSimpleTypeObject(const T& v) : Value(v) {};
84 };
85 
86 
88 {
89 public:
90  CDiscrepancyItem(const string& msg)
91  : m_Msg(msg) {}
92 
93  /// @deprecated
94  /// Use CDiscrepancyItem(string_view title, const string& name, const string& msg, const string& xml, const string& unit, size_t count) constructor
96  const string& msg, const string& xml, const string& unit, size_t count));
97 
98  CDiscrepancyItem(string_view title, const string& name, const string& msg, const string& xml, const string& unit, size_t count)
99  : m_Title(title), m_Str(name), m_Msg(msg), m_Xml(xml), m_Unit(unit), m_Count(count) {}
100 
101 public:
102  string_view GetTitle() const override { return m_Title; };
103  string GetStr() const override { return m_Str; }
104  string GetMsg() const override { return m_Msg; }
105  string GetXml() const override { return m_Xml; }
106  string GetUnit() const override { return m_Unit; }
107  size_t GetCount() const override { return m_Count; }
108 
109  TReportObjectList GetDetails() const override { return m_Objs; }
111  TReportItemList GetSubitems() const override { return m_Subs; }
112 
113  bool CanAutofix() const override { return m_Autofix; }
114  void SetAutofix(bool value) { m_Autofix = value; }
115 
116  ESeverity GetSeverity() const override { return m_Severity; }
117  bool IsFatal() const override { return m_Severity == eSeverity_error; }
118  bool IsInfo() const override { return m_Severity == eSeverity_info; }
119  bool IsExtended() const override { return m_Ext; }
120  bool IsSummary() const override { return m_Summ; }
121  bool IsReal() const override { return !m_Title.empty(); }
122 
123 protected:
124  string_view m_Title;
125  string m_Str;
126  string m_Msg;
127  string m_Xml;
128  string m_Unit;
129  size_t m_Count{ 0 };
130  mutable bool m_Autofix{ false };
132  bool m_Ext{ false };
133  bool m_Summ{ false };
136 
137 
138 friend class CReportNode;
139 friend class CDiscrepancyGroup;
140 };
141 
142 
144 {
145  const CReportObj* P;
146  CReportObjPtr(const CReportObj* p) : P(p) {}
147  friend bool operator<(const CReportObjPtr& one, const CReportObjPtr& another);
148 };
150 
151 
152 class CReportNode : public CObject
153 {
154 public:
156 
157  CReportNode() = default;
158  CReportNode(const string& name) : m_Name(name) {}
159  CReportNode& Merge(CReportNode& other);
160 
161  CReportNode& operator[](const string& name);
162 
166  CReportNode& Ext(bool b = true) { m_Ext = b; return *this; }
167  CReportNode& Summ(bool b = true) { m_Summ = b; return *this; }
168  CReportNode& NoRec(bool b = true) { m_NoRec = b; return *this; }
169  CReportNode& Incr() { m_Count++; return *this; }
170 
171  static bool Exist(TReportObjectSet& hash, CReportObj& obj) { return hash.find(&obj) != hash.end(); }
172  bool Exist(const string& name) const { return m_Map.find(name) != m_Map.end(); }
173  bool Exist(CReportObj& obj) { return Exist(m_Hash, obj); }
174  static void Add(TReportObjectList& list, TReportObjectSet& hash, CReportObj& obj, bool unique = true);
175  CReportNode& Add(CReportObj& obj, bool unique = true) { Add(m_Objs, m_Hash, obj, unique); return *this; }
176  static void Add(TReportObjectList& list, TReportObjectSet& hash, TReportObjectList& objs, bool unique = true);
177  CReportNode& Add(TReportObjectList& objs, bool unique = true) { Add(m_Objs, m_Hash, objs, unique); return *this; }
178 
180  TNodeMap& GetMap() { return m_Map; }
181  size_t GetCount() const { return m_Count > 0 ? m_Count : m_Objs.size(); }
182  void SetCount(size_t n) { m_Count = n; }
183  CRef<CReportItem> Export(CDiscrepancyCore& test, bool unique = true) const;
184  void Copy(CRef<CReportNode> other);
185  bool Promote();
186 
187  bool empty() const { return m_Map.empty() && m_Objs.empty(); }
188  void clear() { m_Map.clear(); m_Objs.clear(); m_Hash.clear(); }
189  void clearObjs() { m_Objs.clear(); }
190 protected:
191  string m_Name;
196  bool m_Autofix{ false };
197  bool m_Ext{ false };
198  bool m_Summ{ false };
199  bool m_NoRec{ false }; // don't collect objects recursively
200  size_t m_Count{ 0 };
201 };
202 
203 
205 {
206 public:
207  CDiscrepancyCore(const CDiscrepancyCaseProps* props) : m_props(props) {}
208  eTestNames GetName() const override { return m_props->Name; }
209  string_view GetSName() const override { return m_props->sName; }
210  string_view GetDescription() const override { return m_props->Descr; }
211  eTestTypes GetType() const override { return m_props->Type; }
212 
213  virtual void Summarize() = 0;
214  bool Empty() const { return m_Objs.empty(); }
215  const TReportItemList& GetReport() const override { return m_ReportItems; }
216  TReportObjectList GetObjects() const override;
217  [[nodiscard]]
219  void Call(CDiscrepancyContext& context);
220  virtual void Visit(CDiscrepancyContext& context) = 0;
221  void Merge(CDiscrepancyCore& other);
222 protected:
225  //size_t m_Count = 0;
227  void xSummarize();
228 };
229 
231 
232 template<eTestNames _Name>
234 {};
235 
236 template<eTestNames _Name>
238 {
239 public:
242  {
244  }
245  [[nodiscard]]
247  {
248  return CRef<CAutofixReport>();
249  }
251  void Summarize() override { xSummarize(); } // default implementation
252 protected:
254 };
255 
257 {
258  static const size_t WINDOW_SIZE = 30;
260  void clear() {
261  Len = 0; A = 0; C = 0; G = 0; T = 0; N = 0; Other = 0; Gaps = 0;
262  First = true; StartsWithGap = false; EndsWithGap = false; HasRef = false;
263  Label.clear(); Stats.clear(); NRuns.clear();
264  MaxN = 0; MinQ = 0;
265  _Pos = 0; _Ns = 0;
266  _QS = 0; _CBscore[0] = 0; _CBposition[0] = 0; _CBread = 0; _CBwrite = 0;
267  }
268  size_t Len;
269  size_t A;
270  size_t C;
271  size_t G;
272  size_t T;
273  size_t N;
274  size_t Other;
275  size_t Gaps;
276  size_t MaxN;
277  size_t MinQ;
278  bool First;
281  bool HasRef;
282  string Label;
283  // add more counters if needed
284  vector<pair<size_t, size_t>> NRuns;
285  size_t _QS;
288  size_t _CBread; // read pointer
289  size_t _CBwrite; // write pointer
290  size_t _Pos;
291  size_t _Ns;
292 
293  mutable string Stats;
294  string GetStats() const;
295 };
296 
297 /// CDiscrepancyContext - manage and run the list of tests
298 
299 // GENE_PRODUCT_CONFLICT
300 typedef list<pair<CRef<CDiscrepancyObject>, string>> TGenesList;
302 
303 /// BIG FILE
305 class CReadHook_Bioseq;
307 class CCopyHook_Bioseq;
308 class CCopyHook_Seq_descr;
309 class CCopyHook_Seq_annot;
310 
312 {
313 public:
314  void OutputText(CNcbiOstream& out, unsigned short flags, char group = 0) override;
315  void OutputXML(CNcbiOstream& out, unsigned short flags) override;
316  void Merge(CDiscrepancyProduct& other) override;
317  void Summarize() override;
319 protected:
320 };
321 
323 {
324 protected:
325  struct CParseNode;
326  struct CRefNode;
327 
328 public:
329  enum EFlag {
330  eHasRearranged = 1 << 0,
331  eHasSatFeat = 1 << 1,
332  eHasNonSatFeat = 1 << 2
333  };
334 
335  CDiscrepancyContext(objects::CScope& scope) : m_Scope(&scope) {}
336 
337  CRef<CDiscrepancyProduct> RunTests(const TTestNamesSet& testnames, const CSerialObject& object, const string& filename) override;
339  void AddTest(eTestNames name) override;
340 
341  void AddTest(string_view name) override;
342  void Push(const CSerialObject& root, const string& fname) override;
343  void Parse() override { ParseAll(*m_RootNode); }
344  void Parse(const CSerialObject& root, const string& fname); // override;
345  void ParseObject(const CBioseq& root);
346  void ParseObject(const CBioseq_set& root);
347  void ParseObject(const CSeq_entry& root);
348  void ParseObject(const CSeq_submit& root);
349  void ParseStream(CObjectIStream& stream, const string& fname, bool skip, const string& default_header = kEmptyStr) override;
350  void ParseStrings(const string& fname) override;
351  //void TestString(const string& str) override;
352  unsigned Summarize() override;
353  map<string, size_t> Autofix() override;
354  void Autofix(TReportObjectList& tofix, map<string, size_t>& rep, const string& default_header = kEmptyStr) override;
355  void AutofixFile(vector<CDiscrepancyObject*>&fixes, const string& default_header);
356  TDiscrepancyCaseMap GetTests() const override;
357  //void OutputText(CNcbiOstream& out, unsigned short flags, char group) override;
358  //void OutputXML(CNcbiOstream& out, unsigned short flags) override;
359 
360  CParseNode* FindNode(const CRefNode& obj);
361  const CObject* GetMore(CReportObj& obj);
362  const CSerialObject* FindObject(CReportObj& obj, bool alt = false) override;
363  void ReplaceObject(CReportObj& obj, CSerialObject*, bool alt = false);
364  void ReplaceSeq_feat(CReportObj& obj, const CSeq_feat& old_feat, CSeq_feat& new_feat, bool alt = false);
367 
368  const string& CurrentText() const { return m_CurrentNode->m_Ref->m_Text; }
369  const CBioseq& CurrentBioseq() const { return *dynamic_cast<const CBioseq*>(&*m_CurrentNode->m_Obj); }
370  const CBioseq_set& CurrentBioseq_set() const { return *dynamic_cast<const CBioseq_set*>(&*m_CurrentNode->m_Obj); }
371  const CSeqSummary& CurrentBioseqSummary() const;
372  unsigned char ReadFlags() const { return m_CurrentNode->m_Flags; }
373  void PropagateFlags(unsigned char f) { for (CParseNode* node = m_CurrentNode; node; node = node->m_Parent) node->m_Flags |= f; }
374 
375  objects::CScope& GetScope() const { return const_cast<objects::CScope&>(*m_Scope); }
376 
377  //void SetFile(const string& fname);
378  void SetSuspectRules(const string& name, bool read = true) override;
381 
382  // Lazy
383  static bool IsUnculturedNonOrganelleName(const string& taxname);
384  static bool HasLineage(const CBioSource& biosrc, const string& def_lineage, const string& type);
385  bool HasLineage(const CBioSource* biosrc, const string& lineage) const;
386  static bool IsOrganelle(const CBioSource* biosrc);
387  bool IsEukaryotic(const CBioSource* biosrc) const;
388  bool IsBacterial(const CBioSource* biosrc) const;
389  bool IsViral(const CBioSource* biosrc) const;
390  const CSeqSummary& GetSeqSummary() { return *m_CurrentNode->m_BioseqSummary; }
391  void BuildSeqSummary(const CBioseq& bs, CSeqSummary& summary);
392  bool InGenProdSet() const { return m_CurrentNode->InGenProdSet(); }
393  CConstRef<CSeqdesc> GetTitle() const { return m_CurrentNode->GetTitle(); }
394  CConstRef<CSeqdesc> GetMolinfo() const { return m_CurrentNode->GetMolinfo(); }
395  CConstRef<CSeqdesc> GetBiosource() const { return m_CurrentNode->GetBiosource(); }
396  const vector<CConstRef<CSeqdesc>>& GetSetBiosources() const { return m_CurrentNode->m_SetBiosources; }
397 
398  static string GetGenomeName(unsigned n);
399  static string GetAminoacidName(const CSeq_feat& feat); // from tRNA
400  bool IsBadLocusTagFormat(const string& locus_tag) const;
401  bool IsRefseq() const;
402  bool IsBGPipe();
403  bool IsPseudo(const CSeq_feat& feat);
404  const CSeq_feat* GetGeneForFeature(const CSeq_feat& feat);
405  string GetProdForFeature(const CSeq_feat& feat);
406  void CollectFeature(const CSeq_feat& feat);
407  void ClearFeatureList();
408  const vector<const CSeq_feat*>& FeatAll() { return m_FeatAll; }
409  const vector<const CSeq_feat*>& FeatGenes() { return m_FeatGenes; }
410  const vector<const CSeq_feat*>& FeatPseudo() { return m_FeatPseudo; }
411  const vector<const CSeq_feat*>& FeatCDS() { return m_FeatCDS; }
412  const vector<const CSeq_feat*>& FeatMRNAs() { return m_FeatMRNAs; }
413  const vector<const CSeq_feat*>& FeatRRNAs() { return m_FeatRRNAs; }
414  const vector<const CSeq_feat*>& FeatTRNAs() { return m_FeatTRNAs; }
415  const vector<const CSeq_feat*>& Feat_RNAs() { return m_Feat_RNAs; }
416  const vector<const CSeq_feat*>& FeatExons() { return m_FeatExons; }
417  const vector<const CSeq_feat*>& FeatIntrons() { return m_FeatIntrons; }
418  const vector<const CSeq_feat*>& FeatMisc() { return m_FeatMisc; }
419 
420  sequence::ECompare Compare(const CSeq_loc& loc1, const CSeq_loc& loc2) const;
421 
422 /// BIG FILE
423  enum EFixType {
427  eFixSet
428  };
429 
430  CRefNode* ContainingSet(CRefNode& ref);
431  CRef<CDiscrepancyObject> BioseqObjRef(EFixType fix = eFixNone, const CObject* more = nullptr);
432  CRef<CDiscrepancyObject> BioseqSetObjRef(bool fix = false, const CObject* more = nullptr);
433  CRef<CDiscrepancyObject> SubmitBlockObjRef(bool fix = false, const CObject* more = nullptr);
434  CRef<CDiscrepancyObject> SeqFeatObjRef(const CSeq_feat& feat, EFixType fix = eFixNone, const CObject* more = nullptr);
435  CRef<CDiscrepancyObject> SeqFeatObjRef(const CSeq_feat& feat, const CObject* fix, const CObject* more = nullptr);
436  CRef<CDiscrepancyObject> SeqdescObjRef(const CSeqdesc& desc, const CObject* fix = nullptr, const CObject* more = nullptr);
437  CRef<CDiscrepancyObject> BiosourceObjRef(const CBioSource& biosrc, bool fix = false, const CObject* more = nullptr);
438  CRef<CDiscrepancyObject> PubdescObjRef(const CPubdesc& pubdesc, bool fix = false, const CObject* more = nullptr);
439  CRef<CDiscrepancyObject> AuthorsObjRef(const CAuth_list& authors, bool fix = false, const CObject* more = nullptr);
440  CRef<CDiscrepancyObject> StringObjRef(const CObject* fix = nullptr, const CObject* more = nullptr);
441  bool IsBioseq() const { return m_CurrentNode->m_Type == eBioseq; }
442  const CPub* AuthPub(const CAuth_list* a) const { auto& apm = m_CurrentNode->m_AuthorPubMap; auto it = apm.find(a); return it == apm.end() ? nullptr : it->second; }
443 
445  {
447  CSeqdesc_vec(CParseNode& n) : node(n) {}
448  struct iterator
449  {
450  vector<CRef<CParseNode>>::iterator it;
451  iterator(vector<CRef<CParseNode>>::iterator x) : it(x) {}
452  void operator++() { ++it; }
453  bool operator!=(const iterator& x) const { return it != x.it; }
454  bool operator==(const iterator& x) const { return !(x != *this); }
455  const CSeqdesc& operator*() { return static_cast<const CSeqdesc&>(*(*it)->m_Obj); }
456  };
457  iterator begin() { return iterator(node.m_Descriptors.begin()); }
458  iterator end() { return iterator(node.m_Descriptors.end()); }
459  };
460 
462  {
465  struct iterator
466  {
467  vector<CRef<CParseNode>>::iterator it;
468  iterator(vector<CRef<CParseNode>>::iterator x) : it(x) {}
469  void operator++() { ++it; }
470  bool operator!=(const iterator& x) const { return it != x.it; }
471  bool operator==(const iterator& x) const { return !(x != *this); }
472  const CSeq_feat& operator*() { return static_cast<const CSeq_feat&>(*(*it)->m_Obj); }
473  };
474  iterator begin() { return iterator(node.m_Features.begin()); }
475  iterator end() { return iterator(node.m_Features.end()); }
476  };
477 
479  {
481  CSeqdesc_run(CParseNode& n) : node(n) {}
482  struct iterator
483  {
485  vector<CRef<CParseNode>>::iterator it;
486  iterator(CParseNode* n) : node(n) {
487  while (node) {
488  it = node->m_Descriptors.begin();
489  if (it != node->m_Descriptors.end()) return;
490  node = node->m_Parent;
491  }
492  }
493  void operator++() {
494  ++it;
495  while (node) {
496  if (it != node->m_Descriptors.end()) return;
497  node = node->m_Parent;
498  if (node) it = node->m_Descriptors.begin();
499  }
500  }
501  bool operator!=(const iterator& x) const { return node != x.node || (node && it != x.it); }
502  bool operator==(const iterator& x) const { return !(x != *this); }
503  const CSeqdesc& operator*() { return static_cast<const CSeqdesc&>(*(*it)->m_Obj); }
504  };
505  iterator begin() { return iterator(&node); }
506  iterator end() { return iterator(nullptr); }
507  };
508 
510  {
513  struct iterator
514  {
516  bool follow;
517  vector<CRef<CParseNode>>::iterator it;
518  iterator(CParseNode* n) : node(n), follow(n && n->m_Type == eBioseq && static_cast<const CBioseq&>(*n->m_Obj).IsNa()) {
519  while (node) {
520  it = node->m_Features.begin();
521  if (it != node->m_Features.end()) return;
522  node = follow ? node->m_Parent : nullptr;
523  }
524  }
525  void operator++() {
526  ++it;
527  while (node) {
528  if (it != node->m_Features.end()) return;
529  node = follow ? node->m_Parent : nullptr;
530  if (node) it = node->m_Features.begin();
531  }
532  }
533  bool operator!=(const iterator& x) const { return node != x.node || (node && it != x.it); }
534  bool operator==(const iterator& x) const { return !(x != *this); }
535  const CSeq_feat& operator*() { return static_cast<const CSeq_feat&>(*(*it)->m_Obj); }
536  };
537  iterator begin() { return iterator(&node); }
538  iterator end() { return iterator(nullptr); }
539  };
540 
541  CSeqdesc_vec GetSeqdesc() { return CSeqdesc_vec(*m_CurrentNode); }
542  CSeq_feat_vec GetFeat() { return CSeq_feat_vec(*m_CurrentNode); }
543  CSeqdesc_run GetAllSeqdesc() { return CSeqdesc_run(*m_CurrentNode); }
544  CSeq_feat_run GetAllFeat() { return CSeq_feat_run(*m_CurrentNode); }
545  const vector<const CBioSource*>& GetBiosources() const { return m_CurrentNode->m_Biosources; }
546  const vector<const CPubdesc*>& GetPubdescs() const { return m_CurrentNode->m_Pubdescs; }
547  const vector<const CAuth_list*>& GetAuthors() const { return m_CurrentNode->m_Authors; }
548  const CPerson_id* GetPerson_id() const;
549  const CSubmit_block* GetSubmit_block() const;
550 
551 protected:
555  vector<CConstRef<CBioseq_set>> m_Bioseq_set_Stack;
568  vector<const CSeq_feat*> m_FeatAll;
569  vector<const CSeq_feat*> m_FeatGenes;
570  vector<const CSeq_feat*> m_FeatPseudo;
571  vector<const CSeq_feat*> m_FeatCDS;
572  vector<const CSeq_feat*> m_FeatMRNAs;
573  vector<const CSeq_feat*> m_FeatRRNAs;
574  vector<const CSeq_feat*> m_FeatTRNAs;
575  vector<const CSeq_feat*> m_Feat_RNAs; // other RNA
576  vector<const CSeq_feat*> m_FeatExons;
577  vector<const CSeq_feat*> m_FeatIntrons;
578  vector<const CSeq_feat*> m_FeatMisc;
580  vector<CDiscrepancyObject*>* m_Fixes;
581 
582  CParseNode* FindLocalNode(const CParseNode& node, const CSeq_feat& feat) const;
583  CParseNode* FindNode(const CObject* obj) const;
584  CParseNode* FindNode(const CSeq_feat& feat) const;
585  CParseNode* FindNode(const CSeqdesc& desc) const;
586  static bool InNucProtSet(const CParseNode* node) { for (; node; node = node->m_Parent) if (node->m_Type == eSeqSet_NucProt) return true; return false; }
587  static bool InGenProdSet(const CParseNode* node) { for (; node; node = node->m_Parent) if (node->m_Type == eSeqSet_GenProd) return true; return false; }
588  bool CanFix();
589  bool CanFixBioseq_set();
590  bool CanFixBioseq();
591  bool CanFixSeq_annot();
592  bool CanFixSeqdesc();
593  bool CanFixSubmit_block();
594  bool CanFixBioseq(CRefNode& refnode);
595  bool CanFixBioseq_set(CRefNode& refnode);
596  bool CanFixFeat(CRefNode& refnode);
597  bool CanFixDesc(CRefNode& refnode);
598  bool CanFixSubmit_block(CRefNode& refnode);
599  void AutofixBioseq();
600  void AutofixBioseq_set();
601  void AutofixSeq_annot();
602  void AutofixSeq_descr();
603  void AutofixSubmit_block();
609 
611 #define ADD_DISCREPANCY_TYPE(type) vector<CDiscrepancyCore*> m_All_##type;
612 
622 
623 
624 /// BIG FILE
625 friend class CReadHook_Bioseq_set;
627 friend class CReadHook_Bioseq;
628 friend class CCopyHook_Bioseq_set;
629 friend class CCopyHook_Bioseq;
630 friend class CCopyHook_Seq_descr;
631 friend class CCopyHook_Seq_annot;
633 
634  enum EObjType {
648  eString
649  };
650 
651  static bool IsSeqSet(EObjType n) {
652  switch (n) {
653  case eSeqSet:
654  case eSeqSet_NucProt:
655  case eSeqSet_GenProd:
656  case eSeqSet_SegSet:
657  case eSeqSet_Genome:
658  case eSeqSet_Funny:
659  return true;
660  default:
661  return false;
662  }
663  }
664  static string TypeName(EObjType n) {
665  static const char* names[] =
666  {
667  "None",
668  "File",
669  "Submit",
670  "SeqSet",
671  "SeqSet_NucProt",
672  "SeqSet_GenProd",
673  "SeqSet_SegSet",
674  "SeqSet_Genome",
675  "SeqSet_Funny",
676  "Bioseq",
677  "SeqFeat",
678  "SeqDesc",
679  "SubmitBlock",
680  "String"
681  };
682  return names[n];
683  }
684 
685  struct CRefNode : public CObject
686  {
687  CRefNode(EObjType type, unsigned index) : m_Type(type), m_Index(index) {}
688 
690  size_t m_Index;
692  mutable string m_Text;
693 
694  string GetText() const;
695  string GetBioseqLabel() const;
696  //bool operator<(const CRefNode&) const;
697  };
698 
699  struct CParseNode : public CObject
700  {
701  enum EInfo {
702  eIsPseudo = 1 << 0,
703  eKnownPseudo = 1 << 1,
704  eKnownGene = 1 << 2,
705  eKnownProduct = 1 << 3
706  };
707 
708  CParseNode(EObjType type, unsigned index, CParseNode* parent = nullptr) : m_Type(type), m_Index(index), m_Repeat(false), m_Info(0), m_Flags(0), m_Parent(parent) {
709  m_Ref.Reset(new CRefNode(type, index));
710  if (parent) {
711  m_Ref->m_Parent.Reset(parent->m_Ref);
712  }
713  }
714 
715  CParseNode& AddDescriptor(const CSeqdesc& seqdesc) {
716  CRef<CParseNode> new_node(new CParseNode(eSeqDesc, (unsigned)m_Descriptors.size(), this));
717  new_node->m_Obj = &seqdesc;
718  m_Descriptors.push_back(new_node);
719  m_DescriptorMap[&seqdesc] = new_node;
720  if (seqdesc.IsSource()) {
721  const CBioSource* biosrc = &seqdesc.GetSource();
722  m_Biosources.push_back(biosrc);
723  m_BiosourceMap[biosrc] = new_node;
724  }
725  if (seqdesc.IsPub()) {
726  const CPubdesc* pub = &seqdesc.GetPub();
727  m_Pubdescs.push_back(pub);
728  m_PubdescMap[pub] = new_node;
729  if (pub->IsSetPub()) {
730  for (auto& it : pub->GetPub().Get()) {
731  if (it->IsSetAuthors()) {
732  const CAuth_list* auth = &it->GetAuthors();
733  m_Authors.push_back(auth);
734  m_AuthorMap[auth] = new_node;
735  m_AuthorPubMap[auth] = &*it;
736  }
737  }
738  }
739  }
740  return *new_node;
741  }
742 
744  CRef<CParseNode> new_node(new CParseNode(eSeqFeat, (unsigned)m_Features.size(), this));
745  new_node->m_Obj = &feat;
746  m_Features.push_back(new_node);
747  m_FeatureMap[&feat] = new_node;
748  if (feat.IsSetData() && feat.GetData().IsBiosrc()) {
749  const CBioSource* biosrc = &feat.GetData().GetBiosrc();
750  m_Biosources.push_back(biosrc);
751  m_BiosourceMap[biosrc] = new_node;
752  }
753  if (feat.IsSetData() && feat.GetData().IsPub()) {
754  const CPubdesc* pub = &feat.GetData().GetPub();
755  m_Pubdescs.push_back(pub);
756  m_PubdescMap[pub] = new_node;
757  if (pub->IsSetPub()) {
758  for (auto& it : pub->GetPub().Get()) {
759  if (it->IsSetAuthors()) {
760  const CAuth_list* auth = &it->GetAuthors();
761  m_Authors.push_back(auth);
762  m_AuthorMap[auth] = new_node;
763  m_AuthorPubMap[auth] = &*it;
764  }
765  }
766  }
767  }
768  return *new_node;
769  }
770 
771  void SetType(EObjType type) { m_Type = type; m_Ref->m_Type = type; }
772 
773  CConstRef<CSeqdesc> GetTitle() const { return (m_Title || !m_Parent) ? m_Title : m_Parent->GetTitle(); }
774  CConstRef<CSeqdesc> GetMolinfo() const { return (m_Molinfo || !m_Parent) ? m_Molinfo : m_Parent->GetMolinfo(); }
775  CConstRef<CSeqdesc> GetBiosource() const { return (m_Biosource || !m_Parent) ? m_Biosource : m_Parent->GetBiosource(); }
776  bool InGenProdSet() const { return m_Type == eSeqSet_GenProd ? true : m_Parent ? m_Parent->InGenProdSet() : false; }
777 
779  size_t m_Index;
780  bool m_Repeat;
781  mutable unsigned char m_Info;
782  unsigned char m_Flags;
787  mutable const CParseNode* m_Gene;
788  mutable string m_Product;
789  vector<CRef<CParseNode>> m_Children;
790  vector<CRef<CParseNode>> m_Descriptors;
791  vector<CRef<CParseNode>> m_Features;
792  vector<const CBioSource*> m_Biosources;
793  vector<const CPubdesc*> m_Pubdescs;
794  vector<const CAuth_list*> m_Authors;
801  shared_ptr<CSeqSummary> m_BioseqSummary;
805  vector<CConstRef<CSeqdesc>> m_SetBiosources;
806 
807 string Path() { return m_Parent ? m_Parent->Path() + " => " + TypeName(m_Type) + ": " + to_string(m_Index) : TypeName(m_Type) + ": " + to_string(m_Index); }
808  };
809 
810  bool Skip();
811  void Extend(CParseNode& node, CObjectIStream& stream);
812  void ParseAll(CParseNode& node);
813  void Populate(CParseNode& node);
814  void PopulateBioseq(CParseNode& node);
815  void PopulateSeqSet(CParseNode& node);
816  void PopulateSubmit(CParseNode& node);
817  void RunTests();
818 
819  void PushNode(EObjType);
820  void PopNode() { m_CurrentNode.Reset(m_CurrentNode->m_Parent); }
821 
822  bool m_Skip;
825  bool IsPseudo(const CParseNode& node);
826  const CParseNode* GeneForFeature(const CParseNode& node);
827  string ProdForFeature(const CParseNode& node);
828  static bool CompareRefs(CRef<CReportObj> a, CRef<CReportObj> b);
829 
830 friend class CDiscrepancyObject;
831 };
832 
834 {
835 protected:
837  : m_Ref(ref), m_Fix(fix), m_More(more) {}
838 
839 public:
840  string GetBioseqLabel() const override { return m_Ref->GetBioseqLabel(); }
841 
842  /// @deprecated
843  /// use CDiscrepancyObject::GetBioseqLabel()
845  string GetShort() const override { return m_Ref->GetBioseqLabel(); }
846 
847  auto& RefNode() { return m_Ref; }
848  string GetText() const override { return m_Ref->GetText(); }
849  string GetPath() const override
850  {
851  for (auto ref = m_Ref; ref; ref = ref->m_Parent) {
852  if (ref->m_Type == CDiscrepancyContext::eFile) {
853  return ref->m_Text;
854  }
855  }
856  return kEmptyStr;
857  }
858  string GetFeatureType() const override;
859  string GetProductName() const override;
860  string GetLocation() const override;
861  string GetLocusTag() const override;
862 
863  void SetMoreInfo(CObject* data) override { m_More.Reset(data); }
864 
865  EType GetType() const override // Can we use the same enum?
866  {
867  //eType_feature,
868  //eType_descriptor,
869  //eType_sequence,
870  //eType_seq_set,
871  //eType_submit_block,
872  //eType_string
873 
874  switch (m_Ref->m_Type) {
875  case CDiscrepancyContext::eSeqSet: return eType_seq_set;
876  case CDiscrepancyContext::eBioseq: return eType_sequence;
877  case CDiscrepancyContext::eSeqFeat: return eType_feature;
878  case CDiscrepancyContext::eSeqDesc: return eType_descriptor;
879  case CDiscrepancyContext::eSubmitBlock: return eType_submit_block;
880  case CDiscrepancyContext::eString: return eType_string;
881  default: break;
882  }
883  return eType_string;
884  }
885 
886  bool CanAutofix() const override { return m_Fix && !m_Fixed; }
887  bool IsFixed() const override { return m_Fixed; }
888  void SetFixed() { m_Fixed = true; }
889 
890  CConstRef<CObject> GetMoreInfo() { return m_More; }
891  CReportObj* Clone(bool fix, CConstRef<CObject> data) const;
892 
893  static string GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope);
894  static string GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope, const string& product);
895  static string GetTextObjectDescription(const CSeqdesc& sd);
896  static string GetTextObjectDescription(const CBioseq& bs, CScope& scope);
897  static string GetTextObjectDescription(CBioseq_set_Handle bssh);
898  static void GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope, string &type, string &context, string &location, string &locus_tag);
899  static void GetTextObjectDescription(const CSeq_feat& seq_feat, CScope& scope, string &type, string &location, string &locus_tag);
900 
901  static CDiscrepancyObject* CreateInternal(CDiscrepancyContext::CRefNode* ref, CRef<CDiscrepancyCore> disc_core, bool autofix);
902 protected:
907  bool m_Fixed { false };
908 
909  friend class CDiscrepancyContext;
910  friend class CReportNode;
911  friend bool operator<(const CReportObjPtr& one, const CReportObjPtr& another) {
912  return ((const CDiscrepancyObject*)one.P)->m_Ref < ((const CDiscrepancyObject*)another.P)->m_Ref;
913  }
914 };
915 
917 {
918 public:
919  static CRef<CReportObj> Create(CRef<CDiscrepancyCore> disc_core, const CReportObj& obj, bool autofix);
920 };
921 
922 
923 inline const CObject* CDiscrepancyContext::GetMore(CReportObj& obj) { return static_cast<CDiscrepancyObject*>(&obj)->m_More; }
924 
925 // MACRO definitions
926 // Uses template specializations
927 
928 #define DISCREPANCY_CASE_FULL(name, sname, type, group, descr, aliases_ptr) \
929  static constexpr CDiscrepancyCaseProps s_testcase_props_##name = { \
930  CDiscrepancyVisitorImpl<eTestNames::name>::Create, \
931  eTestTypes::type, eTestNames::name, sname, descr, group, aliases_ptr}; \
932  template<> \
933  const CDiscrepancyCaseProps* \
934  CDiscrepancyCasePropsRef<eTestNames::name>::props = &s_testcase_props_##name; \
935  template<> void CDiscrepancyVisitorImpl<eTestNames::name>::Visit(NCBI_UNUSED CDiscrepancyContext& context)
936 
937 #define DISCREPANCY_CASE(name, type, group, descr) \
938  DISCREPANCY_CASE_FULL(name, #name, type, group, descr, nullptr)
939 
940 #define DISCREPANCY_CASE0(name, sname, type, group, descr) \
941  DISCREPANCY_CASE_FULL(name, sname, type, group, descr, nullptr)
942 
943 #define DISCREPANCY_CASE1(name, type, group, descr, ...) \
944  static constexpr std::initializer_list<const char*> g_aliases_ ##name = { __VA_ARGS__ }; \
945  DISCREPANCY_CASE_FULL(name, #name, type, group, descr, &g_aliases_ ##name)
946 
947 // non-default Summarize specialization
948 #define DISCREPANCY_SUMMARIZE(name) \
949  template<> void CDiscrepancyVisitorImpl<eTestNames::name>::Summarize()
950 
951 
952 #define DISCREPANCY_AUTOFIX(name) \
953  template<> \
954  CRef<CAutofixReport> \
955  CDiscrepancyVisitorImpl<eTestNames::name>::Autofix(CDiscrepancyObject* obj, CDiscrepancyContext& context) const
956 
957 // Unit test functions
959 
960 
963 
964 #endif // _MISC_DISCREPANCY_DISCREPANCY_CORE_H_
static CRef< CScope > m_Scope
User-defined methods of the data storage class.
User-defined methods of the data storage class.
@Auth_list.hpp User-defined methods of the data storage class.
Definition: Auth_list.hpp:57
CBioseq_EditHandle –.
CBioseq_Handle –.
CBioseq_set_Handle –.
static const CDiscrepancyCaseProps * props
virtual TReportObjectList GetObjects() const =0
const vector< const CPubdesc * > & GetPubdescs() const
CRef< CBioseq > m_AF_Bioseq
vector< CDiscrepancyObject * > * m_Fixes
CSeqdesc_run GetAllSeqdesc()
CConstRef< CSeqdesc > m_Current_Seqdesc
CRef< CSeq_descr > m_AF_Seq_descr
const vector< const CSeq_feat * > & FeatTRNAs()
vector< const CSeq_feat * > m_Feat_RNAs
const vector< const CSeq_feat * > & FeatExons()
unsigned char ReadFlags() const
CRef< objects::CScope > m_Scope
const string & CurrentText() const
ct::const_bitset< static_cast< size_t >eTestTypes::max_num_types), eTestTypes > m_Enabled
CDiscrepancyContext(objects::CScope &scope)
TDiscrepancyCoreMap m_Tests
CRef< CBioseq_set > m_AF_Bioseq_set
const vector< CConstRef< CSeqdesc > > & GetSetBiosources() const
CRef< CSimpleTypeObject< string > > m_Current_Submit_block_StringObj
CRef< CParseNode > m_RootNode
CRef< feature::CFeatTree > m_FeatTree
CConstRef< CPub > m_Current_Pub
const vector< const CSeq_feat * > & FeatGenes()
CRef< CParseNode > m_CurrentNode
vector< const CSeq_feat * > m_FeatAll
CConstRef< CSubmit_block > m_Current_Submit_block
vector< const CSeq_feat * > m_FeatRRNAs
CConstRef< CSeqdesc > GetTitle() const
objects::CScope & GetScope() const
CConstRef< CSeq_feat > m_Current_Seq_feat
const vector< const CBioSource * > & GetBiosources() const
vector< const CSeq_feat * > m_FeatCDS
const vector< const CSeq_feat * > & FeatMRNAs()
const CPub * AuthPub(const CAuth_list *a) const
CConstRef< CBioseq > m_Current_Bioseq
const CSeqSummary & GetSeqSummary()
CBioseq_Handle m_Current_Bioseq_Handle
static bool InGenProdSet(const CParseNode *node)
const vector< const CAuth_list * > & GetAuthors() const
const vector< const CSeq_feat * > & Feat_RNAs()
CSeq_feat_run GetAllFeat()
const vector< const CSeq_feat * > & FeatPseudo()
const CBioseq & CurrentBioseq() const
vector< const CSeq_feat * > m_FeatGenes
static string TypeName(EObjType n)
CSeq_feat_vec GetFeat()
CBioseq_set_Handle GetBioseq_setHandle(const CBioseq_set &bss)
CConstRef< CSeqdesc > GetBiosource() const
const vector< const CSeq_feat * > & FeatCDS()
vector< const CSeq_feat * > m_FeatMRNAs
map< const CRefNode *, CParseNode * > m_NodeMap
const vector< const CSeq_feat * > & FeatAll()
const vector< const CSeq_feat * > & FeatIntrons()
CRef< CSimpleTypeObject< string > > m_Current_Cit_sub_StringObj
CRef< CSeq_annot > m_AF_Seq_annot
static bool InNucProtSet(const CParseNode *node)
CConstRef< CSuspect_rule_set > m_OrganelleProductRules
CBioseq_EditHandle GetBioseqHandle(const CBioseq &bs)
vector< const CSeq_feat * > m_FeatTRNAs
const vector< const CSeq_feat * > & FeatRRNAs()
vector< const CSeq_feat * > m_FeatExons
CConstRef< CSeqdesc > GetMolinfo() const
CSeqdesc_vec GetSeqdesc()
const CBioseq_set & CurrentBioseq_set() const
const vector< const CSeq_feat * > & FeatMisc()
const CObject * GetMore(CReportObj &obj)
vector< CConstRef< CBioseq_set > > m_Bioseq_set_Stack
CRef< CSubmit_block > m_AF_Submit_block
CConstRef< CPub_equiv > m_Current_Pub_equiv
CConstRef< CSuspect_rule_set > m_ProductRules
void PropagateFlags(unsigned char f)
vector< const CSeq_feat * > m_FeatIntrons
vector< const CSeq_feat * > m_FeatPseudo
static bool IsSeqSet(EObjType n)
vector< const CSeq_feat * > m_FeatMisc
eTestTypes GetType() const override
virtual CRef< CAutofixReport > Autofix(CDiscrepancyObject *obj, CDiscrepancyContext &context) const =0
virtual void Visit(CDiscrepancyContext &context)=0
eTestNames GetName() const override
const CDiscrepancyCaseProps * m_props
CDiscrepancyCore(const CDiscrepancyCaseProps *props)
string_view GetSName() const override
TReportItemList m_ReportItems
virtual void Summarize()=0
string_view GetDescription() const override
const TReportItemList & GetReport() const override
CDiscrepancyItem(string_view title, const string &name, const string &msg, const string &xml, const string &unit, size_t count)
string_view GetTitle() const override
bool IsExtended() const override
size_t GetCount() const override
TReportObjectList m_Objs
TReportObjectList & SetDetails()
TReportObjectList GetDetails() const override
bool IsInfo() const override
bool IsReal() const override
void SetAutofix(bool value)
bool IsFatal() const override
string GetUnit() const override
TReportItemList m_Subs
TReportItemList GetSubitems() const override
CDiscrepancyItem(const string &msg)
string GetStr() const override
string GetXml() const override
string GetMsg() const override
bool CanAutofix() const override
ESeverity GetSeverity() const override
bool IsSummary() const override
friend bool operator<(const CReportObjPtr &one, const CReportObjPtr &another)
CRef< CDiscrepancyContext::CRefNode > m_Ref
string GetBioseqLabel() const override
string GetPath() const override
void SetMoreInfo(CObject *data) override
string GetShort() const override
bool IsFixed() const override
bool CanAutofix() const override
CConstRef< CObject > m_More
CConstRef< CObject > GetMoreInfo()
string GetText() const override
CRef< CDiscrepancyContext::CRefNode > m_Fix
CRef< CDiscrepancyCore > m_Case
EType GetType() const override
CDiscrepancyObject(CDiscrepancyContext::CRefNode *ref, CDiscrepancyContext::CRefNode *fix=nullptr, const CObject *more=nullptr)
TDiscrepancyCoreMap m_Tests
void Visit(CDiscrepancyContext &context) override
CRef< CAutofixReport > Autofix(CDiscrepancyObject *, CDiscrepancyContext &) const override
CDiscrepancyPrivateData< _Name > m_private
static CRef< CDiscrepancyCore > Create()
CObjectIStream –.
Definition: objistr.hpp:93
CObject –.
Definition: ncbiobj.hpp:180
Definition: Pub.hpp:56
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
CRef –.
Definition: ncbiobj.hpp:618
static void Add(TReportObjectList &list, TReportObjectSet &hash, CReportObj &obj, bool unique=true)
CReportNode(const string &name)
bool Exist(CReportObj &obj)
CReportNode & Merge(CReportNode &other)
CReportNode & Add(CReportObj &obj, bool unique=true)
TReportObjectSet m_Hash
CReportNode & NoRec(bool b=true)
map< string, CRef< CReportNode > > TNodeMap
CReportNode & Summ(bool b=true)
TReportObjectList & GetObjects()
CReportNode & Ext(bool b=true)
CReportNode & operator[](const string &name)
CReportNode & Fatal()
CReportNode & Severity(CReportItem::ESeverity s)
void SetCount(size_t n)
bool empty() const
CReportNode()=default
TReportObjectList m_Objs
TNodeMap & GetMap()
CRef< CReportItem > Export(CDiscrepancyCore &test, bool unique=true) const
CReportNode & Incr()
CReportItem::ESeverity m_Severity
static bool Exist(TReportObjectSet &hash, CReportObj &obj)
bool Exist(const string &name) const
CReportNode & Add(TReportObjectList &objs, bool unique=true)
size_t GetCount() const
void Copy(CRef< CReportNode > other)
CReportNode & Info()
static CRef< CReportObj > Create(CRef< CDiscrepancyCore > disc_core, const CReportObj &obj, bool autofix)
CScope –.
Definition: scope.hpp:92
Definition: Seq_entry.hpp:56
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Base class for all serializable objects.
Definition: serialbase.hpp:150
CSubmit_block –.
const_iterator end() const
Definition: map.hpp:152
bool empty() const
Definition: map.hpp:149
void clear()
Definition: map.hpp:169
const_iterator find(const key_type &key) const
Definition: map.hpp:153
Definition: map.hpp:338
void clear()
Definition: set.hpp:153
static uch flags
#define T(s)
Definition: common.h:230
vector< CRef< CReportItem > > TReportItemList
vector< CRef< CReportObj > > TReportObjectList
eTestTypes
Definition: discrepancy.hpp:57
CConstRef< objects::CSuspect_rule_set > GetProductRules(const string &name="")
unsigned short TGroup
CConstRef< objects::CSuspect_rule_set > GetOrganelleProductRules(const string &name="")
USING_SCOPE(objects)
void UnitTest_FLATFILE_FIND()
Checking that FLATFILE_FIND.inc is in sync with kSpellFixes If the array is changed,...
map< eTestNames, CRef< CDiscrepancyCore > > TDiscrepancyCoreMap
list< pair< CRef< CDiscrepancyObject >, string > > TGenesList
CDiscrepancyContext - manage and run the list of tests.
set< CReportObjPtr > TReportObjectSet
map< string, TGenesList > TGeneLocusMap
#define ADD_DISCREPANCY_TYPE(type)
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
#define test(a, b, c, d, e)
Definition: numeric.c:170
#define true
Definition: bool.h:35
#define false
Definition: bool.h:36
static int type
Definition: getdata.c:31
static int RunTests(void)
Code to iterate through all tests to run.
Definition: testodbc.c:397
static const char location[]
Definition: config.c:97
char data[12]
Definition: iconv.c:80
#define NCBI_DEPRECATED_CTOR(decl)
Macro used to mark a constructor as deprecated.
Definition: ncbimisc.hpp:1209
sequence::ECompare Compare(const CSeq_loc &loc1, const CSeq_loc &loc2, CScope *scope)
Returns the sequence::ECompare containment relationship between CSeq_locs.
ECompare
bool IsPseudo(const CSeq_feat &feat, CScope &scope)
Determines whether given feature is pseudo, using gene associated with feature if necessary Checks to...
Definition: sequence.cpp:1428
CConstRef< CSeq_feat > GetGeneForFeature(const CSeq_feat &feat, CScope &scope)
Finds gene for feature, but obeys SeqFeatXref directives.
Definition: sequence.cpp:1529
CBioseq_set_Handle GetBioseq_setHandle(const CBioseq_set &seqset, EMissing action=eMissing_Default)
Definition: scope.cpp:176
CBioseq_EditHandle GetBioseqEditHandle(const CBioseq &bioseq)
Get edit handle for the specified object Throw an exception if object is not found,...
Definition: scope.cpp:229
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
Definition: ncbiobj.hpp:2015
#define NCBI_DEPRECATED
#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
IO_PREFIX::streampos CNcbiStreampos
Portable alias for streampos.
Definition: ncbistre.hpp:134
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_DISCREPANCY_EXPORT
Definition: ncbi_export.h:945
const Tdata & Get(void) const
Get the member data.
Definition: Pub_equiv_.hpp:165
const TPub & GetPub(void) const
Get the variant data.
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:913
const TData & GetData(void) const
Get the Data member data.
Definition: Seq_feat_.hpp:925
bool IsPub(void) const
Check if variant Pub is selected.
const TBiosrc & GetBiosrc(void) const
Get the variant data.
bool IsBiosrc(void) const
Check if variant Biosrc is selected.
const TTitle & GetTitle(void) const
Get the variant data.
Definition: Seqdesc_.hpp:1032
const TSource & GetSource(void) const
Get the variant data.
Definition: Seqdesc_.cpp:566
const TPub & GetPub(void) const
Get the variant data.
Definition: Seqdesc_.cpp:356
bool IsSource(void) const
Check if variant Source is selected.
Definition: Seqdesc_.hpp:1190
bool IsPub(void) const
Check if variant Pub is selected.
Definition: Seqdesc_.hpp:1096
bool IsSetPub(void) const
the citation(s) Check if a value has been assigned to Pub data member.
Definition: Pubdesc_.hpp:593
const TPub & GetPub(void) const
Get the Pub member data.
Definition: Pubdesc_.hpp:605
const TMolinfo & GetMolinfo(void) const
Get the variant data.
Definition: Seqdesc_.cpp:588
yy_size_t n
static string GetProductName(const CProt_ref &prot)
Definition: utils.cpp:62
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
XML library namespace.
Definition: attributes.hpp:57
unsigned int a
Definition: ncbi_localip.c:102
EIPRangeType t
Definition: ncbi_localip.c:101
#define nullptr
Definition: ncbimisc.hpp:45
double f(double x_, const double &y_)
Definition: njn_root.hpp:188
bool IsOrganelle(int genome)
Definition: utilities.cpp:2831
string GetLocusTag(const CSeq_feat &f, const LocMap &loc_map)
string GetProduct(const CProt_ref &prot_ref)
const std::initializer_list< const char * > * Aliases
CParseNode & AddDescriptor(const CSeqdesc &seqdesc)
vector< CRef< CParseNode > > m_Children
CParseNode(EObjType type, unsigned index, CParseNode *parent=nullptr)
map< const CBioSource *, CParseNode * > m_BiosourceMap
vector< const CBioSource * > m_Biosources
vector< CRef< CParseNode > > m_Features
vector< const CPubdesc * > m_Pubdescs
vector< CRef< CParseNode > > m_Descriptors
CConstRef< CSerialObject > m_Obj
CParseNode & AddFeature(const CSeq_feat &feat)
vector< CConstRef< CSeqdesc > > m_SetBiosources
map< const CSeq_feat *, CParseNode * > m_FeatureMap
map< const CSeqdesc *, CParseNode * > m_DescriptorMap
map< const CAuth_list *, CParseNode * > m_AuthorMap
shared_ptr< CSeqSummary > m_BioseqSummary
map< const CPubdesc *, CParseNode * > m_PubdescMap
CConstRef< CSeqdesc > GetBiosource() const
CConstRef< CSeqdesc > GetMolinfo() const
CConstRef< CSeqdesc > GetTitle() const
vector< const CAuth_list * > m_Authors
map< const CAuth_list *, const CPub * > m_AuthorPubMap
CRefNode(EObjType type, unsigned index)
vector< CRef< CParseNode > >::iterator it
vector< CRef< CParseNode > >::iterator it
iterator(vector< CRef< CParseNode >>::iterator x)
vector< CRef< CParseNode > >::iterator it
iterator(vector< CRef< CParseNode >>::iterator x)
vector< CRef< CParseNode > >::iterator it
const CReportObj * P
friend bool operator<(const CReportObjPtr &one, const CReportObjPtr &another)
CReportObjPtr(const CReportObj *p)
vector< pair< size_t, size_t > > NRuns
string GetStats() const
size_t _CBposition[WINDOW_SIZE]
static const size_t WINDOW_SIZE
size_t _CBscore[WINDOW_SIZE]
CSimpleTypeObject(const T &v)
Definition: _hash_fun.h:40
Definition: type.c:6
string GetTextObjectDescription(const CSeq_feat &sf, CScope &scope)
static CS_CONTEXT * context
Definition: will_convert.c:21
void Merge(wxMenu &menu_1, const wxMenu &menu_2)
merges all items form menu_2 into menu_1, preserving the structure if possible
Definition: wx_utils.cpp:579
#define const
Definition: zconf.h:232
Modified on Tue May 21 10:58:56 2024 by modify_doxy.py rev. 669887