A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.ncbi.nlm.nih.gov/IEB/ToolBox/CPP_DOC/doxyhtml/srcchk_8cpp_source.html below:

NCBI C++ ToolKit: src/app/srcchk/srcchk.cpp Source File

95

arg_desc->SetUsageContext(

97  "Extract Genbank source qualifiers"

,

102

arg_desc->AddOptionalKey(

"i"

,

"IDsFile"

,

103  "IDs file name. Defaults to stdin"

,

106

arg_desc->AddOptionalKey(

"seq-entry"

,

"SeqEntryFile"

,

107  "File containing Seq-entry in ASN.1 format"

,

110

arg_desc->SetDependency(

"seq-entry"

,

117

arg_desc->AddOptionalKey(

"f"

,

"FieldsList"

,

120

arg_desc->SetDependency(

"f"

,

124

arg_desc->SetDependency(

"f"

,

128

arg_desc->AddOptionalKey(

"F"

,

"FieldsFile"

,

131

arg_desc->SetDependency(

"F"

,

135

arg_desc->AddFlag(

"all-fields"

,

"List all fields"

);

139

arg_desc->AddFlag(

"list-supported-fields"

,

140  "List in alphabetical order the fields that srcchk can display; ignore other arguments"

);

145

arg_desc->AddOptionalKey(

"o"

,

"OutputFile"

,

146  "Output file name. Defaults to stdout"

,

151

arg_desc->AddDefaultKey(

"delim"

,

"Delimiter"

,

165  if

(args[

"list-supported-fields"

]) {

167  sort

(begin(sortedFields), end(sortedFields));

168  for

(

const auto

& field : sortedFields) {

169

cout << field <<

"\n"

;

187  for

(

size_t

pos=0; pos < errorCount; ++pos) {

190  return

(errorCount ? 1 : 0);

200  string

error_msg = args[

"o"

] ?

201  "Unable to open output file \""

+ args[

"o"

].AsString() +

"\"."

:

202  "Unable to write to stdout."

;

209  const

streamsize maxLineSize(100);

210  char

line[maxLineSize];

219

pIfstr = args[

"i"

] ? &args[

"i"

].AsInputFile() : &cin;

221  catch

(

const

std::exception&) {

222  string

error_msg = args[

"i"

] ?

223  "Unable to open ID file \""

+ args[

"i"

].AsString() +

"\"."

:

224  "Unable to read IDs from stdin."

;

230

vector<pair<string, CBioseq_Handle> > vecIdBsh;

231  while

(!pIfstr->eof()) {

232

pIfstr->getline(line, maxLineSize);

233  if

(line[0] == 0 || line[0] ==

'#'

) {

241

vecIdBsh.push_back(make_pair(

id

,bsh));

247  string

err_msg =

"Malformatted ID \""

+

id

+

"\""

;

265  if

(!args[

"seq-entry"

]) {

270  string

error_msg = args[

"o"

] ?

271  "Unable to open output file \""

+ args[

"o"

].AsString() +

"\"."

:

272  "Unable to write to stdout."

;

284  const char

*

infile

= args[

"seq-entry"

].AsString().c_str();

288  string msg

(

"Unable to open Seq-entry file \""

+ args[

"seq-entry"

].AsString() +

"\"."

);

300  string msg

(

"Unable to process Seq-entry file \""

+ args[

"seq-entry"

].AsString() +

"\"."

);

317  if

(args[

"all-fields"

]) {

323  string

fieldString = args[

"f"

].AsString();

328  const

streamsize maxLineSize(100);

329  char

line[maxLineSize];

332

pIfstr = &args[

"F"

].AsInputFile();

334  catch

(

const

std::exception&) {

337  "Unable to open fields file \""

+ args[

"F"

].AsString() +

"\"."

);

342  while

(!pIfstr->eof()) {

343

pIfstr->getline(line, maxLineSize);

344  if

(line[0] == 0 || line[0] ==

'#'

) {

352  if

(field ==

"id"

|| field ==

"accession"

) {

356

fields.push_back(field);

376  return

&args[

"o"

].AsOutputFile();

378  catch

(

const

std::exception&) {

400

<<

error

.SeverityStr().c_str()

402

<<

error

.ErrorMessage().c_str()

410 int main

(

int

argc,

const char

** argv)

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.

size_t Count() const override

const ILineError & GetError(size_t uPos) const override

0-based error retrieval.

bool xTryProcessSeqEntry(const CArgs &)

bool xTryProcessIdFile(const CArgs &)

CSrcWriter * xInitWriter(const CArgs &)

CRef< CSrcWriter > m_pWriter

CRef< CObjectManager > m_pObjMngr

CNcbiOstream * xInitOutputStream(const CArgs &)

void Init()

Initialize the application.

int Run()

Run the application.

CRef< CMessageListenerBase > m_pErrors

bool xGetDesiredFields(const CArgs &, vector< string > &)

void xDumpError(const ILineError &, std::ostream &)

static CSrcError * Create(ncbi::EDiagSev severity, const std::string &)

Used to generate tables showing qualifier-field entries occuring in the BioSources of instances of Bi...

static bool ValidateFields(const FIELDS &fields, ILineErrorListener *=nullptr)

Verify that each string in fields is a valid qualifier name.

static const FIELDS sAllSrcCheckFields

All possible fields processed by srchck application, in their canonical order.

static const FIELDS sDefaultSrcCheckFields

Default fields processed by srcchk application, in their canonical order.

void SetDelimiter(const string &delimiter)

Set the column delimiter for the output table.

virtual bool WriteBioseqHandles(const vector< pair< string, CBioseq_Handle > > &, const FIELDS &, CNcbiOstream &, ILineErrorListener *=nullptr)

Write a table of the specified qualifier-field entries found in the BioSources of a vector of Bioseqs...

virtual bool WriteSeqEntry(const CSeq_entry &, CScope &, CNcbiOstream &, bool=false)

Write a table of all qualifier-field entries occurring in the BioSources for a given Seq-entry,...

virtual bool PutError(const ILineError &)=0

Store error in the container, and return true if error was stored fine, and return false if the calle...

std::ofstream out("events_result.xml")

main entry point for tests

const CNcbiRegistry & GetConfig(void) const

Get the application's cached configuration parameters (read-only).

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.

const CNcbiArguments & GetArguments(void) const

Get the application's cached unprocessed command-line arguments.

void SetVersion(const CVersionInfo &version)

Set the version number for the program.

@ eTakeOwnership

An object can take ownership of another.

@ eExcludes

One argument excludes another.

@ eInputFile

Name of file (must exist and be readable)

@ eString

An arbitrary string.

@ eOutputFile

Name of file (must be writable)

#define ERR_POST(message)

Error posting with file, line number information but without error codes.

@ eDiag_Error

Error message.

TErrCode GetErrCode(void) const

Get error code.

@ eSerial_AsnText

ASN.1 text.

static CSeq_id_Handle GetHandle(const CSeq_id &id)

Normal way of getting a handle, works for any seq-id.

@ eFormat

Contents not parsable as expected.

pair< TObjectPtr, TTypeInfo > ObjectInfo(C &obj)

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.

CBioseq_Handle GetBioseqHandle(const CSeq_id &id)

Get bioseq handle by seq-id.

void AddDefaults(TPriority pri=kPriority_Default)

Add default data loaders from object manager.

void Reset(void)

Reset reference object.

#define END_NCBI_SCOPE

End previously defined NCBI scope.

#define BEGIN_NCBI_SCOPE

Define ncbi namespace.

IO_PREFIX::ostream CNcbiOstream

Portable alias for ostream.

IO_PREFIX::istream CNcbiIstream

Portable alias for istream.

IO_PREFIX::ifstream CNcbiIfstream

Portable alias for ifstream.

static string PrintableString(const CTempString str, TPrintableMode mode=fNewLine_Quote|fNonAscii_Passthru)

Get a printable version of the specified string.

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 void TruncateSpacesInPlace(string &str, ETrunc where=eTrunc_Both)

Truncate whitespace in a string (in-place)

@ fNonAscii_Quote

Octal for all non-ASCII characters.

void CONNECT_Init(const IRWRegistry *reg=0, CRWLock *lock=0, TConnectInitFlags flag=eConnectInit_OwnNothing, FSSLSetup ssl=0)

Init [X]CONNECT library with the specified "reg" and "lock" (ownership for either or both can be deta...

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.

static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)

int main(int argc, const char **argv)


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