NCBI C++ ToolKit
Classes | Macros | Typedefs | Functions | Variables
cleanup_utils.cpp File Reference
#include <ncbi_pch.hpp>
#include <corelib/ncbistd.hpp>
#include "cleanup_utils.hpp"
#include <objmgr/util/seq_loc_util.hpp>
#include <objmgr/util/sequence.hpp>
#include <objects/seq/Pubdesc.hpp>
#include <objects/pub/Pub_equiv.hpp>
#include <objects/pub/Pub.hpp>
#include <objects/biblio/Cit_sub.hpp>
#include <objects/biblio/Cit_gen.hpp>
#include <objects/biblio/Auth_list.hpp>
#include <objects/biblio/Affil.hpp>
#include <objects/biblio/Author.hpp>
#include <objects/biblio/Imprint.hpp>
#include <objects/general/Date.hpp>
#include <objects/general/Person_id.hpp>
#include <objects/general/Name_std.hpp>
#include <objects/seq/Seqdesc.hpp>
#include <objects/seq/MolInfo.hpp>
#include <objects/seq/seq_loc_from_string.hpp>
#include <objects/seqfeat/Org_ref.hpp>
#include <objects/misc/sequence_macros.hpp>
#include <objmgr/seqdesc_ci.hpp>
#include <objtools/cleanup/cleanup_pub.hpp>
+ Include dependency graph for cleanup_utils.cpp:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

class  CGetSeqLocFromStringHelper_ReadLocFromText
 
struct  proteinabbrev
 

Macros

#define IS_LOWER(c)   ('a'<=(c) && (c)<='z')
 
#define IS_UPPER(c)   ('A'<=(c) && (c)<='Z')
 
#define twocommas   ((',') << 8 | (','))
 
#define twospaces   ((' ') << 8 | (' '))
 
#define twosemicolons   ((';') << 8 | (';'))
 
#define space_comma   ((' ') << 8 | (','))
 
#define space_bracket   ((' ') << 8 | (')'))
 
#define bracket_space   (('(') << 8 | (' '))
 
#define space_semicolon   ((' ') << 8 | (';'))
 
#define comma_space   ((',') << 8 | (' '))
 
#define semicolon_space   ((';') << 8 | (' '))
 

Typedefs

typedef struct proteinabbrev ProteinAbbrevData
 

Functions

bool CleanVisString (string &str)
 
bool CleanVisStringJunk (string &str, bool allow_ellipses)
 
bool RemoveSpacesBetweenTildes (string &str)
 remove white space between pairs of tildes. More...
 
bool CleanDoubleQuote (string &str)
 Change double to single quotes. More...
 
void TrimInternalSemicolons (string &str)
 remove duplicate internal semicolons. More...
 
bool Asn2gnbkCompressSpaces (string &val)
 weird space compression from C Toolkit More...
 
bool TrimSpacesSemicolonsAndCommas (string &val)
 
bool RemoveSpaces (string &str)
 remove all spaces from a string More...
 
CRef< CSeq_locReadLocFromText (const string &text, const CSeq_id *id, CScope *scope)
 
char ValidAminoAcid (const string &abbrev)
 
bool s_DbtagCompare (const CRef< CDbtag > &dbt1, const CRef< CDbtag > &dbt2)
 
bool s_DbtagEqual (const CRef< CDbtag > &dbt1, const CRef< CDbtag > &dbt2)
 
bool s_OrgrefSynCompare (const string &syn1, const string &syn2)
 
bool s_OrgrefSynEqual (const string &syn1, const string &syn2)
 

Variables

static ProteinAbbrevData abbreviation_list []
 

Macro Definition Documentation

◆ bracket_space

#define bracket_space   (('(') << 8 | (' '))

Definition at line 314 of file cleanup_utils.cpp.

◆ comma_space

#define comma_space   ((',') << 8 | (' '))

Definition at line 316 of file cleanup_utils.cpp.

◆ IS_LOWER

#define IS_LOWER (   c)    ('a'<=(c) && (c)<='z')

Definition at line 66 of file cleanup_utils.cpp.

◆ IS_UPPER

#define IS_UPPER (   c)    ('A'<=(c) && (c)<='Z')

Definition at line 67 of file cleanup_utils.cpp.

◆ semicolon_space

#define semicolon_space   ((';') << 8 | (' '))

Definition at line 317 of file cleanup_utils.cpp.

◆ space_bracket

