53 virtual void Init(
void);
54 virtual int Run (
void);
61 #define GB_RELEASE_MODE_NONE "none"
62 #define GB_RELEASE_MODE_GUESS "guess"
63 #define GB_RELEASE_MODE_FORCE "force"
70 arg_desc->SetUsageContext(GetArguments().GetProgramBasename(),
71 "LDS2 Indexer",
false);
73 arg_desc->AddKey(
"source",
"path_name",
74 "Paht to the directory with source data files",
77 arg_desc->AddOptionalKey(
"db",
"db_name",
78 "Path to the LDS2 database file",
81 arg_desc->AddFlag(
"norecursive",
82 "Do not search for source files recursively");
84 arg_desc->AddOptionalKey(
"gb_release",
"gb_release_mode",
85 "Mode of GB release file detection",
87 arg_desc->SetConstraint(
"gb_release",
103 arg_desc->AddOptionalKey(
"group_aligns",
"group_size",
104 "Group standalone seq-aligns into blobs",
107 arg_desc->AddOptionalKey(
"dump_table",
"table_name",
108 "Dump LDS2 table content",
110 arg_desc->AddDefaultKey(
"dump_file",
"file_name",
112 SetupArgDescriptions(arg_desc.release());
118 string lds2_section_name =
"lds2";
120 string db_path = reg.
Get(lds2_section_name,
"Path",
122 string source_path = reg.
Get(lds2_section_name,
"Source",
126 if (args[
"source"]) {
127 source_path = args[
"source"].AsString();
131 db_path = args[
"db"].AsString();
139 if ( args[
"gb_release"] ) {
140 string mode = args[
"gb_release"].AsString();
152 if ( args[
"group_aligns"] ) {
156 if ( args[
"dump_table"] ) {
157 mgr.
GetDatabase()->
Dump(args[
"dump_table"].AsString(), args[
"dump_file"].AsOutputFile());
160 mgr.
AddDataDir(source_path, args[
"norecursive"] ?
196 int main(
int argc,
const char* argv[])
void Dump(const string &table, CNcbiOstream &out)
Dump the selected table (use empty string to dump table names or * to dump all tables.
Class for managing LDS2 database and related data files.
@ eGB_Force
Split all top-level bioseq-sets into seq-entries.
@ eGB_Guess
Try to autodetect and split GB release bioseq-sets.
@ eGB_Ignore
Do not split bioseq-sets (default)
void AddDataDir(const string &data_dir, EDirMode mode=eDir_Recurse)
Add data directory.
void SetSeqAlignGroupSize(int sz)
CLDS2_Database * GetDatabase(void)
Get the current database object.
void UpdateData(void)
Rescan all indexed files, check for modifications, update the database.
@ eDir_Recurse
Automatically scan sub-directories (default).
@ eDir_NoRecurse
Do not parse sub-dirs automatically.
void SetGBReleaseMode(EGBReleaseMode mode)
Include a standard set of the NCBI C++ Toolkit most basic headers.
@ eString
An arbitrary string.
@ eOutputFile
Name of file (must be writable)
@ eInteger
Convertible into an integer number (int or Int8)
static string ConcatPath(const string &first, const string &second)
Concatenate two parts of the path for the current OS.
virtual const string & Get(const string §ion, const string &name, TFlags flags=0) const
Get the parameter value.
@ fTruncate
Leading, trailing blanks can be truncated.
void Run(void)
Enter the main loop.
#define GB_RELEASE_MODE_GUESS
#define GB_RELEASE_MODE_NONE
#define GB_RELEASE_MODE_FORCE
int main(int argc, const char *argv[])
Magic spell ;-) needed for some weird compilers... very empiric.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
#define GetArgs
Avoid preprocessor name clash with the NCBI C Toolkit.
Defines command line argument related classes.
Defines unified interface to application: