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

Search Toolkit Book for CAgpRow

A container for both the original string column values (Get*() methods) and the values converted to int, char, bool types (member variables). More...

#include <objtools/readers/agp_util.hpp>

+ Inheritance diagram for CAgpRow:
+ Collaboration diagram for CAgpRow:

Public Types

enum  EOrientation { eOrientationPlus = 43 , eOrientationMinus = 45 , eOrientationUnknown = 48 , eOrientationIrrelevant = 110 }
 
enum  EGap {
  eGapClone , eGapFragment , eGapRepeat , eGapScaffold ,
  eGapContamination , eGapContig , eGapCentromere , eGapShort_arm ,
  eGapHeterochromatin , eGapTelomere , eGapCount , eGapYes_count =eGapContamination+1
}
 
enum  ELinkageEvidence {
  fLinkageEvidence_paired_ends = (1 << 0) , fLinkageEvidence_align_genus = (1 << 1) , fLinkageEvidence_align_xgenus = (1 << 2) , fLinkageEvidence_align_trnscpt = (1 << 3) ,
  fLinkageEvidence_within_clone = (1 << 4) , fLinkageEvidence_clone_contig = (1 << 5) , fLinkageEvidence_map = (1 << 6) , fLinkageEvidence_strobe = (1 << 7) ,
  fLinkageEvidence_pcr = (1 << 8) , fLinkageEvidence_proximity_ligation = (1 << 9) , fLinkageEvidence_HIGHEST_BIT_MASK = fLinkageEvidence_proximity_ligation , fLinkageEvidence_unspecified = 0 ,
  fLinkageEvidence_INVALID = -1 , fLinkageEvidence_na = -2
}
 
typedef vector< ELinkageEvidenceTLinkageEvidenceVec
 Might have duplicates, and is empty on error or if there are no actual linkage evidences (e.g. More...
 
- 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

virtual ~CAgpRow ()
 
CRef< CAgpRowClone (void) const
 
int FromString (const string &line)
 
string GetErrorMessage ()
 
string ToString (bool reorder_linkage_evidences=false)
 
stringGetObject ()
 
stringGetObjectBeg ()
 
stringGetObjectEnd ()
 
stringGetPartNumber ()
 
stringGetComponentType ()
 
stringGetComponentId ()
 
stringGetComponentBeg ()
 
stringGetComponentEnd ()
 
stringGetOrientation ()
 
stringGetGapLength ()
 
stringGetGapType ()
 
stringGetLinkage ()
 
stringGetLinkageEvidence ()
 
bool IsGap () const
 
bool IsDraftComponent ()
 
bool GapEndsScaffold () const
 
bool GapValidAtObjectEnd () const
 
bool CheckComponentEnd (TAgpLen comp_len)
 
string LinkageEvidencesToString (void)
 
string LinkageEvidenceFlagsToString ()
 
string SubstOldGap (bool do_subst)
 Returns a string describing suggested replacement, or "" if none is needed. More...
 
string OrientationToString (EOrientation orientation)
 
virtual void SetVersion (EAgpVersion ver)
 
CAgpErrGetErrorHandler ()
 
void SetErrorHandler (CAgpErr *arg)
 
EAgpVersion GetVersion ()
 
- 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< CAgpRowNew (CAgpErr *arg, EAgpVersion agp_version=eAgpVersion_auto, CAgpReader *reader=nullptr)
 
static CRef< CAgpRowNew (EAgpVersion agp_version=eAgpVersion_auto, CAgpReader *reader=nullptr)
 
static bool IsGap (char c)
 
static bool IsDraftComponent (char c)
 
static bool GapValidAtObjectEnd (EGap gap_type)
 
static bool CheckComponentEnd (const string &comp_id, TAgpPos comp_end, TAgpLen comp_len, CAgpErr &agp_err)
 
static string LinkageEvidenceFlagsToString (int le)
 
static const char * le_str (ELinkageEvidence le)
 
static int str_to_le (const string &str)
 
static const char * GapTypeToString (int i)
 
- 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)
 

