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 101164 2023-11-09 15:04:45Z 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  */
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 );
201  if( arg0.IsSetData() ) {
203  }
204  if( arg0.IsSetExcept_text() ) {
206  }
207  if( arg0.IsSetTitle() ) {
209  }
210  if( arg0.IsSetXref() ) {
211  for (auto pXref : arg0.SetXref()) {
213  }
214  }
215 
217 
218  if( efh ) {
219  efh.Replace(arg0);
220  arg0_raw.Assign( arg0 );
221  }
222 
223 } // end of ExtendedCleanupSeqFeat
224 
225 
227 { // type Reference
228  if( arg0.IsSet() ) {
229  for (auto pAnnotDesc : arg0.Set()) {
230  if (pAnnotDesc->IsPub()) {
231  x_ExtendedCleanupPubDesc(pAnnotDesc->SetPub());
232  }
233  }
234  }
235 } // end of ExtendedCleanupSeqAnnot_E_desc_ETC
236 
238 { // type Sequence
240  if( arg0.IsFtable() ) {
241  for (auto pFeat : arg0.SetData().SetFtable()) {
242  ExtendedCleanupSeqFeat(*pFeat);
243  }
244  }
245  if( arg0.IsSetDesc() ) {
247  }
248 } // end of ExtendedCleanupSeqAnnot
249 
250 
252 { // type Sequence
253  if( arg0.IsSetOrigin() ) {
255  }
256 }
257 
259 { // type Choice
261  switch( arg0.Which() ) {
262  case CSeqdesc::e_Genbank:
264  break;
265  case CSeqdesc::e_Org:
267  break;
268  case CSeqdesc::e_Pub:
270  break;
271  case CSeqdesc::e_Source:
273  break;
274  default:
275  break;
276  }
277 } // end of x_ExtendedCleanupBioseqSet_seq_set_E_E_seq_seq_descr_descr_E_E_ETC
278 
279 
281 { // type Reference
290  if( arg0.IsSet() ) {
291  for (auto pDesc : arg0.Set()) {
292  x_ExtendedCleanupSeqdesc(*pDesc);
293  }
294  }
295 } // end of x_ExtendedCleanupSeqdescr
296 
297 
299 { // type Reference
300  if (seq_inst.IsSetExt() &&
301  seq_inst.GetExt().IsMap()) {
302  auto& map_ext = seq_inst.SetExt().SetMap();
303  if (map_ext.IsSet()) {
304  for (auto pFeat : map_ext.Set()) {
305  ExtendedCleanupSeqFeat(*pFeat);
306  }
307  }
308  }
309 } // end of x_ExtendedCleanupBioseq_inst
310 
312 { // type Sequence
313  m_NewCleanup.x_ExtendProteinFeatureOnProteinSeq( arg0 ); // I think that protein features are not annotated on the bioseq, but I need to check.
319  if( arg0.IsSetAnnot() ) {
322  }
323  if( arg0.IsSetDescr() ) {
329  }
330  if( arg0.IsSetInst() ) {
332  }
336 } // end of ExtendedCleanupBioseq
337 
338 
340 { // type Sequence
341  m_NewCleanup.x_BioseqSetEC( arg0 );
345  if( arg0.IsSetAnnot() ) {
348  }
349  if( arg0.IsSetDescr() ) {
350  m_NewCleanup.x_RemoveDupBioSource( arg0 ); // Only applies to nuc-prot sets
353  }
354  if( arg0.IsSetSeq_set() ) {
355  for (auto pEntry : arg0.SetSeq_set()) {
356  ExtendedCleanupSeqEntry(*pEntry);
357  }
358  }
361 } // end of x_ExtendedCleanupSeqEntry_set_set_ETC
362 
363 
365 { // type Choice
366  switch( arg0.Which() ) {
367  case CSeq_entry::e_Seq:
369  break;
370  case CSeq_entry::e_Set:
371  if (!arg0.GetSet().GetParentEntry()) {
372  arg0.ParentizeOneLevel();
373  }
375  break;
376  default:
377  break;
378  }
380 } // end of ExtendedCleanupSeqEntry
381 
382 template<typename TSeqAnnotContainer>
384 {
385  for (auto pAnnot : annots) {
386  ExtendedCleanupSeqAnnot(*pAnnot);
387  }
388 }
389 
391 { // type Sequence
392  if(!arg0.IsSetData() ) {
393  return;
394  }
395  auto& data = arg0.SetData();
396  if (data.IsEntrys()) {
397  for (auto pEntry : data.SetEntrys()) {
398  ExtendedCleanupSeqEntry(*pEntry);
399  }
400  }
401  else if (data.IsAnnots()) {
402  for (auto pAnnot : data.SetAnnots()) {
403  ExtendedCleanupSeqAnnot(*pAnnot);
404  }
405  }
406 } // end of ExtendedCleanupSeqSubmit
407 
408 //LCOV_EXCL_STOP
409 
410 
413 
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 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
char data[12]
Definition: iconv.c:80
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 Wed Apr 17 13:10:34 2024 by modify_doxy.py rev. 669887