41 #define STAT_ALGO_VER_MAJOR 1
42 #define STAT_ALGO_VER_MINOR 0
43 #define STAT_ALGO_VER_PATCH 0
47 "windowmasker-statistics-algorithm-version";
52 STAT_ALGO_COMPONENT_NAME,
70 std::ostringstream os;
73 <<
"t_low=" << t_low <<
' ' <<
"t_high=" << t_high;
99 std::ostringstream oss;
102 th_formatted = oss.str();
103 sz += th_formatted.size() + 1;
107 os.write( (
char *)&sz,
sizeof( sz ) );
108 os.write( s1.c_str(), s1.size() );
109 os.write( &zero, 1 );
110 os.write( s2.c_str(), s2.size() );
111 os.write( &zero, 1 );
112 os.write( s3.c_str(), s3.size() );
113 os.write( &zero, 1 );
116 os.write( s4.c_str(), s4.size() );
117 os.write( &zero, 1 );
120 if( !th_formatted.empty() )
122 os.write( th_formatted.c_str(), th_formatted.size() );
123 os.write( &zero, 1 );
129 std::ostringstream os;
139 os <<
"##pct: " <<
i <<
' ' <<
count_map[
i] << endl;
152 ostr <<
"can not set unit size in state " <<
state;
167 ostr <<
"can not set unit count data in state " <<
state;
182 ostr <<
"can not set masking parameters in state " <<
state;
197 ostr <<
"can not finalize data structure in state " <<
state;
CNcbiOstrstreamToString class helps convert CNcbiOstrstream to a string Sample usage:
Exceptions that CSeqMaskerOstat can throw.
virtual const char * GetErrCodeString() const override
Get a description string for this exception.
@ eBadState
Operation can not be performed in the current state.
static CSeqMaskerVersion StatAlgoVersion
Version of the statistics generation algorithm.
static char const * STAT_ALGO_COMPONENT_NAME
virtual CSeqMaskerVersion const & GetStatFmtVersion() const =0
Get actual counts format version.
std::vector< double > count_map
string FormatParameters() const
Format algorithm parameters into a string.
enum CSeqMaskerOstat::@33 state
string metadata
metadata string
virtual void doSetUnitSize(Uint4 us)
Uint4 max_count
information about counts and corresponding pct cutoffs
void setUnitCount(Uint4 unit, Uint4 count)
Add count value for a particular unit.
void WriteBinMetaData(std::ostream &os) const
Write metadata in binary format.
CSeqMaskerVersion fmt_gen_algo_ver
version of the algorithm used to generate counts
void finalize()
Perform any final tasks required to generate unit counts in the particular format.
void setParam(const string &name, Uint4 value)
Set a value of a WindowMasker parameter.
virtual void doSetParam(const string &, Uint4)
void setUnitSize(Uint1 us)
Set the unit size value.
string FormatMetaData() const
Combine version data and metadata into a single string.
virtual void doFinalize()
virtual void doSetUnitCount(Uint4, Uint4)=0
virtual std::string Print() const
Print version information.
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
virtual const char * GetErrCodeString(void) const
Get error code interpreted as text.
uint8_t Uint1
1-byte (8-bit) unsigned integer
uint32_t Uint4
4-byte (32-bit) unsigned integer
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define STAT_ALGO_VER_PATCH
#define STAT_ALGO_VER_MAJOR
#define STAT_ALGO_VER_MINOR