NCBI C++ ToolKit
Static Public Member Functions | Static Public Attributes | List of all members
CReadUtil Class Reference

Search Toolkit Book for CReadUtil

Common file reader utility functions. More...

#include <objtools/readers/read_util.hpp>

+ Collaboration diagram for CReadUtil:

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_idAsSeqId (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
 

Detailed Description

Common file reader utility functions.

Definition at line 45 of file read_util.hpp.

Member Function Documentation

◆ AddGeneOntologyTerm()

void CReadUtil::AddGeneOntologyTerm ( CSeq_feat feature,
const CTempString qual,
const CTempString val 
)
static

◆ AsSeqId()

CRef< CSeq_id > CReadUtil::AsSeqId ( const string rawId,
long  flags = 0,
bool  localInts = true 
)
static

◆ GetTrackAssembly()

bool CReadUtil::GetTrackAssembly ( const CSeq_annot annot,
string value 
)
static

Definition at line 151 of file read_util.cpp.

References GetTrackValue(), and rapidjson::value.

◆ GetTrackName()

bool CReadUtil::GetTrackName ( const CSeq_annot annot,
string 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.

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

◆ GetTrackOffset()

bool CReadUtil::GetTrackOffset ( const CSeq_annot annot,
int value 
)
static

Definition at line 160 of file read_util.cpp.

References GetTrackValue(), offset, NStr::StringToInt(), and rapidjson::value.

◆ GetTrackValue()

bool CReadUtil::GetTrackValue ( const CSeq_annot annot,
const string key,
string value 
)
static

◆ Tokenize()

void CReadUtil::Tokenize ( const string instr,
const string delim,
vector< string > &  tokens 
)
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().

Member Data Documentation

◆ kMinNumericGi

const TGi CReadUtil::kMinNumericGi
static

Definition at line 67 of file read_util.hpp.


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