Public Attributes

SIZE_TYPE pcomment
 
vector< stringcols
 
TAgpPos object_beg
 
TAgpPos object_end
 
TAgpPos part_number
 
char component_type
 
bool is_gap
 
TAgpPos component_beg
 
TAgpPos component_end
 
EOrientation orientation
 
TAgpLen gap_length
 
EGap gap_type
 
bool linkage
 
TLinkageEvidenceVec linkage_evidences
 
int linkage_evidence_flags
 a bit map which holds summary of info in linkage_evidences. More...
 

Protected Types

typedef const char * TStr
 
typedef map< string, EGapTMapStrEGap
 

Protected Member Functions

 CAgpRow (CAgpErr *arg, EAgpVersion agp_version=eAgpVersion_auto, CAgpReader *reader=nullptr)
 
 CAgpRow (EAgpVersion agp_version=eAgpVersion_auto, CAgpReader *reader=nullptr)
 
 CAgpRow (const CAgpRow &)
 
TAgpPos ReadSeqPos (const CTempString seq_pos_str, const string &details, int *perror_code, bool log_errors=true)
 
int ParseComponentCols (bool log_errors=true)
 
int ParseGapCols (bool log_errors=true)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Static Protected Member Functions

static TMapStrEGapgap_type_codes_creator (void)
 

Static Protected Attributes

static const TStr gap_types [eGapCount]
 
static CSafeStatic< TMapStrEGapgap_type_codes
 

Private Attributes

EAgpVersion m_agp_version
 
CAgpReaderm_reader
 
CRef< CAgpErrm_AgpErr
 

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...
 

Detailed Description

A container for both the original string column values (Get*() methods) and the values converted to int, char, bool types (member variables).

Detects formatting errors within a single line, checks that object range length equals gap length or component range length.

Definition at line 71 of file agp_util.hpp.

Member Typedef Documentation

◆ TLinkageEvidenceVec

Might have duplicates, and is empty on error or if there are no actual linkage evidences (e.g.

"na" or "unspecified") It does NOT hold unusual values like fLinkageEvidence_INVALID.

Definition at line 215 of file agp_util.hpp.

◆ TMapStrEGap

typedef map<string, EGap> CAgpRow::TMapStrEGap
protected

Definition at line 294 of file agp_util.hpp.

◆ TStr

typedef const char* CAgpRow::TStr
protected

Definition at line 291 of file agp_util.hpp.

Member Enumeration Documentation

◆ EGap

Enumerator
eGapClone 
eGapFragment 
eGapRepeat 
eGapScaffold 
eGapContamination 
eGapContig 
eGapCentromere 
eGapShort_arm 
eGapHeterochromatin 
eGapTelomere 
eGapCount 
eGapYes_count 

Definition at line 175 of file agp_util.hpp.

◆ ELinkageEvidence

Enumerator
fLinkageEvidence_paired_ends 
fLinkageEvidence_align_genus 
fLinkageEvidence_align_xgenus 
fLinkageEvidence_align_trnscpt 
fLinkageEvidence_within_clone 
fLinkageEvidence_clone_contig 
fLinkageEvidence_map 
fLinkageEvidence_strobe 
fLinkageEvidence_pcr 
fLinkageEvidence_proximity_ligation 
fLinkageEvidence_HIGHEST_BIT_MASK 
fLinkageEvidence_unspecified 
fLinkageEvidence_INVALID 
fLinkageEvidence_na 

Definition at line 194 of file agp_util.hpp.

◆ EOrientation

Enumerator
eOrientationPlus 
eOrientationMinus 
eOrientationUnknown 
eOrientationIrrelevant 

Definition at line 159 of file agp_util.hpp.

Constructor & Destructor Documentation

◆ CAgpRow() [1/3]

CAgpRow::CAgpRow ( CAgpErr arg,
EAgpVersion  agp_version = eAgpVersion_auto,
CAgpReader reader = nullptr 
)
protected

