NCBI C++ ToolKit
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
CValidator Class Reference

Search Toolkit Book for CValidator

#include <objtools/validator/validator.hpp>

+ Inheritance diagram for CValidator:
+ Collaboration diagram for CValidator:

Classes

class  CCache
 
class  CCacheImpl
 Cache various information for one validation run. More...
 
class  CProgressInfo
 

Public Types

enum  EValidOptions {
  eVal_non_ascii = 0x1 , eVal_no_context = 0x2 , eVal_val_align = 0x4 , eVal_val_exons = 0x8 ,
  eVal_ovl_pep_err = 0x10 , eVal_seqsubmit_parent = 0x20 , eVal_need_isojta = 0x40 , eVal_validate_id_set = 0x80 ,
  eVal_remote_fetch = 0x100 , eVal_far_fetch_mrna_products = 0x200 , eVal_far_fetch_cds_products = 0x400 , eVal_locus_tag_general_match = 0x800 ,
  eVal_do_rubisco_test = 0x1000 , eVal_indexer_version = 0x2000 , eVal_use_entrez = 0x4000 , eVal_inference_accns = 0x8000 ,
  eVal_ignore_exceptions = 0x10000 , eVal_report_splice_as_error = 0x20000 , eVal_latlon_check_state = 0x40000 , eVal_latlon_ignore_water = 0x80000 ,
  eVal_genome_submission = 0x100000 , eVal_do_tax_lookup = 0x200000 , eVal_do_barcode_tests = 0x400000 , eVal_refseq_conventions = 0x800000 ,
  eVal_collect_locus_tags = 0x1000000 , eVal_generate_golden_file = 0x2000000 , eVal_compare_vdjc_to_cds = 0x4000000 , eVal_ignore_inferences = 0x10000000
}
 
enum  EDbxrefValid {
  eValid = 0 , eDbHasSgml = 1 , eTagHasSgml = 2 , eContainsSpace = 4 ,
  eNotForSource = 8 , eOnlyForSource = 16 , eOnlyForRefSeq = 32 , eRefSeqNotForSource = 64 ,
  eBadCapitalization = 128 , eUnrecognized = 256
}
 
using TSuppressed = set< CValidErrItem::TErrIndex >
 
typedef bool(* TProgressCallback) (CProgressInfo *)
 
typedef int TDbxrefValidFlags
 
using TEntryInfo = CValidatorEntryInfo
 
- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 

Public Member Functions

 CValidator (CObjectManager &objmgr)
 
 CValidator (CObjectManager &objmgr, shared_ptr< SValidatorContext > pContext)
 
void SetTaxon3 (shared_ptr< ITaxon3 > taxon)
 
 CValidator (const CValidator &)=delete
 
CValidatoroperator= (const CValidator &)=delete
 
 ~CValidator ()
 
CRef< CValidErrorValidate (const CSeq_entry &se, CScope *scope=nullptr, Uint4 options=0)
 
void Validate (const CSeq_entry &se, CScope *scope, Uint4 options, IValidError &errors, const TSuppressed *pSuppressed=nullptr)
 
CRef< CValidErrorValidate (const CSeq_entry_Handle &se, Uint4 options=0)
 
void Validate (const CSeq_entry_Handle &seh, Uint4 options, IValidError &errors, const TSuppressed *pSuppressed=nullptr)
 
CRef< CValidErrorValidate (const CSeq_submit &ss, CScope *scope=nullptr, Uint4 options=0)
 
void Validate (const CSeq_submit &ss, CScope *scope, Uint4 options, IValidError &errors, const TSuppressed *pSuppressed=nullptr)
 
CConstRef< CValidErrorValidate (const CSeq_annot_Handle &sa, Uint4 options=0)
 
void Validate (const CSeq_annot_Handle &sa, Uint4 options, IValidError &errors)
 
void Validate (const CSeq_annot_Handle &sa, Uint4 options, CValidError &errors)
 
