52 virtual void Init(
void);
53 virtual int Run(
void);
54 virtual void Exit(
void);
67 arg_desc->AddKey(
"db",
"database_name",
68 "BLAST database to read and create",
71 arg_desc->AddDefaultKey(
"samples",
"buhler_samples",
72 "Number of samples to check",
76 arg_desc->AddDefaultKey(
"kmer",
"kmerNum",
79 arg_desc->AddDefaultKey(
"width",
"width_data",
80 "Width of data arrays. 4 for an int, 2 for short(recommmended), 1 for byte",
83 arg_desc->AddDefaultKey(
"threads",
"number_threads",
84 "Number of threads to use.",
87 arg_desc->AddDefaultKey(
"hashes",
"number_hashes",
88 "Number of Hash functions to use.",
91 arg_desc->AddDefaultKey(
"alphabet",
"alphabet_choice",
92 "0 (zero) for 15 letter alphabet, 1 for 10 letter alphabet",
95 arg_desc->AddDefaultKey(
"kversion",
"index_version",
96 "1 for older LSH, 2 for Buhler LSH, 3 for one hash method",
99 arg_desc->AddOptionalKey(
"output",
"Outputfile",
102 arg_desc->AddDefaultKey(
"logfile",
104 "File for logging errors",
109 arg_desc->SetUsageContext(
"mkkblastindex",
"Index for protein kmer search");
128 int samples =
GetArgs()[
"samples"].AsInteger();
130 int kmerNum =
GetArgs()[
"kmer"].AsInteger();
132 int dataWidth =
GetArgs()[
"width"].AsInteger();
134 int numThreads =
GetArgs()[
"threads"].AsInteger();
136 int numHashes =
GetArgs()[
"hashes"].AsInteger();
138 int alphabet =
GetArgs()[
"alphabet"].AsInteger();
143 ?
GetArgs()[
"logfile"].AsOutputFile()
150 build_index.
Build(numThreads);
153 *logFile <<
"CSeqDB Database error: " << e.
GetMsg() << endl;
156 catch (
const blast::CMinHashException& e) {
157 *logFile <<
"CMinHash error: " << e.
GetMsg() << endl;
161 *logFile <<
"File error: " << e.
GetMsg() << endl;
165 *logFile <<
"mkkblastindex failed to write output" << endl;
168 catch (
const std::bad_alloc&) {
169 *logFile <<
"mkkblastindex ran out of memory" << endl;
173 *logFile <<
"Unknown error" << endl;
194 #ifndef SKIP_DOXYGEN_PROCESSING
195 int main(
int argc,
const char* argv[])
virtual void Exit(void)
Cleanup on application exit.
virtual void Init(void)
Initialize the application.
virtual int Run(void)
Run the application.
void Build(int numThreads=1)
Build the index.
void HideStdArgs(THideStdArgs hide_mask)
Set the hide mask for the Hide Std Flags.
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.
@ fHideXmlHelp
Hide XML help description.
@ fHideFullVersion
Hide full version description.
@ fHideDryRun
Hide dryrun description.
@ fHideConffile
Hide configuration file description.
@ fHideVersion
Hide version description.
@ fAppend
Append to end-of-file; for eOutputFile or eIOFile.
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
@ eInteger
Convertible into an integer number (int or Int8)
void SetDiagPostPrefix(const char *prefix)
Specify a string to prefix all subsequent error postings with.
EDiagSev SetDiagPostLevel(EDiagSev post_sev=eDiag_Error)
Set the threshold severity for posting the messages.
void SetDiagStream(CNcbiOstream *os, bool quick_flush=true, FDiagCleanup cleanup=0, void *cleanup_data=0, const string &stream_name="")
Set diagnostic stream.
@ eDiag_Warning
Warning message.
const string & GetMsg(void) const
Get message string.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
string AsString(const CTimeFormat &format=kEmptyStr, TSeconds out_tz=eCurrentTimeZone) const
Transform time to string.
@ eCurrent
Use current time. See also CCurrentTime.
int main(int argc, const char *argv[])
const string version
version string
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.