NCBI C++ ToolKit
|
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>
Public Member Functions | |
virtual | ~CAgpRow () |
CRef< CAgpRow > | Clone (void) const |
int | FromString (const string &line) |
string | GetErrorMessage () |
string | ToString (bool reorder_linkage_evidences=false) |
string & | GetObject () |
string & | GetObjectBeg () |
string & | GetObjectEnd () |
string & | GetPartNumber () |
string & | GetComponentType () |
string & | GetComponentId () |
string & | GetComponentBeg () |
string & | GetComponentEnd () |
string & | GetOrientation () |
string & | GetGapLength () |
string & | GetGapType () |
string & | GetLinkage () |
string & | GetLinkageEvidence () |
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) |
CAgpErr * | GetErrorHandler () |
void | SetErrorHandler (CAgpErr *arg) |
EAgpVersion | GetVersion () |
![]() | |
CObject (void) | |
Constructor. More... | |
CObject (const CObject &src) | |
Copy constructor. More... | |
virtual | ~CObject (void) |
Destructor. More... | |
CObject & | operator= (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... | |
![]() | |
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 |
Public Attributes | |
SIZE_TYPE | pcomment |
vector< string > | cols |
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, EGap > | TMapStrEGap |
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) |
![]() | |
virtual void | DeleteThis (void) |
Virtual method "deleting" this object. More... | |
Static Protected Member Functions | |
static TMapStrEGap * | gap_type_codes_creator (void) |
Static Protected Attributes | |
static const TStr | gap_types [eGapCount] |
static CSafeStatic< TMapStrEGap > | gap_type_codes |
Private Attributes | |
EAgpVersion | m_agp_version |
CAgpReader * | m_reader |
CRef< CAgpErr > | m_AgpErr |
Additional Inherited Members | |
![]() | |
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... | |
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.
typedef vector<ELinkageEvidence> CAgpRow::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.
|
protected |
Definition at line 294 of file agp_util.hpp.
|
protected |
Definition at line 291 of file agp_util.hpp.
enum CAgpRow::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.
Definition at line 194 of file agp_util.hpp.
Enumerator | |
---|---|
eOrientationPlus | |
eOrientationMinus | |
eOrientationUnknown | |
eOrientationIrrelevant |
Definition at line 159 of file agp_util.hpp.
|
protected |
Definition at line 381 of file agp_util.cpp.
|
protected |
Definition at line 375 of file agp_util.cpp.
Definition at line 387 of file agp_util.cpp.
|
virtual |
Definition at line 394 of file agp_util.cpp.
|
static |
Definition at line 846 of file agp_util.cpp.
References CAgpErr::G_CompEndGtLength, i2s, and CAgpErr::Msg().
Referenced by CheckComponentEnd(), CAgpValidateReader::OnGapOrComponent(), CAltValidator::ProcessQueue(), and CAgpValidateApplication::x_ValidateFile().
Definition at line 262 of file agp_util.hpp.
References CheckComponentEnd(), component_end, GetComponentId(), and m_AgpErr.
Definition at line 103 of file agp_util.hpp.
References CAgpRow(), and Ref().
Referenced by CAgpCompSpanSplitter::SaveRow().
Definition at line 423 of file agp_util.cpp.
References cols, component_beg, component_end, component_type, CAgpErr::E_ColumnCount, CAgpErr::E_EmptyColumn, CAgpErr::E_EmptyLine, CAgpErr::E_InvalidValue, CAgpErr::E_MustBePositive, CAgpErr::E_ObjEndLtBeg, CAgpErr::E_ObjRangeNeComp, CAgpErr::E_ObjRangeNeGap, eAgpVersion_1_1, eAgpVersion_2_0, gap_length, GetComponentType(), GetObjectBeg(), GetObjectEnd(), GetPartNumber(), i, i2s, is_gap, m_agp_version, m_AgpErr, CAgpErr::Msg(), NcbiEmptyString, NPOS, object_beg, object_end, ParseComponentCols(), ParseGapCols(), part_number, pcomment, ReadSeqPos(), ncbi::grid::netcache::search::fields::size, NStr::Split(), CAgpErr::W_ExtraTab, CAgpErr::W_GapLineIgnoredCol9, CAgpErr::W_LooksLikeComp, and CAgpErr::W_LooksLikeGap.
Referenced by CAgpReader::ReadStream(), CAgpCompSpanSplitter::SaveRow(), and CAgpValidateApplication::x_ValidateFile().
|
staticprotected |
Definition at line 362 of file agp_util.cpp.
|
inline |
Definition at line 247 of file agp_util.hpp.
References eGapFragment, gap_type, and linkage.
Referenced by CAgpReader::Finalize(), CAgpValidateReader::OnGapOrComponent(), ParseGapCols(), and CAgpReader::ProcessThisRow().
Definition at line 311 of file agp_util.hpp.
References eGapCount, gap_types, i, and NcbiEmptyCStr.
Referenced by CAgpValidateReader::x_PrintGapCountsLine().
|
inline |
Definition at line 253 of file agp_util.hpp.
References gap_type.
Definition at line 230 of file agp_util.hpp.
References eGapCentromere, eGapContamination, eGapHeterochromatin, eGapShort_arm, eGapTelomere, and gap_type.
Referenced by CAgpReader::Finalize(), and CAgpReader::ProcessThisRow().
|
inline |
|
inline |
|
inline |
Definition at line 126 of file agp_util.hpp.
References cols.
Referenced by CheckComponentEnd(), CAgpValidateReader::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), CAgpValidateReader::OnScaffoldEnd(), ToString(), and CAgpValidateApplication::x_ValidateFile().
|
inline |
Definition at line 124 of file agp_util.hpp.
References cols.
Referenced by FromString(), and CAgpValidateReader::OnGapOrComponent().
|
inline |
string CAgpRow::GetErrorMessage | ( | ) |
Definition at line 836 of file agp_util.cpp.
References CAgpErr::GetErrorMessage(), and m_AgpErr.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 142 of file agp_util.hpp.
References cols, and NcbiEmptyString.
Referenced by ParseGapCols().
|
inline |
Definition at line 120 of file agp_util.hpp.
References cols.
Referenced by CAgpReader::Finalize(), CAgpValidateReader::OnGapOrComponent(), CAgpRenumber::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), CAgpValidateReader::OnObjectChange(), CAgpRenumber::OnObjectChange(), CAgpValidateReader::OnScaffoldEnd(), CAgpReader::ProcessThisRow(), CAgpCompSpanSplitter::SaveRow(), and ToString().
|
inline |
|
inline |
|
inline |
Definition at line 129 of file agp_util.hpp.
References cols, and NcbiEmptyString.
Referenced by ParseComponentCols().
|
inline |
|
inline |
Definition at line 317 of file agp_util.hpp.
References m_agp_version.
Referenced by CAgpCompSpanSplitter::SaveRow().
|
inline |
Definition at line 242 of file agp_util.hpp.
References component_type.
Definition at line 225 of file agp_util.hpp.
Referenced by CAgpValidateReader::OnGapOrComponent().
|
inline |
Definition at line 238 of file agp_util.hpp.
References is_gap.
Referenced by CAgpValidateReader::x_PrintTotals().
Definition at line 221 of file agp_util.hpp.
Referenced by CAgpValidateReader::OnGapOrComponent(), CAgpRenumber::OnGapOrComponent(), and CAgpValidateApplication::x_ValidateFile().
|
static |
Definition at line 864 of file agp_util.cpp.
References fLinkageEvidence_align_genus, fLinkageEvidence_align_trnscpt, fLinkageEvidence_align_xgenus, fLinkageEvidence_clone_contig, fLinkageEvidence_INVALID, fLinkageEvidence_map, fLinkageEvidence_na, fLinkageEvidence_paired_ends, fLinkageEvidence_pcr, fLinkageEvidence_proximity_ligation, fLinkageEvidence_strobe, fLinkageEvidence_unspecified, fLinkageEvidence_within_clone, le(), and NcbiEmptyCStr.
Referenced by LinkageEvidenceFlagsToString(), LinkageEvidencesToString(), and SubstOldGap().
|
inline |
Definition at line 270 of file agp_util.hpp.
References linkage_evidence_flags.
Referenced by ToString(), and CAgpValidateReader::x_PrintTotals().
Definition at line 886 of file agp_util.cpp.
References fLinkageEvidence_HIGHEST_BIT_MASK, le(), le_str(), and mask.
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().
|
inlinestatic |
Definition at line 90 of file agp_util.hpp.
References CAgpRow(), and Ref().
Referenced by CAgpReader::Init(), CAgpCompSpanSplitter::SaveRow(), and CAgpValidateApplication::x_ValidateFile().
|
inlinestatic |
Definition at line 97 of file agp_util.hpp.
string CAgpRow::OrientationToString | ( | EOrientation | orientation | ) |
Definition at line 916 of file agp_util.cpp.
References eAgpVersion_1_1, eOrientationIrrelevant, eOrientationMinus, eOrientationPlus, eOrientationUnknown, i2s, m_agp_version, and orientation.
Referenced by ToString().
Definition at line 602 of file agp_util.cpp.
References component_beg, component_end, CAgpErr::E_CompEndLtBeg, CAgpErr::E_InvalidValue, eAgpVersion_1_1, eAgpVersion_2_0, eOrientationIrrelevant, eOrientationMinus, eOrientationPlus, eOrientationUnknown, GetComponentBeg(), GetComponentEnd(), GetOrientation(), m_agp_version, m_AgpErr, CAgpErr::Msg(), orientation, ReadSeqPos(), ncbi::grid::netcache::search::fields::size, and CAgpErr::W_OrientationZeroDeprecated.
Referenced by FromString().
Definition at line 670 of file agp_util.cpp.
References component_type, CAgpErr::E_InvalidLinkage, CAgpErr::E_InvalidValue, eAgpVersion_1_1, eAgpVersion_2_0, eAgpVersion_auto, eGapClone, eGapContamination, eGapFragment, eGapRepeat, eGapScaffold, fLinkageEvidence_INVALID, fLinkageEvidence_na, fLinkageEvidence_unspecified, gap_length, gap_type, gap_type_codes, GapEndsScaffold(), GetGapLength(), GetGapType(), GetLinkage(), GetLinkageEvidence(), ITERATE, linkage, linkage_evidence_flags, linkage_evidences, m_agp_version, m_AgpErr, m_reader, CAgpErr::Msg(), ReadSeqPos(), CAgpReader::SetVersion(), ncbi::grid::netcache::search::fields::size, NStr::Split(), str_to_le(), SubstOldGap(), CAgpErr::W_AssumingVersion, CAgpErr::W_DuplicateEvidence, CAgpErr::W_GapSizeNot100, CAgpErr::W_MissingLinkage, CAgpErr::W_NaLinkageExpected, and CAgpErr::W_OldGapType.
Referenced by FromString().
|
protected |
Definition at line 398 of file agp_util.cpp.
References CAgpErr::E_MustBePositive, CAgpErr::E_MustFitSeqPosType, NStr::fConvErr_NoThrow, m_AgpErr, max(), CAgpErr::Msg(), and NStr::StringToInt8().
Referenced by FromString(), ParseComponentCols(), and ParseGapCols().
void CAgpRow::SetErrorHandler | ( | CAgpErr * | arg | ) |
Definition at line 841 of file agp_util.cpp.
References m_AgpErr.
Referenced by CAgpReader::SetErrorHandler().
|
virtual |
Definition at line 962 of file agp_util.cpp.
References m_agp_version.
Referenced by CAgpReader::SetVersion(), and CAgpReader::x_CheckPragmaComment().
Definition at line 653 of file agp_util.cpp.
References fLinkageEvidence_align_genus, fLinkageEvidence_align_trnscpt, fLinkageEvidence_align_xgenus, fLinkageEvidence_clone_contig, fLinkageEvidence_INVALID, fLinkageEvidence_map, fLinkageEvidence_paired_ends, fLinkageEvidence_pcr, fLinkageEvidence_proximity_ligation, fLinkageEvidence_strobe, fLinkageEvidence_unspecified, fLinkageEvidence_within_clone, and str().
Referenced by ParseGapCols().
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().
Definition at line 805 of file agp_util.cpp.
References component_beg, component_end, component_type, eAgpVersion_1_1, gap_length, gap_type, gap_types, GetComponentId(), GetObject(), i2s, is_gap, linkage, LinkageEvidenceFlagsToString(), LinkageEvidencesToString(), m_agp_version, object_beg, object_end, orientation, OrientationToString(), and part_number.
Referenced by CAgpReader::GetErrorMessage(), CAgpRenumber::OnGapOrComponent(), and CAgpCompSpanSplitter::SaveRow().
vector<string> CAgpRow::cols |
Definition at line 118 of file agp_util.hpp.
Referenced by FromString(), GetComponentBeg(), GetComponentEnd(), GetComponentId(), GetComponentType(), GetGapLength(), GetGapType(), GetLinkage(), GetLinkageEvidence(), GetObject(), GetObjectBeg(), GetObjectEnd(), GetOrientation(), GetPartNumber(), and CAgpReader::ReadStream().
TAgpPos CAgpRow::component_beg |
Definition at line 158 of file agp_util.hpp.
Referenced by FromString(), CCompVal::init(), CAgpValidateReader::OnGapOrComponent(), CAgpRenumber::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), ParseComponentCols(), CAgpCompSpanSplitter::SaveRow(), and ToString().
TAgpPos CAgpRow::component_end |
Definition at line 158 of file agp_util.hpp.
Referenced by CheckComponentEnd(), FromString(), CCompVal::init(), CAgpValidateReader::OnGapOrComponent(), CAgpRenumber::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), ParseComponentCols(), CAgpCompSpanSplitter::SaveRow(), ToString(), and CAgpValidateApplication::x_ValidateFile().
char CAgpRow::component_type |
Definition at line 154 of file agp_util.hpp.
Referenced by FromString(), IsDraftComponent(), CAgpValidateReader::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), ParseGapCols(), and ToString().
TAgpLen CAgpRow::gap_length |
Definition at line 173 of file agp_util.hpp.
Referenced by FromString(), CAgpValidateReader::OnGapOrComponent(), CAgpRenumber::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), ParseGapCols(), CAgpCompSpanSplitter::SaveRow(), and ToString().
EGap CAgpRow::gap_type |
Definition at line 191 of file agp_util.hpp.
Referenced by GapEndsScaffold(), GapValidAtObjectEnd(), CAgpValidateReader::OnGapOrComponent(), ParseGapCols(), CAgpReader::ProcessThisRow(), CAgpReader::ReadStream(), SubstOldGap(), ToString(), and CAgpToSeqEntry::x_SetSeqGap().
|
staticprotected |
Definition at line 295 of file agp_util.hpp.
Referenced by ParseGapCols().
|
staticprotected |
Definition at line 292 of file agp_util.hpp.
Referenced by GapTypeToString(), and ToString().
bool CAgpRow::is_gap |
Definition at line 156 of file agp_util.hpp.
Referenced by CAgpReader::Finalize(), FromString(), IsGap(), CAgpToSeqEntry::OnGapOrComponent(), CAgpReader::ProcessThisRow(), CAgpReader::ReadStream(), and ToString().
bool CAgpRow::linkage |
Definition at line 192 of file agp_util.hpp.
Referenced by GapEndsScaffold(), LinkageEvidencesToString(), CAgpValidateReader::OnGapOrComponent(), ParseGapCols(), CAgpReader::ProcessThisRow(), CAgpReader::ReadStream(), SubstOldGap(), ToString(), and CAgpToSeqEntry::x_SetSeqGap().
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().
TLinkageEvidenceVec CAgpRow::linkage_evidences |
Definition at line 216 of file agp_util.hpp.
Referenced by LinkageEvidencesToString(), ParseGapCols(), SubstOldGap(), and CAgpToSeqEntry::x_SetSeqGap().
|
private |
Definition at line 300 of file agp_util.hpp.
Referenced by FromString(), GetVersion(), OrientationToString(), ParseComponentCols(), ParseGapCols(), SetVersion(), and ToString().
Definition at line 305 of file agp_util.hpp.
Referenced by CheckComponentEnd(), FromString(), GetErrorHandler(), GetErrorMessage(), ParseComponentCols(), ParseGapCols(), ReadSeqPos(), and SetErrorHandler().
|
private |
Definition at line 303 of file agp_util.hpp.
Referenced by ParseGapCols().
TAgpPos CAgpRow::object_beg |
Definition at line 153 of file agp_util.hpp.
Referenced by FromString(), CAgpValidateReader::OnGapOrComponent(), CAgpReader::ProcessThisRow(), CAgpCompSpanSplitter::SaveRow(), and ToString().
TAgpPos CAgpRow::object_end |
Definition at line 153 of file agp_util.hpp.
Referenced by FromString(), CAgpValidateReader::OnObjectChange(), CAgpReader::ProcessThisRow(), CAgpCompSpanSplitter::SaveRow(), and ToString().
EOrientation CAgpRow::orientation |
Definition at line 171 of file agp_util.hpp.
Referenced by CCompVal::init(), CAgpValidateReader::OnGapOrComponent(), CAgpToSeqEntry::OnGapOrComponent(), OrientationToString(), ParseComponentCols(), and ToString().
TAgpPos CAgpRow::part_number |
Definition at line 153 of file agp_util.hpp.
Referenced by FromString(), CAgpReader::ProcessThisRow(), CAgpCompSpanSplitter::SaveRow(), and ToString().
SIZE_TYPE CAgpRow::pcomment |
Definition at line 117 of file agp_util.hpp.
Referenced by FromString(), CAgpValidateReader::OnError(), CAgpValidateReader::OnGapOrComponent(), and CAgpRenumber::OnGapOrComponent().