CConstRef< CValidErrorValidate (const CSeq_feat &feat, CScope *scope=nullptr, Uint4 options=0)
 
void Validate (const CSeq_feat &feat, CScope *scope, Uint4 options, IValidError &errors)
 
CConstRef< CValidErrorValidate (const CBioSource &src, CScope *scope=nullptr, Uint4 options=0)
 
void Validate (const CBioSource &src, CScope *scope, Uint4 options, IValidError &errors)
 
CConstRef< CValidErrorValidate (const CPubdesc &pubdesc, CScope *scope=nullptr, Uint4 options=0)
 
void Validate (const CPubdesc &desc, CScope *scope, Uint4 options, IValidError &errors)
 
CConstRef< CValidErrorValidate (const CSeqdesc &desc, const CSeq_entry &ctx, Uint4 options=0)
 
void Validate (const CSeqdesc &desc, const CSeq_entry &ctx, Uint4 options, IValidError &errors)
 
bool IsValidStructuredComment (const CSeqdesc &desc) const
 
CConstRef< CValidErrorGetTSANStretchErrors (const CSeq_entry_Handle &se)
 
CConstRef< CValidErrorGetTSACDSOnMinusStrandErrors (const CSeq_entry_Handle &se)
 
CConstRef< CValidErrorGetTSAConflictingBiomolTechErrors (const CSeq_entry_Handle &se)
 
CConstRef< CValidErrorGetTSANStretchErrors (const CBioseq &seq)
 
CConstRef< CValidErrorGetTSACDSOnMinusStrandErrors (const CSeq_feat &f, const CBioseq &seq)
 
CConstRef< CValidErrorGetTSAConflictingBiomolTechErrors (const CBioseq &seq)
 
void SetProgressCallback (TProgressCallback callback, void *user_data=nullptr)
 
SValidatorContextSetContext ()
 
bool IsSetEntryInfo () const
 
const TEntryInfoGetEntryInfo () const
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Static Public Member Functions

static CRef< CCacheMakeEmptyCache ()
 
static bool BadCharsInAuthorName (const string &str, bool allowcomma, bool allowperiod, bool last)
 
static bool BadCharsInAuthorLastName (const string &str)
 
static bool BadCharsInAuthorFirstName (const string &str)
 
static bool BadCharsInAuthorInitials (const string &str)
 
static bool BadCharsInAuthorSuffix (const string &str)
 
static string BadCharsInAuthor (const CName_std &author, bool &last_is_bad)
 
static string BadCharsInAuthor (const CAuthor &author, bool &last_is_bad)
 
static bool IsSeqLocCorrectlyOrdered (const CSeq_loc &loc, CScope &scope)
 
static bool DoesSeqLocContainAdjacentIntervals (const CSeq_loc &loc, CScope &scope)
 
static bool DoesSeqLocContainDuplicateIntervals (const CSeq_loc &loc, CScope &scope)
 
static EErrType ConvertCode (CSubSource::ELatLonCountryErr errcode)
 
static TDbxrefValidFlags IsValidDbxref (const CDbtag &xref, bool is_biosource, bool is_refseq_or_gps)
 
static taxupdate_func_t MakeTaxUpdateFunction (shared_ptr< ITaxon3 > taxon)
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 

Private Member Functions

void x_SetEntryInfo (const TEntryInfo &info)
 

Private Attributes

CRef< CObjectManagerm_ObjMgr
 
shared_ptr< ITaxon3m_pOwnTaxon
 
TProgressCallback m_PrgCallback =nullptr
 
void * m_UserData =nullptr
 
shared_ptr< SValidatorContextm_pContext
 
unique_ptr< CValidatorEntryInfom_pEntryInfo
 

Additional Inherited Members

- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Definition at line 73 of file validator.hpp.

Member Typedef Documentation

◆ TDbxrefValidFlags

Definition at line 304 of file validator.hpp.

◆ TEntryInfo

Definition at line 309 of file validator.hpp.

◆ TProgressCallback

typedef bool(* CValidator::TProgressCallback) (CProgressInfo *)