Definition at line 381 of file agp_util.cpp.

Referenced by Clone(), and New().

◆ CAgpRow() [2/3]

CAgpRow::CAgpRow ( EAgpVersion  agp_version = eAgpVersion_auto,
CAgpReader reader = nullptr 
)
protected

Definition at line 375 of file agp_util.cpp.

◆ CAgpRow() [3/3]

CAgpRow::CAgpRow ( const CAgpRow src)
protected

Definition at line 387 of file agp_util.cpp.

◆ ~CAgpRow()

CAgpRow::~CAgpRow ( )
virtual

Definition at line 394 of file agp_util.cpp.

Member Function Documentation

◆ CheckComponentEnd() [1/2]

bool CAgpRow::CheckComponentEnd ( const string comp_id,
TAgpPos  comp_end,
TAgpLen  comp_len,
CAgpErr agp_err 
)
static

◆ CheckComponentEnd() [2/2]

bool CAgpRow::CheckComponentEnd ( TAgpLen  comp_len)
inline

Definition at line 262 of file agp_util.hpp.

References CheckComponentEnd(), component_end, GetComponentId(), and m_AgpErr.

◆ Clone()

CRef<CAgpRow> CAgpRow::Clone ( void  ) const
inline

Definition at line 103 of file agp_util.hpp.

References CAgpRow(), and Ref().

Referenced by CAgpCompSpanSplitter::SaveRow().

◆ FromString()

int CAgpRow::FromString ( const string line)

◆ gap_type_codes_creator()

CAgpRow::TMapStrEGap * CAgpRow::gap_type_codes_creator ( void  )
staticprotected

Definition at line 362 of file agp_util.cpp.

◆ GapEndsScaffold()

bool CAgpRow::GapEndsScaffold ( ) const
inline

◆ GapTypeToString()

static const char* CAgpRow::GapTypeToString ( int  i)
inlinestatic

Definition at line 311 of file agp_util.hpp.

References eGapCount, gap_types, i, and NcbiEmptyCStr.

Referenced by CAgpValidateReader::x_PrintGapCountsLine().

◆ GapValidAtObjectEnd() [1/2]

bool CAgpRow::GapValidAtObjectEnd ( ) const
inline

Definition at line 253 of file agp_util.hpp.

References gap_type.

◆ GapValidAtObjectEnd() [2/2]

static bool CAgpRow::GapValidAtObjectEnd ( EGap  gap_type)
inlinestatic

◆ GetComponentBeg()

string& CAgpRow::GetComponentBeg ( )
inline

Definition at line 127 of file agp_util.hpp.

References cols.

Referenced by ParseComponentCols().

◆ GetComponentEnd()

string& CAgpRow::GetComponentEnd ( )
inline

Definition at line 128 of file agp_util.hpp.

References cols.

Referenced by ParseComponentCols().

◆ GetComponentId()

string& CAgpRow::GetComponentId ( )
inline

◆ GetComponentType()

string& CAgpRow::GetComponentType ( void  )
inline

Definition at line 124 of file agp_util.hpp.

References cols.

Referenced by FromString(), and CAgpValidateReader::OnGapOrComponent().

◆ GetErrorHandler()

CAgpErr* CAgpRow::GetErrorHandler ( void  )
inline

Definition at line 308 of file agp_util.hpp.

References m_AgpErr.

Referenced by CCompVal::init().

◆ GetErrorMessage()

string CAgpRow::GetErrorMessage ( )

Definition at line 836 of file agp_util.cpp.

References CAgpErr::GetErrorMessage(), and m_AgpErr.

◆ GetGapLength()

string& CAgpRow::GetGapLength ( )
inline

Definition at line 139 of file agp_util.hpp.

References cols.

Referenced by ParseGapCols().

◆ GetGapType()

string& CAgpRow::GetGapType ( void  )
inline

Definition at line 140 of file agp_util.hpp.

References cols.

Referenced by ParseGapCols().

◆ GetLinkage()

