()
override;
101 string&
PrintUsage(
string&
str,
booldetailed =
false)
const override;
111 for(
autonm :
names) {
115 for(
autoal : aliases) {
138arg_desc->SetUsageContext(
"",
"Discrepancy Report");
143arg_desc->AddFlag(
"u",
"Recurse");
150arg_desc->AddOptionalKey(
"d",
"DisableTests",
"List of disabled tests, separated by ','",
CArgDescriptions::eString);
152arg_desc->AddOptionalKey(
"a",
"Asn1Type",
"Asn.1 Type: a: Any, e: Seq-entry, b: Bioseq, s: Bioseq-set, m: Seq-submit, t: Batch Bioseq-set, u: Batch Seq-submit, c: Catenated seq-entry",
CArgDescriptions::eString);
154arg_desc->AddFlag(
"S",
"SummaryReport");
159arg_desc->AddOptionalKey(
"X",
"ExpandCategories",
"Expand Report Categories (comma-delimited list of test names or ALL)",
CArgDescriptions::eString);
160arg_desc->AddFlag(
"N",
"Check Product Names");
161arg_desc->AddFlag(
"F",
"Autofix");
162arg_desc->AddFlag(
"XML",
"Generate XML output");
163arg_desc->AddFlag(
"STDOUT",
"Copy the output to STDOUT");
164arg_desc->AddFlag(
"LIST",
"List the tests without execution");
167arg_desc->AddOptionalKey(
"P",
"ReportType",
"Report type: q - SMART genomes, u - Genome Submitter, b - Big Sequence, f - FATAL, t - Include FATAL Tag, s - FATAL Tag for Superuser",
CArgDescriptions::eString);
168arg_desc->AddOptionalKey(
"R",
"SevCount",
"0: always fail, 1: fail if severity is WARNING or above, 2 and higher: fail if severity is ERROR or above",
CArgDescriptions::eInteger);
185 stringpath = args[
"outdir"] ? args[
"outdir"].AsString() : fname.
GetDir();
186 stringext = args[
"s"] ? args[
"s"].AsString() :
".dr";
196unique_ptr<CNcbiIstream> InputStream(
new CNcbiIfstream(fname, ios::binary));
212unique_ptr<CObjectIStream> objectStream;
230 if(
type==
"e")
returnCSeq_entry::GetTypeInfo()->GetName();
231 else if(
type==
"m")
returnCSeq_submit::GetTypeInfo()->GetName();
232 else if(
type==
"s")
returnCBioseq_set::GetTypeInfo()->GetName();
233 else if(
type==
"b")
returnCBioseq::GetTypeInfo()->GetName();
241 boolcompressed =
false;
255 stringext =
GetArgs()[
"x"].AsString();
256 if(!ext.empty() && ext[0] !=
'.') {
259 stringautofixext =
".autofix"+ ext;
263 autofilename = entry->GetName();
264 if(filename ==
"."|| filename ==
"..")
continue;
265 if(recursive && entry->IsDir())
x_ParseDirectory(entry->GetPath(),
true);
269 m_Files.push_back(entry->GetPath());
282Tests->AddTest(eTestNames::_SUSPECT_PRODUCT_NAMES);
283Tests->ParseStrings(fname);
284severity = Tests->Summarize();
288Tests->AddTest(tname);
292severity = Tests->Summarize();
298 x_Output(outfilename, *Tests->GetProduct(), 0);
310list<ostream*> olist{&out1};
312olist.push_back(&std::cout);
321 unsignedseverity = 0;
325Tests->AddTest(eTestNames::_SUSPECT_PRODUCT_NAMES);
326 for(
const string& fname :
m_Files) {
331Tests->ParseStrings(fname);
333severity = Tests->Summarize();
336Tests->AddTest(tname);
339 for(
const string& fname :
m_Files) {
345severity = Tests->Summarize();
349 for(
const string& fname :
m_Files) {
351Tests->AddTest(tname);
360severity = Tests->Summarize();
380 const string& s = args[
"P"].AsString();
385 else if(c ==
's') {
389 else if(c ==
'q'|| c ==
'b'|| c ==
'u'|| c ==
'f') {
413 for(
const string& s : List) {
415 if(name == eTestNames::notset) {
427 else if(!args[
"N"]) {
454 for(
const string& s : List) {
456 if(name == eTestNames::notset) {
478 for(
const string& s : List) {
489 if(args[
"LIST"]) {
496 stringabs_input_path;
498 m_Files.push_back(args[
"i"].AsString());
502 if(args[
"indir"])
x_ParseDirectory(args[
"indir"].AsString(), args[
"u"].AsBoolean());
510 if(args[
"L"])
m_Lineage= args[
"L"].AsString();
511 if(args[
"XML"])
m_Xml= args[
"XML"].AsBoolean();
512 if(args[
"STDOUT"])
m_Print= args[
"STDOUT"].AsBoolean();
518 transform(
m_Files.begin(),
m_Files.end(),
m_Files.begin(), [](
string& s) { for (auto n = s.find(
'\\'); n != string::npos; n = s.find(
'\\')) s[n] =
'/'; return s; });
528 unsignedseverity = 0;
540 for(
const string&
f:
m_Files) {
546severity = sev > severity ? sev : severity;
556 int r= args[
"R"].AsInteger();
557 if(
r< 1 || (r < 2 && severity > 0) || severity > 1) {
572list<string> split_args;
573vector<const char*> new_argv;
575 if(argc==2 && argv && argv[1] && strchr(argv[1],
' '))
579argc = 1 + split_args.size();
580new_argv.reserve(argc);
581new_argv.push_back(argv[0]);
582 for(
auto& s : split_args) {
583new_argv.push_back(s.c_str());
585std::cerr << s.c_str() <<
" ";
590argv = new_argv.data();
User-defined methods of the data storage class.
static void PrintMsg(EDiagSev sev, const string &msg)
USING_SCOPE(NDiscrepancy)
static unique_ptr< CObjectIStream > OpenUncompressedStream(const string &fname, bool &compressed)
void transform(Container &c, UnaryFunction *op)
static void SetupObjectManager(const CArgs &args, objects::CObjectManager &obj_mgr, TLoaders loaders=fDefault)
Set up the standard object manager data loaders according to the arguments provided above.
static void AddArgumentDescriptions(CArgDescriptions &arg_desc, TLoaders loaders=fDefault)
Add a standard set of arguments used to configure the object manager.
int Run() override
Run the application.
void Init() override
Initialize the application.
void x_Autofix(CDiscrepancySet &tests)
bool m_SuspectProductNames
unsigned x_ProcessAll(const string &outname)
string x_ConstructOutputName(const string &input)
void x_ParseDirectory(const string &name, bool recursive)
void x_ProcessFile(const string &filename, CDiscrepancySet &tests)
void x_Output(const string &fname, CDiscrepancyProduct &tests, unsigned short flags)
unsigned x_ProcessOne(const string &filename)
string & PrintUsage(string &str, bool detailed=false) const override
Print usage message to end of specified string.
static CRef< CDiscrepancySet > New(objects::CScope &scope)
EFormat
The formats are checked in the same order as declared here.
@ eBZip2
bzip2 compressed file
@ eBinaryASN
Binary ASN.1.
@ eLzo
lzo compressed file
@ eGZip
GNU zip compressed file.
static EFormat Format(const string &path, EOnError onerror=eDefault)
Guess file format.
IWriter which can write simultaneously to the different streams.
Writer-based output stream.
constexpr bool empty() const
eTestNames GetDiscrepancyCaseName(string_view)
vector< string_view > GetDiscrepancyAliases(eTestNames name)
TTestNamesSet GetDiscrepancyTests(TGroup group)
std::ofstream out("events_result.xml")
main entry point for tests
static const struct name_t names[]
static void AllTests(void)
static const char * str(char *buf, int n)
static DbTestEntry * tests
virtual const CArgs & GetArgs(void) const
Get parsed command line arguments.
int AppMain(int argc, const char *const *argv, const char *const *envp=0, EAppDiagStream diag=eDS_Default, const char *conf=NcbiEmptyCStr, const string &name=NcbiEmptyString)
Main function (entry point) for the NCBI application.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
void SetVersion(const CVersionInfo &version)
Set the version number for the program.
@ eTakeOwnership
An object can take ownership of another.
virtual string & PrintUsage(string &str, bool detailed=false) const
Print usage message to end of specified string.
@ eInputFile
Name of file (must exist and be readable)
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
@ eInteger
Convertible into an integer number (int or Int8)
EMethod
Compression/decompression methods.
@ eNone
no compression method (copy "as is")
@ eGZipFile
.gz file (including concatenated files)
@ fDefault
Use algorithm-specific defaults.
EDiagSev
Severity level for the posted diagnostics.
@ eDiag_Info
Informational message.
@ eDiag_Error
Error message.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string & GetMsg(void) const
Get message string.
TEntries GetEntries(const string &mask=kEmptyStr, TGetEntriesFlags flags=0) const
Get directory entries based on the specified "mask".
static string CreateAbsolutePath(const string &path, ERelativeToWhat rtw=eRelativeToCwd)
Get an absolute path from some, possibly relative, path.
string GetDir(EIfEmptyPath mode=eIfEmptyPath_Current) const
Get the directory component for this directory entry.
string GetBase(void) const
Get the base entry name without extension.
static string MakePath(const string &dir=kEmptyStr, const string &base=kEmptyStr, const string &ext=kEmptyStr)
Assemble a path from basic components.
virtual bool Exists(void) const
Check if directory "dirname" exists.
bool IsDir(EFollowLinks follow=eFollowLinks) const
Check whether a directory entry is a directory.
@ eSerial_AsnText
ASN.1 text.
@ eSerial_AsnBinary
ASN.1 binary.
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddDefaults(TPriority pri=kPriority_Default)
Add default data loaders from object manager.
void Reset(void)
Reset reference object.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
@ fSplit_CanEscape
Allow \... escaping.
@ fSplit_Tokenize
All delimiters are merged and trimmed, to get non-empty tokens only.
@ fSplit_MergeDelimiters
Merge adjacent delimiters.
The blob sat and sat key Both must be positive integers</td > n< td > Non empty string The interpretation of the blob id depends on a processor Cassandra n processor expects the following format
Lightweight interface for getting lines of data with minimal memory copying.
constexpr auto sort(_Init &&init)
#define NCBI_SC_VERSION_PROXY
#define NCBI_TEAMCITY_BUILD_NUMBER_PROXY
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
std::istream & in(std::istream &in_, double &x_)
double r(size_t dimension_, const Int4 *score_, const double *prob_, double theta_)
Reader-writer based streams.
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
C++ I/O stream wrappers to compress/decompress data on-the-fly.
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