#define space_bracket   ((' ') << 8 | (')'))

Definition at line 313 of file cleanup_utils.cpp.

◆ space_comma

#define space_comma   ((' ') << 8 | (','))

Definition at line 312 of file cleanup_utils.cpp.

◆ space_semicolon

#define space_semicolon   ((' ') << 8 | (';'))

Definition at line 315 of file cleanup_utils.cpp.

◆ twocommas

#define twocommas   ((',') << 8 | (','))

Definition at line 309 of file cleanup_utils.cpp.

◆ twosemicolons

#define twosemicolons   ((';') << 8 | (';'))

Definition at line 311 of file cleanup_utils.cpp.

◆ twospaces

#define twospaces   ((' ') << 8 | (' '))

Definition at line 310 of file cleanup_utils.cpp.

Typedef Documentation

◆ ProteinAbbrevData

Function Documentation

◆ Asn2gnbkCompressSpaces()

bool Asn2gnbkCompressSpaces ( string val)

◆ CleanDoubleQuote()

bool CleanDoubleQuote ( string str)

◆ CleanVisString()

bool CleanVisString ( string str)

◆ CleanVisStringJunk()

bool CleanVisStringJunk ( string str,
bool  allow_ellipses 
)

◆ ReadLocFromText()

CRef<CSeq_loc> ReadLocFromText ( const string text,
const CSeq_id id,
CScope scope 
)

Definition at line 585 of file cleanup_utils.cpp.

References GetSeqLocFromString(), and text().

Referenced by CCleanup::ParseCodeBreak(), and s_ParseTRnaFromAnticodonString().

◆ RemoveSpaces()

bool RemoveSpaces ( string str)

remove all spaces from a string

Definition at line 548 of file cleanup_utils.cpp.

References isspace(), next(), NON_CONST_ITERATE, and str().

Referenced by CCitGenCleaner::Clean().

◆ RemoveSpacesBetweenTildes()

bool RemoveSpacesBetweenTildes ( string str)

remove white space between pairs of tildes.

"~ ~ ~ a~" -> "~~~ a~"

Definition at line 229 of file cleanup_utils.cpp.

References NPOS, and str().

Referenced by CNewCleanup_imp::x_RemoveSpacesBetweenTildesMarkChanged().

◆ s_DbtagCompare()

bool s_DbtagCompare ( const CRef< CDbtag > &  dbt1,
const CRef< CDbtag > &  dbt2 
)

◆ s_DbtagEqual()

bool s_DbtagEqual ( const CRef< CDbtag > &  dbt1,
const CRef< CDbtag > &  dbt2 
)

◆ s_OrgrefSynCompare()

bool s_OrgrefSynCompare ( const string syn1,
const string syn2 
)

Definition at line 669 of file cleanup_utils.cpp.

References NStr::CompareNocase().

Referenced by CNewCleanup_imp::x_PostOrgRef().

◆ s_OrgrefSynEqual()

bool s_OrgrefSynEqual ( const string syn1,
const string syn2 
)

Definition at line 674 of file cleanup_utils.cpp.

References NStr::EqualNocase().

Referenced by CNewCleanup_imp::x_PostOrgRef().

◆ TrimInternalSemicolons()

void TrimInternalSemicolons ( string str)

remove duplicate internal semicolons.

"a;;b" will become "a;b".

Definition at line 276 of file cleanup_utils.cpp.

References NStr::Find(), and str().

Referenced by CNewCleanup_imp::GBQualBC(), CNewCleanup_imp::ProtActivityBC(), CNewCleanup_imp::ProtNameBC(), CNewCleanup_imp::ProtRefEC(), and CNewCleanup_imp::x_TrimInternalSemicolonsMarkChanged().

◆ TrimSpacesSemicolonsAndCommas()

bool TrimSpacesSemicolonsAndCommas ( string val)

Definition at line 465 of file cleanup_utils.cpp.

References NStr::Equal(), str(), and val.

Referenced by CNewCleanup_imp::DbtagBC(), and CNewCleanup_imp::OrgrefModBC().

◆ ValidAminoAcid()

char ValidAminoAcid ( const string abbrev)

Variable Documentation

◆ abbreviation_list

ProteinAbbrevData abbreviation_list[]
static

Definition at line 596 of file cleanup_utils.cpp.

Referenced by ValidAminoAcid().

Modified on Thu Dec 07 10:09:44 2023 by modify_doxy.py rev. 669887