string& CAgpRow::GetLinkage ( void  )
inline

Definition at line 141 of file agp_util.hpp.

References cols.

Referenced by ParseGapCols().

◆ GetLinkageEvidence()

string& CAgpRow::GetLinkageEvidence ( )
inline

Definition at line 142 of file agp_util.hpp.

References cols, and NcbiEmptyString.

Referenced by ParseGapCols().

◆ GetObject()

string& CAgpRow::GetObject ( void  )
inline

◆ GetObjectBeg()

string& CAgpRow::GetObjectBeg ( )
inline

Definition at line 121 of file agp_util.hpp.

References cols.

Referenced by FromString().

◆ GetObjectEnd()

string& CAgpRow::GetObjectEnd ( )
inline

Definition at line 122 of file agp_util.hpp.

References cols.

Referenced by FromString().

◆ GetOrientation()

string& CAgpRow::GetOrientation ( void  )
inline

Definition at line 129 of file agp_util.hpp.

References cols, and NcbiEmptyString.

Referenced by ParseComponentCols().

◆ GetPartNumber()

string& CAgpRow::GetPartNumber ( void  )
inline

Definition at line 123 of file agp_util.hpp.

References cols.

Referenced by FromString().

◆ GetVersion()

EAgpVersion CAgpRow::GetVersion ( void  )
inline

Definition at line 317 of file agp_util.hpp.

References m_agp_version.

Referenced by CAgpCompSpanSplitter::SaveRow().

◆ IsDraftComponent() [1/2]

bool CAgpRow::IsDraftComponent ( )
inline

Definition at line 242 of file agp_util.hpp.

References component_type.

◆ IsDraftComponent() [2/2]

static bool CAgpRow::IsDraftComponent ( char  c)
inlinestatic

Definition at line 225 of file agp_util.hpp.

Referenced by CAgpValidateReader::OnGapOrComponent().

◆ IsGap() [1/2]

bool CAgpRow::IsGap ( void  ) const
inline

Definition at line 238 of file agp_util.hpp.

References is_gap.

Referenced by CAgpValidateReader::x_PrintTotals().

◆ IsGap() [2/2]

static bool CAgpRow::IsGap ( char  c)
inlinestatic

◆ le_str()

const char * CAgpRow::le_str ( CAgpRow::ELinkageEvidence  le)
static

◆ LinkageEvidenceFlagsToString() [1/2]

string CAgpRow::LinkageEvidenceFlagsToString ( )
inline

Definition at line 270 of file agp_util.hpp.

References linkage_evidence_flags.

Referenced by ToString(), and CAgpValidateReader::x_PrintTotals().

◆ LinkageEvidenceFlagsToString() [2/2]

string CAgpRow::LinkageEvidenceFlagsToString ( int  le)
static

Definition at line 886 of file agp_util.cpp.

References fLinkageEvidence_HIGHEST_BIT_MASK, le(), le_str(), and mask.

◆ LinkageEvidencesToString()

string CAgpRow::LinkageEvidencesToString ( void  )

Definition at line 899 of file agp_util.cpp.

References i2s, ITERATE, le(), le_str(), linkage, linkage_evidences, and result.

Referenced by ToString().

◆ New() [1/2]

static CRef<CAgpRow> CAgpRow::New ( CAgpErr arg,
EAgpVersion  agp_version = eAgpVersion_auto,
CAgpReader reader = nullptr 
)
inlinestatic

◆ New() [2/2]

static CRef<CAgpRow> CAgpRow::New ( EAgpVersion  agp_version = eAgpVersion_auto,
CAgpReader reader = nullptr 
)
inlinestatic

Definition at line 97 of file agp_util.hpp.

References CAgpRow(), and Ref().

◆ OrientationToString()

string CAgpRow::OrientationToString ( EOrientation  orientation)

◆ ParseComponentCols()

int CAgpRow::ParseComponentCols ( bool  log_errors = true)
protected

◆ ParseGapCols()

int CAgpRow::ParseGapCols ( bool  log_errors = true)
protected

