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

Go to the SVN repository for this file.

1 #ifndef GUI_OBJUTILS___MACRO_FN_DO__HPP
2 #define GUI_OBJUTILS___MACRO_FN_DO__HPP
3 /* $Id: macro_fn_do.hpp 46453 2021-05-20 21:11:55Z asztalos $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Anatoly Osipov, Andrea Asztalos
29  *
30  * File Description:
31  * Macro editing functions used in the DO - DONE section
32  *
33  */
34 
35 /// @file macro_fn_do.hpp
36 #include <corelib/ncbistd.hpp>
38 
39 /** @addtogroup GUI_MACRO_SCRIPTS_UTIL
40  *
41  * @{
42  */
43 
45 
47  class CBioseq;
48  class CAuthor;
49  class CAffil;
50  class CName_std;
51  class CSeq_entry_Handle;
53 BEGIN_SCOPE(macro)
54 
55 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_Resolve)
56 
57 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_ResolveBioSourceQuals)
58 
59 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_ResolveNASeq)
60 
61 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_RemoveLineageSourceNotes)
62 
63 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_FixUSAandStatesAbbrev)
64 
65 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_FixSourceQualCaps)
66 
67 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_FixMouseStrain)
68 
69 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_FixAuthorCaps)
70 
71 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_RemoveDescriptor)
72 
73 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_RemoveSequence)
74 
75 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_RemoveAlignment)
76 
77 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_ReorderStructComment)
78 
79 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_ChangeSeqInst)
80 
81 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_AddProteinTitles)
82 
83 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_CorrectGeneticCodes)
84 
85 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_RmvDuplStructComments)
86 
87 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_TrimStringQual)
88 
89 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_PrintCSV)
90 
91 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_PrintVerbatim)
92 
93 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_PrintTSV)
94 
95 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_PrintBankit)
96 
97 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_PrintLiteral)
98 
99 DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_ToUnknownLengthGap)
100 
101 
103 {
104 public:
105  enum EModifyType {
107  eFixI
108  };
109 
111 
112  virtual void TheFunction();
113 protected:
115  : IEditMacroFunction(func_scope), m_Type(type) {}
116 
117  virtual bool x_ValidArguments() const;
119 };
120 
122 {
123 public:
128 };
129 
131 {
132 public:
137 };
138 
139 
141 {
142 public:
144  : IEditMacroFunction(func_scope) {}
145 
147  virtual void TheFunction();
149 
150  // if unable to correct lat-lon, it returns an empty string
151  static string s_FixLatLonFormat(objects::CBioSource& bsrc, const string& value);
152  static bool s_AddAltitudeToSubSourceNote(objects::CBioSource& bsrc, const string& value);
153  static string s_ConvertAltitudeToMeters( const string& value );
154 protected:
155  virtual bool x_ValidArguments() const;
156 };
157 
158 
160 {
161 public:
162  enum EPubType {
167  eAffilCountry
168  };
170 
171  virtual void TheFunction();
172 
173  static string s_FixCapitalizationInTitle(const string& title, bool first_is_upper, const objects::CSeq_entry_Handle& seh);
174  static Int4 s_FixCapitalizationInAuthor(objects::CName_std& auth_names);
175  static bool s_FixCapitalizationInElement(string& value, bool fix_abbrev, bool fix_short_words, bool cap_after_apostrophe);
176  static void s_FixCapitalizationInCountryString(string& country, bool punct_only);
177  static Int4 s_FixCapsInPubAffil(objects::CAffil& affil, bool punct_only);
178  static Int4 s_FixCapsInPubAffil_NoAffilDiv(objects::CAffil& affil, bool punct_only);
179  static Int4 s_FixCapsInPubAffil_Affil(objects::CAffil& affil, bool punct_only);
180  static Int4 s_FixCapsInPubAffil_Div(objects::CAffil& affil, bool punct_only);
181  static Int4 s_FixCapsInPubAffil_City(objects::CAffil& affil, bool punct_only);
182  static Int4 s_FixCapsInPubAffil_Street(objects::CAffil& affil, bool punct_only);
183  static Int4 s_FixCapsInPubAffil_Sub(objects::CAffil& affil, bool punct_only);
184  static Int4 s_FixCapsInPubAffil_Country(objects::CAffil& affil, bool punct_only);
185 protected:
187  : IEditMacroFunction(func_scope), m_Type(type) {}
188 
189  virtual bool x_ValidArguments() const;
190  void x_FixCapsInPubAffilCountry(objects::CAffil& affil, bool punct_only);
192 };
193 
195 {
196 public:
198  : CMacroFunction_FixPubCaps(func_scope, CMacroFunction_FixPubCaps::eTitle) {}
201 };
202 
204 {
205 public:
207  : CMacroFunction_FixPubCaps(func_scope, CMacroFunction_FixPubCaps::eAuthor) {}
210 };
211 
213 {
214 public:
216  : CMacroFunction_FixPubCaps(func_scope, CMacroFunction_FixPubCaps::eAffiliation) {}
219 };
220 
222 {
223 public:
225  : CMacroFunction_FixPubCaps(func_scope, CMacroFunction_FixPubCaps::eAffilExceptAffilDiv) {}
228 };
229 
231 {
232 public:
234  : CMacroFunction_FixPubCaps(func_scope, CMacroFunction_FixPubCaps::eAffilCountry) {}
237 };
238 
239 
240 
241 
243 {
244 public:
246  : IEditMacroFunction(func_scope) {}
247 
249  virtual void TheFunction();
250  static bool s_RemoveSegGaps(objects::CSeq_align& align);
252 protected:
253  virtual bool x_ValidArguments() const;
254 };
255 
257 {
258 public:
260  : IEditMacroFunction(func_scope) {}
261 
263  virtual void TheFunction();
264  static bool s_RemoveOrgName(const objects::CBioSource& bsrc, string& field);
265 
267 protected:
268  virtual bool x_ValidArguments() const;
269 };
270 
272 {
273 public:
275  : IEditMacroFunction(func_scope) {}
276 
278  virtual void TheFunction();
279 
280  // returns an empty string if there is no such ID
281  static string s_GetBarcodeId(const objects::CBioseq& bseq);
282  static bool s_HasBarcodeDbXref(const objects::CBioseq& bseq, const string& barcode_id);
283  static CRef<objects::CDbtag> s_MakeBarcodeDbXref(const string& barcode_id);
284 
286 protected:
287  virtual bool x_ValidArguments() const;
288 };
289 
291 {
292 public:
294  : IEditMacroFunction(func_scope) {}
295 
296  virtual void TheFunction();
298 
299 protected:
300  virtual bool x_ValidArguments() const;
302 };
303 
304 
305 END_SCOPE(macro)
307 
308 /* @} */
309 
310 #endif // GUI_OBJUTILS___MACRO_FN_DO__HPP
@Affil.hpp User-defined methods of the data storage class.
Definition: Affil.hpp:56
CAuthor –.
Definition: Author.hpp:59
@Name_std.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:56
CSeq_entry_Handle –.
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
Definition: tempstr.hpp:65
Base class for any user function that performs editing operations on ASN.1 data.
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
DECLARE_FUNC_CLASS_WITH_FNCNAME(CMacroFunction_SetPubAuthorMI)
map< objects::CBioseq_Handle, set< objects::CSeq_feat_Handle > > m_ProductToCds
CMacroFunction_TrimJunkFromPrimers(EScopeEnum func_scope)
CMacroFunction_TrimTerminalNs(EScopeEnum func_scope)
static CTempString GetFuncName()
static CTempString GetFuncName()
CMacroFunction_RemoveSegGaps(EScopeEnum func_scope)
static CTempString GetFuncName()
virtual bool x_ValidArguments() const
Tests the number and the type of function arguments.
CMacroFunction_FixPubCapsAuthor(EScopeEnum func_scope)
virtual ~CMacroFunction_FixPubCaps()
CMacroFunction_MakeBoldXrefs(EScopeEnum func_scope)
static CTempString GetFuncName()
static CTempString GetFuncName()
static CTempString GetFuncName()
CMacroFunction_RemoveOrgName(EScopeEnum func_scope)
virtual void TheFunction()
Function implementation.
CMacroFunction_ModifyPrimerSeq(EScopeEnum func_scope, EModifyType type)
static CTempString GetFuncName()
CMacroFunction_FixPubCaps(EScopeEnum func_scope, EPubType type)
CMacroFunction_FixPubCapsAffilCountry(EScopeEnum func_scope)
static CTempString GetFuncName()
CMacroFunction_FixPubCapsTitle(EScopeEnum func_scope)
static CTempString GetFuncName()
CMacroFunction_FixFormat(EScopeEnum func_scope)
CMacroFunction_FixPubCapsAffilWithExcept(EScopeEnum func_scope)
CMacroFunction_FixPubCapsAffil(EScopeEnum func_scope)
virtual ~CMacroFunction_FixFormat()
static CTempString GetFuncName()
CMacroFunction_FixIInPrimers(EScopeEnum func_scope)
int32_t Int4
4-byte (32-bit) signed integer
Definition: ncbitype.h:102
#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 NCBI_GUIOBJUTILS_EXPORT
Definition: gui_export.h:512
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Definition: type.c:6
Modified on Wed Sep 04 15:05:41 2024 by modify_doxy.py rev. 669887