NCBI C++ ToolKit
|
Search Toolkit Book for CReadUtil
Common file reader utility functions. More...
#include <objtools/readers/read_util.hpp>
Static Public Member Functions | |
static void | Tokenize (const string &instr, const string &delim, vector< string > &tokens) |
Tokenize a given string, respecting quoted substrings an atomic units. More... | |
static CRef< CSeq_id > | AsSeqId (const string &rawId, long flags=0, bool localInts=true) |
Convert a raw ID string to a Seq-id, based in given customization flags. More... | |
static bool | GetTrackName (const CSeq_annot &annot, string &value) |
Extract track information that should be present if the data originated from a UCSC data file. More... | |
static bool | GetTrackAssembly (const CSeq_annot &annot, string &value) |
static bool | GetTrackOffset (const CSeq_annot &annot, int &value) |
static bool | GetTrackValue (const CSeq_annot &annot, const string &key, string &value) |
static void | AddGeneOntologyTerm (CSeq_feat &feature, const CTempString &qual, const CTempString &val) |
Static Public Attributes | |
static const TGi | kMinNumericGi |
Common file reader utility functions.
Definition at line 45 of file read_util.hpp.
|
static |
Definition at line 296 of file read_util.cpp.
References CUtf8::AsUTF8(), CTempString::Copy(), CLineError::Create(), eDiag_Error, eEncoding_Ascii, CTempString::empty(), ILineError::eProblem_InvalidQualifier, NStr::EqualNocase(), NStr::IsBlank(), label, CTempString::npos, CUser_field_Base::SetData(), CSeq_feat_Base::SetExt(), CUser_field_Base::SetLabel(), sParseGeneOntologyTerm(), NStr::StringToInt(), toupper(), and val.
Referenced by CFeatureTableReader_Imp::x_AddQualifierToFeature(), CNewCleanup_imp::x_ConvertGoQualifiers(), and CGff2Record::xMigrateAttributesGo().
|
static |
Convert a raw ID string to a Seq-id, based in given customization flags.
Recognized flags are: CReaderBase::fAllIdsAsLocal, CReaderBase::fNumericalIdsAsLocal By default, numerical IDs below 500 are recognized as local IDs, and 500 and above are considered GI numbers.
Definition at line 89 of file read_util.cpp.
References CSeq_id_Base::e_Local, NStr::eUrlDec_Percent, CReaderBase::fAllIdsAsLocal, flags, CReaderBase::fNumericIdsAsLocal, CSeq_id_Base::GetGi(), GI_CONST, CSeq_id_Base::IsGi(), CRef< C, Locker >::Reset(), CObject_id_Base::SetId(), CSeq_id_Base::SetLocal(), CObject_id_Base::SetStr(), NStr::StringToInt(), and NStr::URLDecode().
Referenced by CGffBaseColumns::GetSeqId(), CAutoSqlStandardFields::SetLocation(), CUCSCRegionReader::x_SetFeatureLocation(), CVcfReader::xAssignFeatureLocationSet(), CWiggleReader::xMakeChromId(), CWiggleReader::xMakeTable(), CMultiReaderApp::xProcessGff3(), CBedReader::xReadBedRecordRaw(), CWiggleReader::xReadFixedStepDataRaw(), CMultiReader::xReadGFF3(), CWiggleReader::xReadVariableStepDataRaw(), CBedReader::xSetFeatureLocation(), CBedReader::xSetFeatureLocationBlock(), CBedReader::xSetFeatureLocationCds(), CBedReader::xSetFeatureLocationRna(), and CBedReader::xSetFeatureLocationThick().
|
static |
Definition at line 151 of file read_util.cpp.
References GetTrackValue(), and rapidjson::value.
|
static |
Extract track information that should be present if the data originated from a UCSC data file.
"name" and "db" have their designated accessors to recognize their special importance. The third variant can be used to access arbitrary track values.
annot | true if the requested information os available and the value parameter is good to use. false otherwise. |
Definition at line 142 of file read_util.cpp.
References GetTrackValue(), and rapidjson::value.
|
static |
Definition at line 160 of file read_util.cpp.
References GetTrackValue(), offset, NStr::StringToInt(), and rapidjson::value.
|
static |
Definition at line 176 of file read_util.cpp.
References CAnnot_descr_Base::Get(), CUser_field_Base::GetData(), CUser_object_Base::GetData(), CSeq_annot_Base::GetDesc(), CUser_field_Base::GetLabel(), CObject_id_Base::GetStr(), CUser_field_Base::C_Data::GetStr(), CUser_object_Base::GetType(), CAnnotdesc_Base::GetUser(), CUser_field_Base::IsSetData(), CUser_object_Base::IsSetData(), CSeq_annot_Base::IsSetDesc(), CUser_field_Base::IsSetLabel(), CUser_object_Base::IsSetType(), CObject_id_Base::IsStr(), CUser_field_Base::C_Data::IsStr(), CAnnotdesc_Base::IsUser(), ncbi::grid::netcache::search::fields::key, and rapidjson::value.
Referenced by GetTrackAssembly(), GetTrackName(), and GetTrackOffset().
|
static |
Tokenize a given string, respecting quoted substrings an atomic units.
Definition at line 47 of file read_util.cpp.
References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, i, NStr::Split(), and str().
Referenced by CReaderBase::xParseTrackLine(), CBedReader::xParseTrackLine(), and CVcfReader::xProcessTrackLine().
Definition at line 67 of file read_util.hpp.