Definition at line 287 of file validator.hpp.

◆ TSuppressed

Definition at line 77 of file validator.hpp.

Member Enumeration Documentation

◆ EDbxrefValid

Enumerator
eValid 
eDbHasSgml 
eTagHasSgml 
eContainsSpace 
eNotForSource 
eOnlyForSource 
eOnlyForRefSeq 
eRefSeqNotForSource 
eBadCapitalization 
eUnrecognized 

Definition at line 292 of file validator.hpp.

◆ EValidOptions

Enumerator
eVal_non_ascii 
eVal_no_context 
eVal_val_align 
eVal_val_exons 
eVal_ovl_pep_err 
eVal_seqsubmit_parent 
eVal_need_isojta 
eVal_validate_id_set 
eVal_remote_fetch 
eVal_far_fetch_mrna_products 
eVal_far_fetch_cds_products 
eVal_locus_tag_general_match 
eVal_do_rubisco_test 
eVal_indexer_version 
eVal_use_entrez 
eVal_inference_accns 
eVal_ignore_exceptions 
eVal_report_splice_as_error 
eVal_latlon_check_state 
eVal_latlon_ignore_water 
eVal_genome_submission 
eVal_do_tax_lookup 
eVal_do_barcode_tests 
eVal_refseq_conventions 
eVal_collect_locus_tags 
eVal_generate_golden_file 
eVal_compare_vdjc_to_cds 
eVal_ignore_inferences 

Definition at line 79 of file validator.hpp.

Constructor & Destructor Documentation

◆ CValidator() [1/3]

CValidator::CValidator ( CObjectManager objmgr)

Definition at line 61 of file validator.cpp.

◆ CValidator() [2/3]

CValidator::CValidator ( CObjectManager objmgr,
shared_ptr< SValidatorContext pContext 
)

Definition at line 67 of file validator.cpp.

◆ CValidator() [3/3]

CValidator::CValidator ( const CValidator )
delete

◆ ~CValidator()

CValidator::~CValidator ( )

Definition at line 82 of file validator.cpp.

Member Function Documentation

◆ BadCharsInAuthor() [1/2]

string CValidator::BadCharsInAuthor ( const CAuthor author,
bool last_is_bad 
)
static

◆ BadCharsInAuthor() [2/2]

string CValidator::BadCharsInAuthor ( const CName_std author,
bool last_is_bad 
)
static

◆ BadCharsInAuthorFirstName()

bool CValidator::BadCharsInAuthorFirstName ( const string str)
static

Definition at line 499 of file validator.cpp.

References BadCharsInAuthorName(), and str().

Referenced by BadCharsInAuthor().

◆ BadCharsInAuthorInitials()

bool CValidator::BadCharsInAuthorInitials ( const string str)
static

Definition at line 505 of file validator.cpp.

References BadCharsInAuthorName(), and str().

Referenced by BadCharsInAuthor().

◆ BadCharsInAuthorLastName()

bool CValidator::BadCharsInAuthorLastName ( const string str)
static

Definition at line 489 of file validator.cpp.

References BadCharsInAuthorName(), NStr::EqualNocase(), and str().

Referenced by BadCharsInAuthor().

◆ BadCharsInAuthorName()

bool CValidator::BadCharsInAuthorName ( const string str,
bool  allowcomma,
bool  allowperiod,
bool  last 
)
static

◆ BadCharsInAuthorSuffix()

bool CValidator::BadCharsInAuthorSuffix ( const string str)
static

Definition at line 511 of file validator.cpp.

References BadCharsInAuthorName(), and str().

Referenced by BadCharsInAuthor().

◆ ConvertCode()

EErrType CValidator::ConvertCode ( CSubSource::ELatLonCountryErr  errcode)
static

◆ DoesSeqLocContainAdjacentIntervals()

bool CValidator::DoesSeqLocContainAdjacentIntervals ( const CSeq_loc loc,
CScope scope 
)
static

Definition at line 680 of file validator.cpp.

