any_change =
false;
55 if( user_object.IsSetType() && user_object.GetType().IsStr() ) {
60 if(user_object.IsSetData()) {
61 for(
autofield : user_object.SetData()) {
62any_change |= x_CleanupUserField(*field);
66any_change |= s_CleanupGeneOntology(user_object);
67any_change |= s_CleanupStructuredComment(user_object);
68any_change |= s_CleanupDBLink(user_object);
76 boolany_change =
false;
93 for(
autosub_obj : field.
SetData().SetObjects()) {
106 for(
autosub_field : field.
SetData().SetFields()) {
120{
"go ref",
"GO_REF:"}
127 boolany_change =
false;
139 static const char*
constsc_bsecGoQualType[] = {
140 "",
"Component",
"Function",
"Process" 145 for(
autoouter_field : obj.
SetData()) {
146 if(outer_field->IsSetLabel() && outer_field->GetLabel().IsStr() &&
147outer_field->IsSetData() && outer_field->GetData().IsFields()
148&& sc_GoQualArray.find(outer_field->GetLabel().GetStr().c_str()) != sc_GoQualArray.end()) {
149 for(
autoterm : outer_field->SetData().SetFields()) {
152 for(
autoinner_term_iter : field.
SetData().SetFields()) {
159 autofind_term = sc_OntologyTermCleanupMap.find(inner_label.c_str());
160 if(find_term != sc_OntologyTermCleanupMap.end() &&
162inner_field.
SetData().SetStr().erase(0, strlen(find_term->second));
179 boolany_change =
false;
191 boolgenome_assembly_data =
false;
192 boolibol_data =
false;
194 boolprefix_present =
false;
195 boolsuffix_present =
false;
198 const stringkBarcode =
"International Barcode of Life (iBOL)Data";
201 for(
autofield_i : obj.
SetData()) {
207prefix_present =
true;
211suffix_present =
true;
213 if(is_prefix || is_suffix) {
218field.
SetData().SetStr(new_val);
222genome_assembly_data =
true;
223}
else if( core == kBarcode ) {
229 if(prefix_present && !suffix_present) {
233suffix->
SetLabel().SetStr(
"StructuredCommentSuffix");
235 data.push_back(suffix);
238 if(!prefix_present && suffix_present) {
242prefix->
SetLabel().SetStr(
"StructuredCommentPrefix");
244 data.emplace(
data.begin(), prefix);
248 if( genome_assembly_data ) {
268{
"Annotation Directed",
"Annotation-Directed Improvement"},
269{
"High Quality Draft",
"High-Quality Draft"},
270{
"Improved High Quality Draft",
"Improved High-Quality Draft"},
271{
"Non-contiguous Finished",
"Noncontiguous Finished"}
278 boolany_change =
false;
279 for(
autofield_i : obj.
SetData()) {
287 autoreplace = sc_FinishingCleanupMap.find(field.
GetData().
GetStr().c_str());
288 if(replace != sc_FinishingCleanupMap.end()) {
289field.
SetData().SetStr(replace->second);
293 string&field_str = field.
SetData().SetStr();
294 boolambiguous =
false;
304coll_date->
GetDate(&day,
"%2D");
307coll_date->
GetDate(&month,
"%N");
308month = month.substr(0, 3);
311coll_date->
GetDate(&year,
"%Y");
313new_date += day +
"-";
316new_date += month +
"-";
322field_str = new_date;
335 boolany_change =
false;
343CUser_object::TData::iterator it = obj.
SetData().begin();
344 while(it != obj.
SetData().end()) {
345 boolis_blank =
false;
346 if((*it)->IsSetData()) {
347 if((*it)->GetData().IsStr()) {
348 const string&
val= (*it)->GetData().GetStr();
360it = obj.
SetData().erase(it);
372 boolchanged =
false;
379 for(
auto& it : obj.
SetData()) {
380 if(it->IsSetData() && it->GetData().IsStr()) {
381 string val= it->GetData().GetStr();
382it->SetData().SetStrs().push_back(
val);
395 boolany_change =
false;
static bool s_CleanupDBLink(CUser_object &obj)
static bool s_CleanupGeneOntology(CUser_object &obj)
static bool s_CleanupStructuredComment(CUser_object &obj)
static bool s_CleanupGenomeAssembly(CUser_object &obj)
static bool CleanupUserObject(CUser_object &object)
static bool x_CleanupUserField(CUser_field &field)
static bool s_AddNumToUserField(CUser_field &field)
static bool s_RemoveEmptyFields(CUser_object &obj)
void GetDate(string *label, bool year_only=false) const
Append a standardized string representation of the date to the label.
class CStaticArrayMap<> provides access to a static array in much the same way as CStaticArraySet<>,...
static string FixDateFormat(const string &orig_date)
Attempt to fix the format of the date Returns a blank if the format of the date cannot be determined.
static CRef< CDate > DateFromCollectionDate(const string &str) THROWS((CException))
CUser_field & SetString(const char *value)
@ eObjectType_StructuredComment
EObjectType GetObjectType() const
SStaticPair< const char *, const char * > TFinishingCleanupElem
DEFINE_STATIC_ARRAY_MAP(TOntologyCleanupMap, sc_OntologyTermCleanupMap, k_ontology_term_cleanup_map)
SStaticPair< const char *, const char * > TOntologyCleanupElem
CStaticArrayMap< const char *, const char *, PNocase_CStr > TFinishingCleanupMap
static const TOntologyCleanupElem k_ontology_term_cleanup_map[]
CStaticArrayMap< const char *, const char *, PNocase_CStr > TOntologyCleanupMap
static const TFinishingCleanupElem k_finishing_cleanup_map[]
bool CleanVisString(string &str)
bool Asn2gnbkCompressSpaces(string &val)
weird space compression from C Toolkit
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static CStringUTF8 AsUTF8(const CTempString &src, EEncoding encoding, EValidate validate=eNoValidate)
Convert into UTF8 from a C/C++ string.
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
static string & ToUpper(string &str)
Convert string to upper case â string& version.
@ eNocase
Case insensitive compare.
const TStr & GetStr(void) const
Get the variant data.
bool IsSetData(void) const
the object itself Check if a value has been assigned to Data data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetType(void) const
type of object within class Check if a value has been assigned to Type data member.
bool IsSetYear(void) const
full year (including 1900) Check if a value has been assigned to Year data member.
bool IsStd(void) const
Check if variant Std is selected.
const TStrs & GetStrs(void) const
Get the variant data.
const TData & GetData(void) const
Get the Data member data.
const TOss & GetOss(void) const
Get the variant data.
bool IsFields(void) const
Check if variant Fields is selected.
bool IsSetDay(void) const
day of month (1-31) Check if a value has been assigned to Day data member.
bool IsStr(void) const
Check if variant Str is selected.
bool IsSetLabel(void) const
field label Check if a value has been assigned to Label data member.
TData & SetData(void)
Assign a value to Data data member.
void SetNum(TNum value)
Assign a value to Num data member.
const TStr & GetStr(void) const
Get the variant data.
bool IsSetNum(void) const
required for strs, ints, reals, oss Check if a value has been assigned to Num data member.
void SetLabel(TLabel &value)
Assign a value to Label data member.
const TReals & GetReals(void) const
Get the variant data.
bool IsSetMonth(void) const
month (1-12) Check if a value has been assigned to Month data member.
void SetData(TData &value)
Assign a value to Data data member.
const TLabel & GetLabel(void) const
Get the Label member data.
const TType & GetType(void) const
Get the Type member data.
bool IsSetData(void) const
Check if a value has been assigned to Data data member.
const TStd & GetStd(void) const
Get the variant data.
E_Choice Which(void) const
Which variant is currently selected.
const TInts & GetInts(void) const
Get the variant data.
TNum GetNum(void) const
Get the Num member data.
@ e_Object
for using other definitions
@ e_not_set
No variant selected.
const string kGenomeAssemblyData
Template structure SStaticPair is simlified replacement of STL pair<> Main reason of introducing this...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4