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

Go to the SVN repository for this file.

1 /* $Id: autogenerated_extended_cleanup.cpp 100060 2023-06-09 19:54:12Z 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  */
27 /// This file was generated by application DATATOOL
28 ///
29 /// ATTENTION:
30 /// Don't edit or commit this file into SVN as this file will
31 /// be overridden (by DATATOOL) without warning!
32 
33 #include <ncbi_pch.hpp>
35 #include "cleanup_utils.hpp"
38 
41 
42 //LCOV_EXCL_START
43 
44 void CAutogeneratedExtendedCleanup::x_ExtendedCleanupOrgName( COrgName & arg0 )
45 { // type Sequence
46  if( arg0.IsSetAttrib() ) {
47  m_NewCleanup.x_TrimInternalSemicolonsMarkChanged( arg0.SetAttrib() );
48  }
49  if( arg0.IsSetLineage() ) {
50  m_NewCleanup.x_TrimInternalSemicolonsMarkChanged( arg0.SetLineage() );
51  }
52  if( arg0.IsSetName() ) {
53  auto& name = arg0.SetName();
54  if (name.IsHybrid() && name.GetHybrid().IsSet()) {
55  for (auto pOrgName : name.SetHybrid().Set()) {
56  x_ExtendedCleanupOrgName(*pOrgName);
57  }
58  }
59  }
60 } // end of x_ExtendedCleanupOrgName
61 
62 
64 { // type Sequence
65  if( arg0.IsSetOrgname() ) {
67  }
68 } // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_biosrc_org_org_ETC
69 
70 
72 { // type Sequence
73  m_NewCleanup.BioSourceEC( arg0 );
74  if( arg0.IsSetOrg() ) {
76  }
77 } // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_biosrc_biosrc_ETC
78 
79 
81 { // type Sequence
83  if( arg0.IsSetLocus_tag() ) {
85  }
86  if( arg0.IsSetMaploc() ) {
88  }
89 } // end of x_ExtendedCleanupGeneRef
90 
91 
93 { // type Sequence
94  if( arg0.IsSetKey() ) {
96  }
97  if( arg0.IsSetLoc() ) {
99  }
100 } // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_imp_imp_ETC
101 
102 
104 { // type Reference
106  m_NewCleanup.ProtRefEC( arg0 );
107 } // end of x_ExtendedCleanupProtRef
108 
110 { // type Sequence
111  if( arg0.IsSetComment() ) {
113  }
114 } // end of x_ExtendedCleanupSeqFeat_xref_E_E_data_data_pub_pub_ETC
115 
116 
118 { // type Sequence
119  if( arg0.IsSetGene() ) {
120  for (auto pGeneRef : arg0.SetGene()) {
121  x_ExtendedCleanupGeneRef(*pGeneRef);
122  }
123  }
124  if( arg0.IsSetProtein() ) {
125  for (auto pProtRef : arg0.SetProtein()) {
126  x_ExtendedCleanupProtRef(*pProtRef);
127  }
128  }
129  if( arg0.IsSetTxorg() ) {
131  }
132 }
133 
134 
136 { // type Choice
137  switch( arg0.Which() ) {
140  break;
143  break;
144  case CSeqFeatData::e_Imp:
146  break;
147  case CSeqFeatData::e_Org:
149  break;
152  break;
153  case CSeqFeatData::e_Pub:
155  break;
158  break;
159  default:
160  break;
161  }
162 } // end of x_ExtendedCleanupSeqFeatData_data
163 
164 
165 
167 { // type Sequence
168  if( arg0.IsSetData() ) {
170  }
171 } // end of x_ExtendedCleanupSeqFeat_xref_E_E_ETC
172 
173 
175 { // type Sequence
176  CRef<CSeq_feat> raw_ref( &arg0_raw );
178 
179  CRef<CSeq_feat> new_feat;
180 
181  try {
182  // Try to use an edit handle so we can update the object manager
183  efh = CSeq_feat_EditHandle( m_Scope.GetSeq_featHandle( arg0_raw ) );
184  new_feat.Reset( new CSeq_feat );
185  new_feat->Assign( arg0_raw );
186  } catch(...) {
187  new_feat.Reset( &arg0_raw );
188  }
189 
190  CSeq_feat &arg0 = *new_feat;
191 
193 
194  m_NewCleanup.x_BondEC( arg0 );
195  m_NewCleanup.x_tRNAEC( arg0 );
196  m_NewCleanup.CdRegionEC( arg0 );
197  m_NewCleanup.MoveDbxrefs( arg0 );
202  if( arg0.IsSetData() ) {
204  }
205  if( arg0.IsSetExcept_text() ) {
207  }
208  if( arg0.IsSetTitle() ) {
210  }
211  if( arg0.IsSetXref() ) {
212  for (auto pXref : arg0.SetXref()) {
214  }
215  }
216 
218 
219  if( efh ) {
220  efh.Replace(arg0);
221  arg0_raw.Assign( arg0 );
222  }
223 
224 } // end of ExtendedCleanupSeqFeat
225 
226 
228 { // type Reference
229  if( arg0.IsSet() ) {
230  for (auto pAnnotDesc : arg0.Set()) {
231  if (pAnnotDesc->IsPub()) {
232  x_ExtendedCleanupPubDesc(pAnnotDesc->SetPub());
233  }
234  }
235  }
236 } // end of ExtendedCleanupSeqAnnot_E_desc_ETC
237 
239 { // type Sequence
241  if( arg0.IsFtable() ) {
242  for (auto pFeat : arg0.SetData().SetFtable()) {
243  ExtendedCleanupSeqFeat(*pFeat);
244  }
245  }
246  if( arg0.IsSetDesc() ) {
248  }
249 } // end of ExtendedCleanupSeqAnnot
250 
251 
253 { // type Sequence
254  if( arg0.IsSetOrigin() ) {
256  }
257 }
258 
260 { // type Choice
262  switch( arg0.Which() ) {
263  case CSeqdesc::e_Genbank:
265  break;
266  case CSeqdesc::e_Org:
268  break;
269  case CSeqdesc::e_Pub:
271  break;
272  case CSeqdesc::e_Source:
274  break;
275  default:
276  break;
277  }
278 } // end of x_ExtendedCleanupBioseqSet_seq_set_E_E_seq_seq_descr_descr_E_E_ETC
279 
280 
282 { // type Reference
291  if( arg0.IsSet() ) {
292  for (auto pDesc : arg0.Set()) {
293  x_ExtendedCleanupSeqdesc(*pDesc);
294  }
295  }
296 } // end of x_ExtendedCleanupSeqdescr
297 
298 
300 { // type Reference
301  if (seq_inst.IsSetExt() &&
302  seq_inst.GetExt().IsMap()) {
303  auto& map_ext = seq_inst.SetExt().SetMap();
304  if (map_ext.IsSet()) {
305  for (auto pFeat : map_ext.Set()) {
306  ExtendedCleanupSeqFeat(*pFeat);
307  }
308  }
309  }
310 } // end of x_ExtendedCleanupBioseq_inst
311 
313 { // type Sequence
314  m_NewCleanup.x_ExtendProteinFeatureOnProteinSeq( arg0 ); // I think that protein features are not annotated on the bioseq, but I need to check.
320  if( arg0.IsSetAnnot() ) {
323  }
324  if( arg0.IsSetDescr() ) {
330  }
331  if( arg0.IsSetInst() ) {
333  }
337 } // end of ExtendedCleanupBioseq
338 
339 
341 { // type Sequence
342  m_NewCleanup.x_BioseqSetEC( arg0 );
346  if( arg0.IsSetAnnot() ) {
349  }
350  if( arg0.IsSetDescr() ) {
351  m_NewCleanup.x_RemoveDupBioSource( arg0 ); // Only applies to nuc-prot sets
354  }
355  if( arg0.IsSetSeq_set() ) {
356  for (auto pEntry : arg0.SetSeq_set()) {
357  ExtendedCleanupSeqEntry(*pEntry);
358  }
359  }
362 } // end of x_ExtendedCleanupSeqEntry_set_set_ETC
363 
364 
366 { // type Choice
367  switch( arg0.Which() ) {
368  case CSeq_entry::e_Seq:
370  break;
371  case CSeq_entry::e_Set:
372  if (!arg0.GetSet().GetParentEntry()) {
373  arg0.ParentizeOneLevel();
374  }
376  break;
377  default:
378  break;
379  }
381 } // end of ExtendedCleanupSeqEntry
382 
383 template<typename TSeqAnnotContainer>
385 {
386  for (auto pAnnot : annots) {
387  ExtendedCleanupSeqAnnot(*pAnnot);
388  }
389 }
390 
392 { // type Sequence
393  if(!arg0.IsSetData() ) {
394  return;
395  }
396  auto& data = arg0.SetData();
397  if (data.IsEntrys()) {
398  for (auto pEntry : data.SetEntrys()) {
399  ExtendedCleanupSeqEntry(*pEntry);
400  }
401  }
402  else if (data.IsAnnots()) {
403  for (auto pAnnot : data.SetAnnots()) {
404  ExtendedCleanupSeqAnnot(*pAnnot);
405  }
406  }
407 } // end of ExtendedCleanupSeqSubmit
408 
409 //LCOV_EXCL_STOP
410 
411 
414 
CAnnot_descr –.
Definition: Annot_descr.hpp:66
This file was generated by application DATATOOL.
void x_ExtendedCleanupOrgName(COrgName &arg0)
This file was generated by application DATATOOL.
void x_ExtendedCleanupSeqFeatXref(CSeqFeatXref &arg0)
void x_ExtendedCleanupSeqAnnots(TSeqAnnotContainer &annots)
void ExtendedCleanupSeqAnnotDescr(CAnnot_descr &arg0)
void x_ExtendedCleanupSeqFeatData(CSeqFeatData &arg0)
CSeq_entry * GetParentEntry(void) const
Definition: Bioseq_set.hpp:122
@Imp_feat.hpp User-defined methods of the data storage class.
Definition: Imp_feat.hpp:54
void MoveDbxrefs(CSeq_feat &sf)
void x_RemoveOldDescriptors(CSeq_descr &seq_descr)
void ResynchProteinPartials(CSeq_feat &feat)
void ProtRefEC(CProt_ref &pr)
void x_RemoveOldFeatures(CBioseq &bioseq)
void x_BondEC(CSeq_feat &feat)
void BioSourceEC(CBioSource &biosrc)
void x_ExtendProteinFeatureOnProteinSeq(CBioseq &seq)
void CreateMissingMolInfo(CBioseq &seq)
void x_RemoveDupBioSource(CBioseq_set &bioseq_set)
void x_ClearEmptyDescr(CBioseq_set &bioseq_set)
void AddProteinTitles(CBioseq &seq)
void MoveCitationQuals(CBioseq &seq)
void x_CleanupGenbankBlock(CBioseq &seq)
void x_ExceptTextEC(string &except_text)
void x_ExtendSingleGeneOnMrna(CBioseq &seq)
void x_FixStructuredCommentKeywords(CSeq_descr &descr)
void x_BioseqSetEC(CBioseq_set &bioseq_set)
void x_RemoveEmptyFeatureTables(CBioseq &bioseq)
void x_MoveCDSFromNucAnnotToSetAnnot(CBioseq_set &set)
void x_MergeDupBioSources(CSeq_descr &seq_descr)
void CreatePubFromFeat(CSeq_feat &sf)
void x_RemoveDupPubs(CSeq_descr &descr)
void x_RemoveUnseenTitles(CSeq_descr &seq_descr)
void x_RemoveEmptyFeatures(CSeq_annot &seq_annot)
void MoveStandardName(CSeq_feat &sf)
void CdRegionEC(CSeq_feat &sf)
void x_RemoveEmptyUserObject(CSeq_descr &seq_descr)
void ResynchPeptidePartials(CBioseq &seq)
void x_RemoveProtDescThatDupsProtName(CProt_ref &prot)
void x_MovePopPhyMutPub(CBioseq_set &bioseq_set)
void x_SortSeqDescs(CSeq_entry &seq_entry)
void x_RemoveEmptyDescriptors(CSeq_descr &seq_descr)
void KeepLatestDateDesc(CSeq_descr &seq_descr)
void x_RemoveRedundantComment(CGene_ref &gene, CSeq_feat &seq_feat)
void x_tRNAEC(CSeq_feat &seq_feat)
void x_MoveSeqfeatOrgToSourceOrg(CSeq_feat &seqfeat)
void x_MergeAdjacentFeatureTables(CBioseq &bioseq)
void x_RescueMolInfo(CBioseq &seq)
void x_TrimInternalSemicolonsMarkChanged(std::string &str)
void x_SingleSeqSetToSeq(CBioseq_set &set)
void RemoveBadProteinTitle(CBioseq &seq)
void x_MoveSeqdescOrgToSourceOrg(CSeqdesc &seqdesc)
@Pubdesc.hpp User-defined methods of the data storage class.
Definition: Pubdesc.hpp:54
void SetProt(TProt &v)
void SetBiosrc(TBiosrc &v)
void SetPub(TPub &v)
void SetOrg(TOrg &v)
void SetImp(TImp &v)
void SetTxinit(TTxinit &v)
void SetGene(TGene &v)
CSeqFeatXref –.
Definition: SeqFeatXref.hpp:66
bool IsFtable(void) const
Definition: Seq_annot.cpp:177
@Seq_descr.hpp User-defined methods of the data storage class.
Definition: Seq_descr.hpp:55
Definition: Seq_entry.hpp:56
void ParentizeOneLevel(void)
Definition: Seq_entry.cpp:89
CSeq_feat_EditHandle –.
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
CTxinit –.
Definition: Txinit.hpp:66
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
CSeq_feat_Handle GetSeq_featHandle(const CSeq_feat &feat, EMissing action=eMissing_Default)
Definition: scope.cpp:200
void Replace(const CSeq_feat &new_feat) const
Replace the feature with new Seq-feat object.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
bool IsSetOrigin(void) const
Check if a value has been assigned to Origin data member.
Definition: GB_block_.hpp:539
void SetOrigin(const TOrigin &value)
Assign a value to Origin data member.
Definition: GB_block_.hpp:560
bool IsSetOrg(void) const
Check if a value has been assigned to Org data member.
Definition: BioSource_.hpp:497
void SetOrg(TOrg &value)
Assign a value to Org data member.
Definition: BioSource_.cpp:108
bool IsSetLocus_tag(void) const
systematic gene name (e.g., MI0001, ORF0069) Check if a value has been assigned to Locus_tag data mem...
Definition: Gene_ref_.hpp:781
bool IsSetMaploc(void) const
descriptive map location Check if a value has been assigned to Maploc data member.
Definition: Gene_ref_.hpp:634
void SetLocus_tag(const TLocus_tag &value)
Assign a value to Locus_tag data member.
Definition: Gene_ref_.hpp:802
void SetMaploc(const TMaploc &value)
Assign a value to Maploc data member.
Definition: Gene_ref_.hpp:655
bool IsSetOrgname(void) const
Check if a value has been assigned to Orgname data member.
Definition: Org_ref_.hpp:529
void SetOrgname(TOrgname &value)
Assign a value to Orgname data member.
Definition: Org_ref_.cpp:87
bool IsSetTitle(void) const
for user defined label Check if a value has been assigned to Title data member.
Definition: Seq_feat_.hpp:1160
TXref & SetXref(void)
Assign a value to Xref data member.
Definition: Seq_feat_.hpp:1314
bool IsSetLoc(void) const
original location string Check if a value has been assigned to Loc data member.
Definition: Imp_feat_.hpp:294
void SetData(TData &value)
Assign a value to Data data member.
void SetLoc(const TLoc &value)
Assign a value to Loc data member.
Definition: Imp_feat_.hpp:315
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
Definition: Seq_feat_.hpp:913
E_Choice Which(void) const
Which variant is currently selected.
bool IsSetKey(void) const
Check if a value has been assigned to Key data member.
Definition: Imp_feat_.hpp:247
bool IsSetXref(void) const
cite other relevant features Check if a value has been assigned to Xref data member.
Definition: Seq_feat_.hpp:1296
void SetTitle(const TTitle &value)
Assign a value to Title data member.
Definition: Seq_feat_.hpp:1181
bool IsSetData(void) const
the specific data Check if a value has been assigned to Data data member.
bool IsSetExcept_text(void) const
explain if except=TRUE Check if a value has been assigned to Except_text data member.
Definition: Seq_feat_.hpp:1393
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_feat_.cpp:94
void SetExcept_text(const TExcept_text &value)
Assign a value to Except_text data member.
Definition: Seq_feat_.hpp:1414
void SetKey(const TKey &value)
Assign a value to Key data member.
Definition: Imp_feat_.hpp:268
@ e_Txinit
transcription initiation
@ e_Pub
publication applies to this seq
TSet & SetSet(void)
Select the variant.
Definition: Seq_entry_.cpp:130
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
const TSet & GetSet(void) const
Get the variant data.
Definition: Seq_entry_.cpp:124
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
bool IsSetSeq_set(void) const
Check if a value has been assigned to Seq_set data member.
bool IsSetDescr(void) const
Check if a value has been assigned to Descr data member.
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.
TSeq & SetSeq(void)
Select the variant.
Definition: Seq_entry_.cpp:108
TSeq_set & SetSeq_set(void)
Assign a value to Seq_set data member.
bool IsSetComment(void) const
any comment on this pub in context Check if a value has been assigned to Comment data member.
Definition: Pubdesc_.hpp:973
bool IsMap(void) const
Check if variant Map is selected.
Definition: Seq_ext_.hpp:330
Tdata & Set(void)
Assign a value to data member.
void SetData(TData &value)
Assign a value to Data data member.
Definition: Seq_annot_.cpp:244
TPub & SetPub(void)
Select the variant.
Definition: Seqdesc_.cpp:362
TOrg & SetOrg(void)
Select the variant.
Definition: Seqdesc_.cpp:246
void SetDesc(TDesc &value)
Assign a value to Desc data member.
Definition: Seq_annot_.cpp:223
void SetExt(TExt &value)
Assign a value to Ext data member.
Definition: Seq_inst_.cpp:147
bool IsSetAnnot(void) const
Check if a value has been assigned to Annot data member.
Definition: Bioseq_.hpp:354
TGenbank & SetGenbank(void)
Select the variant.
Definition: Seqdesc_.cpp:340
TAnnot & SetAnnot(void)
Assign a value to Annot data member.
Definition: Bioseq_.hpp:372
bool IsSetExt(void) const
extensions for special types Check if a value has been assigned to Ext data member.
Definition: Seq_inst_.hpp:826
bool IsSetInst(void) const
the sequence data Check if a value has been assigned to Inst data member.
Definition: Bioseq_.hpp:324
bool IsSetDesc(void) const
used only for stand alone Seq-annots Check if a value has been assigned to Desc data member.
Definition: Seq_annot_.hpp:840
void SetInst(TInst &value)
Assign a value to Inst data member.
Definition: Bioseq_.cpp:86
bool IsSet(void) const
Check if a value has been assigned to data member.
TSource & SetSource(void)
Select the variant.
Definition: Seqdesc_.cpp:572
const TExt & GetExt(void) const
Get the Ext member data.
Definition: Seq_inst_.hpp:838
bool IsSetDescr(void) const
descriptors Check if a value has been assigned to Descr data member.
Definition: Bioseq_.hpp:303
bool IsSet(void) const
Check if a value has been assigned to data member.
Definition: Seq_descr_.hpp:154
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
void SetComment(const TComment &value)
Assign a value to Comment data member.
Definition: Pubdesc_.hpp:994
Tdata & Set(void)
Assign a value to data member.
Definition: Seq_descr_.hpp:172
@ e_Org
if all from one organism
Definition: Seqdesc_.hpp:116
@ e_Pub
a reference to the publication
Definition: Seqdesc_.hpp:122
@ e_Genbank
GenBank specific info.
Definition: Seqdesc_.hpp:121
@ e_Source
source of materials, includes Org-ref
Definition: Seqdesc_.hpp:133
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
void SetData(TData &value)
Assign a value to Data data member.
bool IsSetGene(void) const
gene(s) transcribed Check if a value has been assigned to Gene data member.
Definition: Txinit_.hpp:733
TProtein & SetProtein(void)
Assign a value to Protein data member.
Definition: Txinit_.hpp:776
bool IsSetProtein(void) const
protein(s) produced Check if a value has been assigned to Protein data member.
Definition: Txinit_.hpp:758
TGene & SetGene(void)
Assign a value to Gene data member.
Definition: Txinit_.hpp:751
void SetTxorg(TTxorg &value)
Assign a value to Txorg data member.
Definition: Txinit_.cpp:128
bool IsSetTxorg(void) const
organism supplying transcription apparatus Check if a value has been assigned to Txorg data member.
Definition: Txinit_.hpp:949
Magic spell ;-) needed for some weird compilers... very empiric.
Modified on Sat Sep 30 23:18:05 2023 by modify_doxy.py rev. 669887