References CheckConsecutiveIntervals(), and x_IsNotAdjacent().

Referenced by CValidError_imp::ValidateSeqLoc().

◆ DoesSeqLocContainDuplicateIntervals()

bool CValidator::DoesSeqLocContainDuplicateIntervals ( const CSeq_loc loc,
CScope scope 
)
static

◆ GetEntryInfo()

const CValidator::TEntryInfo & CValidator::GetEntryInfo ( ) const

Definition at line 813 of file validator.cpp.

References m_pEntryInfo.

◆ GetTSACDSOnMinusStrandErrors() [1/2]

CConstRef< CValidError > CValidator::GetTSACDSOnMinusStrandErrors ( const CSeq_entry_Handle se)

◆ GetTSACDSOnMinusStrandErrors() [2/2]

CConstRef< CValidError > CValidator::GetTSACDSOnMinusStrandErrors ( const CSeq_feat f,
const CBioseq seq 
)

◆ GetTSAConflictingBiomolTechErrors() [1/2]

CConstRef< CValidError > CValidator::GetTSAConflictingBiomolTechErrors ( const CBioseq seq)

◆ GetTSAConflictingBiomolTechErrors() [2/2]

CConstRef< CValidError > CValidator::GetTSAConflictingBiomolTechErrors ( const CSeq_entry_Handle se)

◆ GetTSANStretchErrors() [1/2]

CConstRef< CValidError > CValidator::GetTSANStretchErrors ( const CBioseq seq)

◆ GetTSANStretchErrors() [2/2]

CConstRef< CValidError > CValidator::GetTSANStretchErrors ( const CSeq_entry_Handle se)

◆ IsSeqLocCorrectlyOrdered()

bool CValidator::IsSeqLocCorrectlyOrdered ( const CSeq_loc loc,
CScope scope 
)
static

◆ IsSetEntryInfo()

bool CValidator::IsSetEntryInfo ( ) const

Definition at line 807 of file validator.cpp.

References m_pEntryInfo.

◆ IsValidDbxref()

CValidator::TDbxrefValidFlags CValidator::IsValidDbxref ( const CDbtag xref,
bool  is_biosource,
bool  is_refseq_or_gps 
)
static

◆ IsValidStructuredComment()

bool CValidator::IsValidStructuredComment ( const CSeqdesc desc) const

◆ MakeEmptyCache()

CRef< CCache > CValidator::MakeEmptyCache ( )
static

Definition at line 832 of file validator.cpp.

References Ref().

◆ MakeTaxUpdateFunction()

taxupdate_func_t CValidator::MakeTaxUpdateFunction ( shared_ptr< ITaxon3 taxon)
static

Definition at line 85 of file validator.cpp.

References query.

Referenced by SetTaxon3().

◆ operator=()

CValidator& CValidator::operator= ( const CValidator )
delete

◆ SetContext()

SValidatorContext& CValidator::SetContext ( void  )
inline

Definition at line 307 of file validator.hpp.

References m_pContext.

◆ SetProgressCallback()

void CValidator::SetProgressCallback ( TProgressCallback  callback,
void *  user_data = nullptr 
)

Definition at line 436 of file validator.cpp.

References m_PrgCallback, and m_UserData.

◆ SetTaxon3()

void CValidator::SetTaxon3 ( shared_ptr< ITaxon3 taxon)

Definition at line 75 of file validator.cpp.

References m_pContext, m_pOwnTaxon, and MakeTaxUpdateFunction().

◆ Validate() [1/17]

void CValidator::Validate ( const CBioSource src,
CScope scope,
Uint4  options,
IValidError errors 
)

Definition at line 369 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [2/17]

CConstRef< CValidError > CValidator::Validate ( const CBioSource src,
CScope scope = nullptr,
Uint4  options = 0 
)

Definition at line 357 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [3/17]

void CValidator::Validate ( const CPubdesc desc,
CScope scope,
Uint4  options,
IValidError errors 
)

Definition at line 393 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [4/17]