◆ ReadSeqPos()

TAgpPos CAgpRow::ReadSeqPos ( const CTempString  seq_pos_str,
const string details,
int perror_code,
bool  log_errors = true 
)
protected

◆ SetErrorHandler()

void CAgpRow::SetErrorHandler ( CAgpErr arg)

Definition at line 841 of file agp_util.cpp.

References m_AgpErr.

Referenced by CAgpReader::SetErrorHandler().

◆ SetVersion()

void CAgpRow::SetVersion ( EAgpVersion  ver)
virtual

Definition at line 962 of file agp_util.cpp.

References m_agp_version.

Referenced by CAgpReader::SetVersion(), and CAgpReader::x_CheckPragmaComment().

◆ str_to_le()

int CAgpRow::str_to_le ( const string str)
static

◆ SubstOldGap()

string CAgpRow::SubstOldGap ( bool  do_subst)

Returns a string describing suggested replacement, or "" if none is needed.

Use do_subst=true to do the actial substitution in this object.

Definition at line 933 of file agp_util.cpp.

References eGapClone, eGapContig, eGapFragment, eGapScaffold, fLinkageEvidence_clone_contig, fLinkageEvidence_paired_ends, fLinkageEvidence_unspecified, fLinkageEvidence_within_clone, gap_type, le(), le_str(), linkage, linkage_evidence_flags, linkage_evidences, NcbiEmptyString, and string.

Referenced by ParseGapCols().

◆ ToString()

string CAgpRow::ToString ( bool  reorder_linkage_evidences = false)

Member Data Documentation

◆ cols

vector<string> CAgpRow::cols

◆ component_beg

TAgpPos CAgpRow::component_beg

◆ component_end

TAgpPos CAgpRow::component_end

◆ component_type

char CAgpRow::component_type

◆ gap_length

TAgpLen CAgpRow::gap_length

◆ gap_type

EGap CAgpRow::gap_type

◆ gap_type_codes

CSafeStatic<TMapStrEGap> CAgpRow::gap_type_codes
staticprotected

Definition at line 295 of file agp_util.hpp.

Referenced by ParseGapCols().

◆ gap_types

const CAgpRow::TStr CAgpRow::gap_types
staticprotected
Initial value:
= {
"clone",
"fragment",
"repeat",
"scaffold",
"contamination",
"contig",
"centromere",
"short_arm",
"heterochromatin",
"telomere"
}

Definition at line 292 of file agp_util.hpp.

Referenced by GapTypeToString(), and ToString().

◆ is_gap

bool CAgpRow::is_gap

◆ linkage

bool CAgpRow::linkage

◆ linkage_evidence_flags

int CAgpRow::linkage_evidence_flags

a bit map which holds summary of info in linkage_evidences.

In particular, this is useful for weeding out duplicates

Definition at line 219 of file agp_util.hpp.

Referenced by LinkageEvidenceFlagsToString(), CAgpValidateReader::OnGapOrComponent(), ParseGapCols(), SubstOldGap(), and CAgpToSeqEntry::x_SetSeqGap().

◆ linkage_evidences

TLinkageEvidenceVec CAgpRow::linkage_evidences

◆ m_agp_version

EAgpVersion CAgpRow::m_agp_version
private

◆ m_AgpErr

CRef<CAgpErr> CAgpRow::m_AgpErr
private

◆ m_reader

CAgpReader* CAgpRow::m_reader
private

Definition at line 303 of file agp_util.hpp.

Referenced by ParseGapCols().

◆ object_beg

TAgpPos CAgpRow::object_beg

◆ object_end

TAgpPos CAgpRow::object_end

◆ orientation

EOrientation CAgpRow::orientation

◆ part_number

TAgpPos CAgpRow::part_number

◆ pcomment

SIZE_TYPE CAgpRow::pcomment

The documentation for this class was generated from the following files:
Modified on Sat Dec 02 09:23:23 2023 by modify_doxy.py rev. 669887