<< s << '!')
58 #define WARNING_MESSAGE(s) ERR_POST(Warning << "struct_util_demo: "<< s)
59 #define INFO_MESSAGE(s) ERR_POST(Info << "struct_util_demo: "<< s)
60 #define TRACE_MESSAGE(s) ERR_POST(Trace << "struct_util_demo: "<< s)
63 template<
classASNClass >
71*err =
"Cannot open file for reading";
75unique_ptr<CObjectIStream> inObject;
88*inObject >> *ASNobject;
89}
catch(std::exception& e) {
100 template<
classASNClass >
101 bool WriteASNToFile(
const char*filename,
constASNClass& ASNobject,
boolisBinary,
110*err =
"Cannot open file for writing";
114unique_ptr<CObjectOStream> outObject;
127*outObject << ASNobject;
129}
catch(std::exception& e) {
145argDescr->
AddKey(
"i",
"filename",
"name of input CD", argDescr->
eString);
146argDescr->
AddKey(
"o",
"filename",
"name of output CD", argDescr->
eString);
149argDescr->
AddFlag(
"ob",
"output binary data");
152argDescr->
AddFlag(
"IBM",
"do only IBM");
155argDescr->
AddFlag(
"LOO",
"do leave-one-out");
158argDescr->
AddOptionalKey(
"f",
"integer",
"first block to realign (post-IBM, from 1)", argDescr->
eInteger);
160argDescr->
AddOptionalKey(
"l",
"integer",
"last block to realign (post-IBM, from 1)", argDescr->
eInteger);
162argDescr->
AddOptionalKey(
"p",
"double",
"allowed loop length percentile", argDescr->
eDouble);
167SetupArgDescriptions(argDescr);
175 ERROR_MESSAGE(
"Cannot open file '"<< filename <<
"' for reading");
179*inStream >> firstWord;
180 boolisBinary = !(firstWord ==
"Cdd");
225 if(!
ReadCD(args[
"i"].AsString(), &cdd)) {
226 ERROR_MESSAGE(
"error reading input file "<< args[
"i"].AsString());
244 else if(args[
"LOO"].
HasValue()) {
245vector < unsigned int > blocksToRealign;
246 for(
int i=args[
"f"].AsInteger();
i<=args[
"l"].AsInteger(); ++
i)
247blocksToRealign.push_back(
i- 1);
248 INFO_MESSAGE(
"score of row "<< args[
"r"].AsInteger() <<
" vs. PSSM(N) before realignment: " 252args[
"r"].AsInteger() - 1, blocksToRealign,
253args[
"p"].AsDouble(), args[
"e"].AsInteger(), 0))
258 INFO_MESSAGE(
"score of row "<< args[
"r"].AsInteger() <<
" vs PSSM(N) after realignment: " 269 ERROR_MESSAGE(
"error writing output file "<< args[
"o"].AsString());
282 int main(
intargc,
const char* argv[])
const SeqAnnotList & GetSeqAnnots(void)
const BlockMultipleAlignment * GetBlockMultipleAlignment(void)
bool DoLeaveOneOut(unsigned int row, const std::vector< unsigned int > &blocksToRealign, double percentile, unsigned int extension, unsigned int cutoff, unsigned int queryFrom=0, unsigned int queryTo=kMax_UInt)
int ScoreRowByPSSM(unsigned int row)
unsigned int NRows(void) const
CObjectIStreamAsnBinary â.
CObjectOStreamAsnBinary â.
Include a standard set of the NCBI C++ Toolkit most basic headers.
std::ofstream out("events_result.xml")
main entry point for tests
void AddFlag(const string &name, const string &comment, CBoolEnum< EFlagValue > set_value=eFlagHasValueIfSet, TFlags flags=0)
Add description for flag argument.
void SetConstraint(const string &name, const CArgAllow *constraint, EConstraintNegate negate=eConstraint)
Set additional user defined constraint on argument value.
void AddKey(const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
Add description for mandatory key.
void AddOptionalKey(const string &name, const string &synopsis, const string &comment, EType type, TFlags flags=0)
Add description for optional key without default value.
@ eDouble
Convertible into a floating point number (double)
@ eString
An arbitrary string.
@ eInteger
Convertible into an integer number (int or Int8)
void SetDiagPostFlag(EDiagPostFlag flag)
Set the specified flag (globally).
void UnsetDiagTraceFlag(EDiagPostFlag flag)
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
void SetDiagTrace(EDiagTrace how, EDiagTrace dflt=eDT_Default)
Set the diagnostic trace settings.
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
@ eDPF_File
File name (not full path)
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
@ eDT_Disable
Ignore messages of severity "eDiag_Trace".
@ eDT_Default
Restores the default tracing context.
@ eDiag_Info
Informational message.
@ eDiag_Fatal
Fatal error â guarantees exit(or abort)
static void SetVerifyDataGlobal(ESerialVerifyData verify)
EFixNonPrint
How to process non-printing character in the ASN VisibleString.
@ eSerialVerifyData_Always
always verify (even if set not to later on)
static void SetVerifyDataGlobal(ESerialVerifyData verify)
Set up default output data verification for streams created by the current process.
static void SetVerifyDataGlobal(ESerialVerifyData verify)
Set up default input data verification for streams created by the current process.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_SCOPE(ns)
Define a new scope.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
const TSequences & GetSequences(void) const
Get the Sequences member data.
const TSeqannot & GetSeqannot(void) const
Get the Seqannot member data.
TSeqannot & SetSeqannot(void)
Assign a value to Seqannot data member.
#define GetArgs
Avoid preprocessor name clash with the NCBI C Toolkit.
std::istream & in(std::istream &in_, double &x_)
#define row(bind, expected)
static bool ReadCD(const string &filename, CCdd *cdd)
bool WriteASNToFile(const char *filename, const ASNClass &ASNobject, bool isBinary, std::string *err, EFixNonPrint fixNonPrint=eFNP_Default)
static int SumAllRowScores(AlignmentUtility &au)
int main(int argc, const char *argv[])
bool ReadASNFromFile(const char *filename, ASNClass *ASNobject, bool isBinary, std::string *err)
#define WARNING_MESSAGE(s)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4