CConstRef< CValidError > CValidator::Validate ( const CPubdesc pubdesc,
CScope scope = nullptr,
Uint4  options = 0 
)

Definition at line 382 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [5/17]

void CValidator::Validate ( const CSeq_annot_Handle sa,
Uint4  options,
CValidError errors 
)

Definition at line 313 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [6/17]

void CValidator::Validate ( const CSeq_annot_Handle sa,
Uint4  options,
IValidError errors 
)

Definition at line 323 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [7/17]

CConstRef< CValidError > CValidator::Validate ( const CSeq_annot_Handle sa,
Uint4  options = 0 
)

Definition at line 303 of file validator.cpp.

References CSeq_annot_Handle::GetCompleteSeq_annot(), Ref(), and Validate().

◆ Validate() [8/17]

void CValidator::Validate ( const CSeq_entry se,
CScope scope,
Uint4  options,
IValidError errors,
const TSuppressed pSuppressed = nullptr 
)

◆ Validate() [9/17]

CRef< CValidError > CValidator::Validate ( const CSeq_entry se,
CScope scope = nullptr,
Uint4  options = 0 
)

◆ Validate() [10/17]

CRef< CValidError > CValidator::Validate ( const CSeq_entry_Handle se,
Uint4  options = 0 
)

◆ Validate() [11/17]

void CValidator::Validate ( const CSeq_entry_Handle seh,
Uint4  options,
IValidError errors,
const TSuppressed pSuppressed = nullptr 
)

◆ Validate() [12/17]

void CValidator::Validate ( const CSeq_feat feat,
CScope scope,
Uint4  options,
IValidError errors 
)

Definition at line 345 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [13/17]

CConstRef< CValidError > CValidator::Validate ( const CSeq_feat feat,
CScope scope = nullptr,
Uint4  options = 0 
)

Definition at line 333 of file validator.cpp.

References m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [14/17]

void CValidator::Validate ( const CSeq_submit ss,
CScope scope,
Uint4  options,
IValidError errors,
const TSuppressed pSuppressed = nullptr 
)

◆ Validate() [15/17]

CRef< CValidError > CValidator::Validate ( const CSeq_submit ss,
CScope scope = nullptr,
Uint4  options = 0 
)

◆ Validate() [16/17]

void CValidator::Validate ( const CSeqdesc desc,
const CSeq_entry ctx,
Uint4  options,
IValidError errors 
)

Definition at line 414 of file validator.cpp.

References ctx, m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ Validate() [17/17]

CConstRef< CValidError > CValidator::Validate ( const CSeqdesc desc,
const CSeq_entry ctx,
Uint4  options = 0 
)

Definition at line 403 of file validator.cpp.

References ctx, m_ObjMgr, m_pContext, and CValidError_imp::Validate().

◆ x_SetEntryInfo()

void CValidator::x_SetEntryInfo ( const TEntryInfo info)
private

Definition at line 801 of file validator.cpp.

References info, and m_pEntryInfo.

Referenced by Validate().

Member Data Documentation

◆ m_ObjMgr

CRef<CObjectManager> CValidator::m_ObjMgr
private

◆ m_pContext

shared_ptr<SValidatorContext> CValidator::m_pContext
private

◆ m_pEntryInfo

unique_ptr<CValidatorEntryInfo> CValidator::m_pEntryInfo
private

Definition at line 322 of file validator.hpp.

Referenced by GetEntryInfo(), IsSetEntryInfo(), and x_SetEntryInfo().

◆ m_pOwnTaxon

shared_ptr<ITaxon3> CValidator::m_pOwnTaxon
private

Definition at line 317 of file validator.hpp.

Referenced by SetTaxon3().

◆ m_PrgCallback

TProgressCallback CValidator::m_PrgCallback =nullptr
private

◆ m_UserData

void* CValidator::m_UserData =nullptr
private

The documentation for this class was generated from the following files:
Modified on Fri Sep 20 14:57:32 2024 by modify_doxy.py rev. 669887