NCBI C++ ToolKit
|
Search Toolkit Book for CWiggleReader
#include <objtools/readers/wiggle_reader.hpp>
Public Types | |
enum | EWiggleFlags { fDefaults = 0 , fJoinSame = 1<<8 , fAsByte = 1<<9 , fAsGraph = 1<<10 , fDumpStats = 1<<11 , fAsRaw = 1<<12 } |
typedef vector< SValueInfo > | TValues |
typedef int | TFlags |
Public Types inherited from CReaderBase | |
enum | EFlags { fNormal = 0 , fNumericIdsAsLocal = 1<<0 , fAllIdsAsLocal = 1<<1 , fNextInLine = 1<<2 , fAsRaw = 1<<3 } |
Customization flags that are relevant to all CReaderBase derived readers. More... | |
enum | ObjectType { OT_UNKNOWN , OT_SEQANNOT , OT_SEQENTRY } |
using | TReaderLine = struct SReaderLine { SReaderLine(unsigned int line, string data):mLine(line), mData(data) {} |
using | TReaderData = vector< TReaderLine > |
using | TReaderFlags = long |
typedef list< CRef< CSeq_annot > > | TAnnotList |
typedef TAnnotList | TAnnots |
typedef TAnnots::iterator | TAnnotIt |
typedef TAnnots::const_iterator | TAnnotCit |
using | SeqIdResolver = CRef< CSeq_id >(*)(const string &, long, bool) |
Public Member Functions | |
CWiggleReader (int=fDefaults, const string &="", const string &="", CReaderListener *=nullptr) | |
virtual | ~CWiggleReader () |
CRef< CSeq_annot > | ReadSeqAnnot (ILineReader &, ILineErrorListener *=nullptr) override |
Read an object from a given line reader, render it as a single Seq-annot, if possible. More... | |
virtual bool | ReadTrackData (ILineReader &, CRawWiggleTrack &, ILineErrorListener *=nullptr) |
Public Member Functions inherited from CReaderBase | |
virtual | ~CReaderBase () |
virtual CRef< CSerialObject > | ReadObject (CNcbiIstream &istr, ILineErrorListener *pErrors=nullptr) |
Read an object from a given input stream, render it as the most appropriate Genbank object. More... | |
virtual CRef< CSerialObject > | ReadObject (ILineReader &lr, ILineErrorListener *pErrors=nullptr) |
Read an object from a given line reader, render it as the most appropriate Genbank object. More... | |
virtual CRef< CSeq_annot > | ReadSeqAnnot (CNcbiIstream &istr, ILineErrorListener *pErrors=nullptr) |
Read an object from a given input stream, render it as a single Seq-annot. More... | |
virtual void | ReadSeqAnnots (TAnnots &annots, CNcbiIstream &istr, ILineErrorListener *pErrors=nullptr) |
Read all objects from given insput stream, returning them as a vector of Seq-annots. More... | |
virtual void | ReadSeqAnnots (TAnnots &annots, ILineReader &lr, ILineErrorListener *pErrors=nullptr) |
Read all objects from given insput stream, returning them as a vector of Seq-annots. More... | |
virtual CRef< CSeq_entry > | ReadSeqEntry (CNcbiIstream &istr, ILineErrorListener *pErrors=nullptr) |
Read an object from a given input stream, render it as a single Seq-entry, if possible. More... | |
virtual CRef< CSeq_entry > | ReadSeqEntry (ILineReader &lr, ILineErrorListener *pErrors=nullptr) |
Read an object from a given line reader, render it as a single Seq-entry, if possible. More... | |
void | SetProgressReportInterval (unsigned int intv) |
void | SetCanceler (ICanceled *=nullptr) |
bool | IsCanceled () const |
Protected Types | |
enum | ETrackType { eTrackType_invalid , eTrackType_wiggle_0 , eTrackType_bedGraph } |
Protected Attributes | |
string | m_ChromId |
TValues | m_Values |
double | m_GapValue |
bool | m_SingleAnnot |
bool | m_OmitZeros |
ETrackType | m_TrackType |
CRef< CSeq_annot > | m_Annot |
Protected Attributes inherited from CReaderBase | |
unsigned int | m_uLineNumber |
unsigned int | m_uDataCount = 0 |
unsigned int | m_uProgressReportInterval |
unsigned int | m_uNextProgressReport |
TReaderFlags | m_iFlags |
string | m_AnnotName |
string | m_AnnotTitle |
string | m_PendingLine |
unique_ptr< CTrackData > | m_pTrackDefaults |
ILineReader * | m_pReader |
ICanceled * | m_pCanceler |
SeqIdResolver | mSeqIdResolve |
unique_ptr< CReaderMessageHandler > | m_pMessageHandler |
Additional Inherited Members | |
Static Public Member Functions inherited from CReaderBase | |
static CReaderBase * | GetReader (CFormatGuess::EFormat format, TReaderFlags flags=0, CReaderListener *=nullptr) |
Allocate a CReaderBase derived reader object based on the given file format. More... | |
Public Attributes inherited from CReaderBase | |
unsigned int | mLine |
string | mData |
Static Protected Member Functions inherited from CReaderBase | |
static void | xAddStringFlagsWithMap (const list< string > &stringFlags, const map< string, TReaderFlags > flagMap, TReaderFlags &baseFlags) |
Definition at line 238 of file wiggle_reader.hpp.
typedef int CWiggleReader::TFlags |
Definition at line 266 of file wiggle_reader.hpp.
typedef vector<SValueInfo> CWiggleReader::TValues |
Definition at line 243 of file wiggle_reader.hpp.
|
protected |
Enumerator | |
---|---|
eTrackType_invalid | |
eTrackType_wiggle_0 | |
eTrackType_bedGraph |
Definition at line 435 of file wiggle_reader.hpp.
Enumerator | |
---|---|
fDefaults | |
fJoinSame | |
fAsByte | |
fAsGraph | |
fDumpStats | |
fAsRaw |
Definition at line 258 of file wiggle_reader.hpp.
CWiggleReader::CWiggleReader | ( | int | iFlags = fDefaults , |
const string & | name = "" , |
||
const string & | title = "" , |
||
CReaderListener * | pRl = nullptr |
||
) |
Definition at line 70 of file wiggle_reader.cpp.
References m_GapValue, and CReaderBase::m_uLineNumber.
|
virtual |
Definition at line 85 of file wiggle_reader.cpp.
|
overridevirtual |
Read an object from a given line reader, render it as a single Seq-annot, if possible.
Return empty Seq-annot otherwise.
lr | line reader to read from. |
pErrors | pointer to optional error container object. |
Reimplemented from CReaderBase.
Definition at line 92 of file wiggle_reader.cpp.
References fAsGraph, lr(), m_ChromId, CReaderBase::m_iFlags, CReaderBase::m_uDataCount, m_Values, CRef< C, Locker >::Reset(), CReaderBase::xCreateSeqAnnot(), CReaderBase::xGuardedGetData(), CReaderBase::xGuardedProcessData(), xParseTrackLine(), xPostProcessAnnot(), and CReaderBase::xProgressInit().
|
virtual |
Definition at line 182 of file wiggle_reader.cpp.
References lr(), NStr::StartsWith(), xGetFixedStepInfo(), xGetVariableStepInfo(), CReaderBase::xGuardedGetData(), xReadFixedStepDataRaw(), and xReadVariableStepDataRaw().
Referenced by sRunTest(), sUpdateCase(), and CMultiReaderApp::xProcessWiggleRaw().
|
inlineprotected |
Definition at line 399 of file wiggle_reader.hpp.
References m_OmitZeros, m_Values, and rapidjson::value.
Referenced by xProcessBedData(), xReadFixedStepData(), and xReadVariableStepData().
|
protected |
Definition at line 783 of file wiggle_reader.cpp.
References fAsGraph, m_Annot, m_ChromId, CReaderBase::m_iFlags, CSeq_annot_Base::SetData(), CReaderBase::xCreateSeqAnnot(), xMakeGraph(), and xMakeTable().
Referenced by xSetChrom().
|
protected |
Definition at line 267 of file wiggle_reader.cpp.
Referenced by xPreprocessValues().
|
overrideprotectedvirtual |
Reimplemented from CReaderBase.
Definition at line 123 of file wiggle_reader.cpp.
References lr(), CReaderBase::m_uDataCount, CReaderBase::m_uLineNumber, NStr::StartsWith(), CReaderBase::xGetLine(), CReaderBase::xIsBrowserLine(), CReaderBase::xIsTrackLine(), and CReaderBase::xUngetLine().
|
inlineprotected |
Definition at line 736 of file wiggle_reader.cpp.
References eDiag_Error, CReaderBase::m_uLineNumber, and xTryGetDoubleSimple().
Referenced by xProcessBedData(), xReadFixedStepData(), xReadFixedStepDataRaw(), xReadVariableStepData(), and xReadVariableStepDataRaw().
|
protected |
Definition at line 892 of file wiggle_reader.cpp.
References eDiag_Error, eDiag_Warning, eTrackType_invalid, eTrackType_wiggle_0, CReaderBase::m_pMessageHandler, m_TrackType, CReaderBase::m_uLineNumber, SFixedStepInfo::mChrom, SFixedStepInfo::mSpan, SFixedStepInfo::mStart, SFixedStepInfo::mStep, SFixedStepInfo::Reset(), NStr::StringToUInt(), NStr::TruncateSpacesInPlace(), rapidjson::value, xGetParamName(), xGetParamValue(), and xSkipWS().
Referenced by ReadTrackData(), and xProcessFixedStepData().
Definition at line 591 of file wiggle_reader.cpp.
References eDiag_Error, len, and CReaderBase::m_uLineNumber.
Referenced by xGetFixedStepInfo(), and xGetVariableStepInfo().
Definition at line 615 of file wiggle_reader.cpp.
References eDiag_Error, len, CReaderBase::m_uLineNumber, rapidjson::value, and xGetWord().
Referenced by xGetFixedStepInfo(), and xGetVariableStepInfo().
Definition at line 640 of file wiggle_reader.cpp.
References eDiag_Error, and CReaderBase::m_uLineNumber.
Referenced by xProcessBedData(), xReadVariableStepData(), and xReadVariableStepDataRaw().
|
protected |
Definition at line 985 of file wiggle_reader.cpp.
References eDiag_Error, eDiag_Warning, eTrackType_invalid, eTrackType_wiggle_0, CReaderBase::m_pMessageHandler, m_TrackType, CReaderBase::m_uLineNumber, SVarStepInfo::mChrom, SVarStepInfo::mSpan, SVarStepInfo::Reset(), NStr::StringToUInt(), rapidjson::value, xGetParamName(), xGetParamValue(), and xSkipWS().
Referenced by ReadTrackData(), and xProcessVariableStepData().
Definition at line 567 of file wiggle_reader.cpp.
References eDiag_Error, len, and CReaderBase::m_uLineNumber.
Referenced by xGetParamValue(), and xProcessBedData().
Definition at line 354 of file wiggle_reader.cpp.
References CReadUtil::AsSeqId(), m_ChromId, and CReaderBase::m_iFlags.
Referenced by xMakeGraph(), and xMakeTable().
|
protected |
Definition at line 494 of file wiggle_reader.cpp.
References _ASSERT, SWiggleStat::AsByte(), i, ITERATE, SWiggleStat::m_FixedSpan, m_GapValue, SWiggleStat::m_Max, SWiggleStat::m_Min, CReaderBase::m_pTrackDefaults, SWiggleStat::m_Span, SWiggleStat::m_Step, m_Values, CSeq_graph_Base::SetA(), CByte_graph_Base::SetAxis(), CSeq_graph_Base::SetB(), CSeq_graph_Base::SetComp(), CSeq_graph_Base::SetGraph(), CSeq_graph_Base::SetLoc(), CByte_graph_Base::SetMax(), CByte_graph_Base::SetMin(), CSeq_graph_Base::SetNumval(), CSeq_graph_Base::SetTitle(), CByte_graph_Base::SetValues(), ncbi::grid::netcache::search::fields::size, xMakeChromId(), xPreprocessValues(), and xSetTotalLoc().
Referenced by xDumpChromValues(), and xPostProcessAnnot().
|
protected |
Definition at line 378 of file wiggle_reader.cpp.
References SWiggleStat::AsByte(), CReadUtil::AsSeqId(), CSeqTable_column_info_Base::eField_id_location_from, CSeqTable_column_info_Base::eField_id_location_id, fAsByte, ITERATE, SWiggleStat::m_FixedSpan, m_GapValue, SWiggleStat::m_HaveGaps, CReaderBase::m_iFlags, SWiggleStat::m_Min, SWiggleStat::m_Span, SWiggleStat::m_Step, m_Values, CSeqTable_column_Base::SetData(), CSeqTable_column_Base::SetDefault(), CSeqTable_column_Base::SetHeader(), ncbi::grid::netcache::search::fields::size, table, xMakeChromId(), xPreprocessValues(), xSetTotalLoc(), and xValuesAreFromSingleSequence().
Referenced by xDumpChromValues(), and xPostProcessAnnot().
|
overrideprotectedvirtual |
Reimplemented from CReaderBase.
Definition at line 815 of file wiggle_reader.cpp.
References NStr::StartsWith().
Referenced by xProcessData().
Reimplemented from CReaderBase.
Definition at line 827 of file wiggle_reader.cpp.
References eDiag_Error, eTrackType_bedGraph, eTrackType_invalid, eTrackType_wiggle_0, CReaderBase::m_pTrackDefaults, m_TrackType, CReaderBase::m_uLineNumber, CReaderBase::xIsTrackLine(), and CReaderBase::xParseTrackLine().
Referenced by ReadSeqAnnot(), and xProcessData().
|
overrideprotectedvirtual |
Reimplemented from CReaderBase.
Definition at line 763 of file wiggle_reader.cpp.
References CSeq_annot_Base::C_Data::e_not_set, fAsGraph, CSeq_annot_Base::GetData(), m_ChromId, CReaderBase::m_iFlags, CSeq_annot_Base::SetData(), CSeq_annot_Base::C_Data::Which(), CReaderBase::xAssignTrackData(), xMakeGraph(), and xMakeTable().
Referenced by ReadSeqAnnot().
|
protected |
Definition at line 279 of file wiggle_reader.cpp.
References SWiggleStat::AddSpan(), SWiggleStat::AddValue(), fAsGraph, fJoinSame, i, LOG_POST, SWiggleStat::m_FixedSpan, m_GapValue, SWiggleStat::m_HaveGaps, CReaderBase::m_iFlags, SWiggleStat::m_IntValues, SWiggleStat::m_Max, SWiggleStat::m_Min, SWiggleStat::m_Span, SWiggleStat::m_Step, SWiggleStat::m_StepMul, m_Values, compile_time_bits::range(), SWiggleStat::SetFirstSpan(), SWiggleStat::SetFirstValue(), ncbi::grid::netcache::search::fields::size, ct::sort(), and xEstimateSize().
Referenced by xMakeGraph(), and xMakeTable().
|
protected |
Definition at line 1051 of file wiggle_reader.cpp.
References rapidjson::value, xAddValue(), xGetDouble(), xGetPos(), xGetWord(), xSetChrom(), and xSkipWS().
Referenced by xProcessData().
|
overrideprotectedvirtual |
Reimplemented from CReaderBase.
Definition at line 154 of file wiggle_reader.cpp.
References xParseBrowserLine(), xParseTrackLine(), xProcessBedData(), xProcessFixedStepData(), and xProcessVariableStepData().
|
protected |
Definition at line 853 of file wiggle_reader.cpp.
References NStr::StartsWith(), xGetFixedStepInfo(), and xReadFixedStepData().
Referenced by xProcessData().
|
protected |
Definition at line 873 of file wiggle_reader.cpp.
References NStr::StartsWith(), xGetVariableStepInfo(), and xReadVariableStepData().
Referenced by xProcessData().
|
protected |
Definition at line 964 of file wiggle_reader.cpp.
References SFixedStepInfo::mChrom, SFixedStepInfo::mSpan, SFixedStepInfo::mStart, SFixedStepInfo::mStep, rapidjson::value, xAddValue(), xGetDouble(), and xSetChrom().
Referenced by xProcessFixedStepData().
|
protected |
Definition at line 212 of file wiggle_reader.cpp.
References CRawWiggleTrack::AddRecord(), CReadUtil::AsSeqId(), CRawWiggleTrack::HasData(), CReaderBase::m_iFlags, SFixedStepInfo::mChrom, SFixedStepInfo::mSpan, SFixedStepInfo::mStart, SFixedStepInfo::mStep, CRawWiggleTrack::Reset(), rapidjson::value, and xGetDouble().
Referenced by ReadTrackData().
|
protected |
Definition at line 1029 of file wiggle_reader.cpp.
References SVarStepInfo::mChrom, SVarStepInfo::mSpan, rapidjson::value, xAddValue(), xGetDouble(), xGetPos(), xSetChrom(), and xSkipWS().
Referenced by xProcessVariableStepData().
|
protected |
Definition at line 239 of file wiggle_reader.cpp.
References CRawWiggleTrack::AddRecord(), CReadUtil::AsSeqId(), CRawWiggleTrack::HasData(), CReaderBase::m_iFlags, SVarStepInfo::mChrom, SVarStepInfo::mSpan, CRawWiggleTrack::Reset(), rapidjson::value, xGetDouble(), xGetPos(), and xSkipWS().
Referenced by ReadTrackData().
Definition at line 801 of file wiggle_reader.cpp.
References fAsGraph, m_ChromId, CReaderBase::m_iFlags, m_Values, and xDumpChromValues().
Referenced by xProcessBedData(), xReadFixedStepData(), and xReadVariableStepData().
Definition at line 363 of file wiggle_reader.cpp.
References m_Values, CSeq_loc::SetEmpty(), CSeq_interval_Base::SetFrom(), CSeq_interval_Base::SetId(), CSeq_loc::SetInt(), and CSeq_interval_Base::SetTo().
Referenced by xMakeGraph(), and xMakeTable().
Definition at line 550 of file wiggle_reader.cpp.
References len.
Referenced by xGetFixedStepInfo(), xGetVariableStepInfo(), xProcessBedData(), xReadVariableStepData(), and xReadVariableStepDataRaw().
Definition at line 673 of file wiggle_reader.cpp.
Referenced by xGetDouble().
|
protected |
Definition at line 53 of file wiggle_reader.cpp.
References first(), and m_Values.
Referenced by xMakeTable().
|
protected |
Definition at line 441 of file wiggle_reader.hpp.
Referenced by xDumpChromValues().
|
protected |
Definition at line 429 of file wiggle_reader.hpp.
Referenced by ReadSeqAnnot(), xDumpChromValues(), xMakeChromId(), xPostProcessAnnot(), and xSetChrom().
|
protected |
Definition at line 431 of file wiggle_reader.hpp.
Referenced by CWiggleReader(), xMakeGraph(), xMakeTable(), and xPreprocessValues().
|
protected |
Definition at line 433 of file wiggle_reader.hpp.
Referenced by xAddValue().
|
protected |
Definition at line 432 of file wiggle_reader.hpp.
|
protected |
Definition at line 440 of file wiggle_reader.hpp.
Referenced by xGetFixedStepInfo(), xGetVariableStepInfo(), and xParseTrackLine().
|
protected |
Definition at line 430 of file wiggle_reader.hpp.
Referenced by ReadSeqAnnot(), xAddValue(), xMakeGraph(), xMakeTable(), xPreprocessValues(), xSetChrom(), xSetTotalLoc(), and xValuesAreFromSingleSequence().