(
void);
50 virtual int Run(
void);
60arg_desc->AddDefaultKey(
"gi",
"GI",
65arg_desc->AddOptionalKey(
"file",
"InputFile",
66 "Input file to test, one gi or accession per line",
69arg_desc->AddFlag(
"show_acc",
70 "Show the passed accession as well as the gi");
82 boolshow = args[
"show_acc"];
84vector<string> id_list;
85 if( args[
"gi"].AsInteger() ) {
86id_list.push_back( args[
"gi"].AsString() );
93id_list.push_back(acc);
101 static const char* sc_ValidChars =
102 "abcdefghijklmnopqrstuvwxyz" 103 "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 107 ITERATE(vector<string>, iter, id_list) {
108 stringid_str = *iter;
110string::size_type pos = id_str.find_first_not_of(sc_ValidChars);
111 if(pos != string::npos) {
114 if( id_str.empty() ) {
122gi = NStr::StringToNumeric<TGi>(id_str);
126cout <<
"trying: "<< *iter <<
" -> "<< id_str << endl;
135 ERR_POST(
Error<<
"don't know anything about accession/id: " 144cout << id_str <<
" ";
146cout << gi <<
" "<< tax_id << endl;
153 int main(
intargc,
const char* argv[])
virtual int Run(void)
Run the application.
virtual void Init(void)
Initialize the application.
bool GetTaxId4GI(TGi gi, TTaxId &tax_id_out)
int main(int argc, const char *argv[])
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.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
SStrictId_Tax::TId TTaxId
Taxon id type.
@ eInputFile
Name of file (must exist and be readable)
@ eInteger
Convertible into an integer number (int or Int8)
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
void Error(CExceptionArgs_Base &args)
void Info(CExceptionArgs_Base &args)
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate whitespace in a string.
virtual NCBI_NS_NCBI::TGi AskGetgi(const CSeq_id &req, TReply *reply=0)
Magic spell ;-) needed for some weird compilers... very empiric.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
Defines command line argument related classes.
Defines unified interface to application:
Process information in the NCBI Registry, including working with configuration files.
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