arg_desc->SetUsageContext(
GetArguments().GetProgramBasename(),
117 "Stand-alone BLAST formatter client, version " 120arg_desc->SetCurrentGroup(
"Input options");
121arg_desc->AddOptionalKey(
kArgRid,
"BLAST_RID",
"BLAST Request ID (RID)",
125arg_desc->AddOptionalKey(
kArgArchive,
"ArchiveFile",
"File containing BLAST Archive format in ASN.1 (i.e.: output format 11)",
132arg_desc->SetCurrentGroup(
"Output configuration options");
133arg_desc->AddDefaultKey(
kArgOutput,
"output_file",
"Output file name",
136arg_desc->SetCurrentGroup(
"Miscellaneous options");
138 "Should the query and subject defline(s) be parsed?",
true);
139arg_desc->SetCurrentGroup(
"");
151 static boolfirst_time =
true;
164 return SSeqLoc(seqloc, scope);
171 throwruntime_error(
"PSSM has no query");
175 if( !seq_entry.
IsSeq() ) {
176 throwruntime_error(
"Cannot have multiple queries in a PSSM");
198 if(b4_queries->
IsPssm()) {
204 _ASSERT( !(*seqloc)->GetId()->IsLocal() );
226 static void s_FillDBInfo(CBlastFormatUtil::SDbInfo & dbInfo,
const string& dbNames,
boolisProtein)
231dbInfo.is_protein =
false;
232dbInfo.name =dbNames;
233dbInfo.definition = dbInfo.name;
234dbInfo.total_length = (
Int8)length;
235dbInfo.number_seqs = (
int) seqs;
258vector<string> paths;
269 "SAM format is only applicable to blastn results");
277vector< CBlastFormatUtil::SDbInfo > vecDbInfo(1);
301 boolisPsiBlast = (
"psiblast"==
kTask);
348 #define EXIT_CODE__UNKNOWN_RID 1 349 #define EXIT_CODE__SEARCH_PENDING 2 350 #define EXIT_CODE__SEARCH_FAILED 3 364 "Invalid input format for BLAST Archive.");
374 "Invalid input format for BLAST Archive.");
381 const stringkRid = args[
kArgRid].AsString();
394cerr <<
"Unknown/invalid RID '"<< kRid <<
"'."<< endl;
403cerr <<
"RID '"<< kRid <<
"' is still pending."<< endl;
408cerr <<
"RID '"<< kRid <<
"' has failed"<< endl;
433 if(args[
"outfmt"].
HasValue()) {
438 #ifndef SKIP_DOXYGEN_PROCESSING 439 int main(
intargc,
const char* argv[]
)
Declares singleton objects to store the version and reference for the BLAST engine.
Produce formatted blast output for command line applications.
string GetCmdlineArgs(const CNcbiArguments &a)
bool UseXInclude(const CFormattingArgs &f, const string &s)
#define CATCH_ALL(exit_code)
Standard catch statement for all BLAST command line programs.
#define EXIT_CODE__UNKNOWN_RID
static void s_FillDBInfo(CBlastFormatUtil::SDbInfo &dbInfo, const string &dbNames, bool isProtein)
#define EXIT_CODE__SEARCH_PENDING
int main(int argc, const char *argv[])
#define EXIT_CODE__SEARCH_FAILED
Auxiliary classes/functions for BLAST input library.
bool HasRawSequenceData(const objects::CBioseq &bioseq)
Returns true if the Bioseq passed as argument has the full, raw sequence data in its Seq-inst field.
Boolean Blast_QueryIsProtein(EBlastProgramType p)
Returns true if the query is protein.
EBlastProgramType
Defines the engine's notion of the different applications of the BLAST algorithm.
CRef< CScope > GetVDBScope(string dbAllNames)
Utility functions for BLAST VDB command line applications.
const CSeq_id * GetFirstId() const
size_t GetNumQueries() const
Retrieve the number of queries in this object.
Defines BLAST error codes (user errors included)
This class formats the BLAST results for command line applications.
void PrintOneResultSet(const blast::CSearchResults &results, CConstRef< blast::CBlastQueryVector > queries, unsigned int itr_num=numeric_limits< unsigned int >::max(), blast::CPsiBlastIterationState::TSeqIds prev_seqids=blast::CPsiBlastIterationState::TSeqIds(), bool is_deltablast_domain_result=false)
Print all alignment information for a single query sequence along with any errors or warnings (errors...
void PrintEpilog(const blast::CBlastOptions &options)
Print the footer of the blast report.
void SetBaseFile(string base)
For use by XML2 only.
void SetLineLength(size_t len)
Set Alignment Length.
void WriteArchive(blast::IQueryFactory &queries, blast::CBlastOptionsHandle &options_handle, const blast::CSearchResultSet &results, unsigned int num_iters=0, const list< CRef< objects::CBlast4_error > > &msg=list< CRef< objects::CBlast4_error > >())
Writes out the query and results as an "archive" format.
void PrintProlog()
Print the header of the blast report.
virtual void Init()
@inheritDoc
CRef< CBlastScopeSource > m_QueryScopeSource
The source of CScope objects for queries.
CRef< CBlastSearchQuery > x_BuildQueryFromPssm(const CPssmWithParameters &pssm)
Build the query from a PSSM.
int PrintFormattedOutput(void)
Prints the BLAST formatted output.
virtual int Run()
@inheritDoc
SSeqLoc x_QueryBioseqToSSeqLoc(const CBioseq &bioseq, CRef< CScope > scope)
Package a scope and Seq-loc into a SSeqLoc from a Bioseq.
CBlastFormatterVdbApp()
@inheritDoc
bool m_LoadFromArchive
Tracks whether results come from an archive file.
CRef< CRemoteBlast > m_RmtBlast
Our link to the NCBI BLAST service.
CBlastUsageReport m_UsageReport
CRef< CBlastQueryVector > x_ExtractQueries(bool query_is_protein)
Extracts the queries to be formatted.
Encapsulates ALL the BLAST algorithm's options.
void AddQuery(CRef< CBlastSearchQuery > q)
Add a query to the set.
CRef< objects::CScope > GetScope(size_type i) const
Get the scope containing a query by index.
size_type size() const
Identical to Size, provided to facilitate STL-style iteration.
Class whose purpose is to create CScope objects which have data loaders added with different prioriti...
void AddDataLoaders(CRef< objects::CScope > scope)
Add the data loader configured in the object to the provided scope.
CRef< objects::CScope > NewScope()
Create a new, properly configured CScope.
void AddParam(EUsageParams p, int val)
Keeps track of the version of the BLAST engine in the NCBI C++ toolkit.
Argument class to collect debugging options.
bool ProduceDebugRemoteOutput() const
Return whether debug (verbose) output should be produced on remote searches (only available when comp...
virtual void ExtractAlgorithmOptions(const CArgs &cmd_line_args, CBlastOptions &options)
Interface method,.
bool ProduceDebugOutput() const
Return whether debug (verbose) output should be produced (only available when compiled with _DEBUG)
virtual void SetArgumentDescriptions(CArgDescriptions &arg_desc)
Interface method,.
void DebugDumpText(ostream &out, const string &bundle, unsigned int depth) const
Argument class to collect formatting options, use this to create a CBlastFormat object.
virtual bool ArchiveFormatRequested(const CArgs &args) const
virtual void SetArgumentDescriptions(CArgDescriptions &arg_desc)
Interface method,.
string GetCustomOutputFormatSpec() const
Retrieve for string that specifies the custom output format for tabular and comma-separated value.
EOutputFormat GetFormattedOutputChoice() const
Get the choice of formatted output.
virtual void ExtractAlgorithmOptions(const CArgs &args, CBlastOptions &opts)
Interface method,.
@ eXml2_S
XML2 single file.
@ eJson_S
JSON2 single file.
TSeqPos GetNumAlignments() const
Number of alignments to show in traditional BLAST output.
bool ShowGis() const
Display the NCBI GIs in formatted output?
TSeqPos GetNumDescriptions() const
Number of one-line descriptions to show in traditional BLAST output.
size_t GetLineLength() const
bool DisplayHtmlOutput() const
Display HTML output?
Defines user input exceptions.
NCBI C++ Object Manager dependant implementation of IQueryFactory.
const CSeq_entry & GetQuery() const
Retrieve the query sequence.
bool HasQuery() const
Has this PSSM a query in it?
API for Remote Blast Requests.
Search Results for All Queries.
Root class for all serialization exceptions.
Template class for iteration on objects of class C (non-medifiable version)
static void FindVDBPaths(const string &dbname, bool isProtein, vector< string > &paths, vector< string > *db_alias_list=NULL, vector< string > *vdb_alias_list=NULL, bool recursive=true, bool expand_links=true, bool verify_dbs=true)
Get the list of vdb names.
static void GetVDBStats(const string &strAllRuns, Uint8 &num_seqs, Uint8 &length, bool getRefStats=false)
Fucntion to get around the OID (blastseqsrc) limit So num of seqs > int4 can be returned.
const string kArgOutput
Output file name.
const string kArgArchive
Argument to blast_formatter to request BLAST archive file name.
const string kTask
Task to perform.
const string kArgParseDeflines
Argument to specify if the query and subject sequences defline should be parsed.
const string kArgRid
Argument to blast_formatter to request RID.
void Print(const CCompactSAMApplication::AlignInfo &ai)
std::ofstream out("events_result.xml")
main entry point for tests
bool LoadFromArchive()
Loads next chunk of archive from file.
CRef< CBlastOptionsHandle > GetSearchOptions()
Get the search options used for this search.
string GetErrors(void)
This returns a string containing any errors that were produced by the search.
ESearchStatus CheckStatus()
Returns the status of a previously submitted search/RID.
void SetVerbose(EDebugMode verb=eDebug)
Adjust the debugging level.
CBlastOptions & SetOptions()
Returns a reference to the internal options class which this object is a handle for.
CRef< objects::CBlast4_queries > GetQueries()
Get the queries used for this search.
EBlastProgramType GetProgramType() const
Returns the CORE BLAST notion of program type.
CRef< objects::CBlast4_database > GetDatabases()
Get the database used by the search.
CRef< CSearchResultSet > GetResultSet()
Submit the search (if necessary) and return the results.
unsigned int GetPsiNumberOfIterations(void)
@ eInvalidArgument
Invalid argument to some function/method (could be programmer error - prefer assertions in those case...
@ eStatus_Failed
Completed but failed, call GetErrors/GetErrorVector()
@ eStatus_Pending
Not completed yet.
@ eStatus_Unknown
Never submitted or purged from the system.
@ eStatus_Done
Completed successfully.
void SetFullVersion(CRef< CVersionAPI > version)
Set version data for the program.
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.
CVersionInfo GetVersion(void) const
Get the program version information.
virtual void SetupArgDescriptions(CArgDescriptions *arg_desc)
Setup the command line argument descriptions.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
const CNcbiArguments & GetArguments(void) const
Get the application's cached unprocessed command-line arguments.
@ fHideXmlHelp
Hide XML help description.
@ fHideLogfile
Hide log file description.
@ fHideFullVersion
Hide full version description.
@ fHideDryRun
Hide dryrun description.
@ fHideConffile
Hide configuration file description.
@ 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)
@ eDS_Default
Try standard log file (app.name + ".log") in /log/, use stderr on failure.
TErrCode GetErrCode(void) const
Get error code.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
#define NCBI_RETHROW(prev_exception, exception_class, err_code, message)
Generic macro to re-throw an exception.
CConstBeginInfo ConstBegin(const C &obj)
Get starting point of non-modifiable object hierarchy.
CBioseq_Handle AddBioseq(CBioseq &bioseq, TPriority pri=kPriority_Default, EExist action=eExist_Throw)
Add bioseq, return bioseq handle.
static CRef< CObjectManager > GetInstance(void)
Return the existing object manager or create one.
void AddScope(CScope &scope, TPriority pri=kPriority_Default)
Add the scope's datasources as a single group with the given priority All data sources (data loaders ...
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
void Reset(void)
Reset reference object.
int64_t Int8
8-byte (64-bit) signed integer
uint64_t Uint8
8-byte (64-bit) unsigned integer
bool IsEnabled(void)
Indicates whether application usage statistics collection is enabled for a current reporter instance.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
void Start(void)
Start the timer.
bool IsSeq_loc_list(void) const
Check if variant Seq_loc_list is selected.
bool IsPssm(void) const
Check if variant Pssm is selected.
list< CRef< CSeq_loc > > TSeq_loc_list
const TBioseq_set & GetBioseq_set(void) const
Get the variant data.
bool IsBioseq_set(void) const
Check if variant Bioseq_set is selected.
const TSeq_loc_list & GetSeq_loc_list(void) const
Get the variant data.
const TPssm & GetPssm(void) const
Get the variant data.
const TSeq & GetSeq(void) const
Get the variant data.
bool IsSeq(void) const
Check if variant Seq is selected.
unsigned int
A callback function used to compare two keys in a database.
const string version
version string
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
NCBI C++ stream class wrappers for triggering between "new" and "old" C++ stream libraries.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Declares the CRemoteBlast class.
Configuration structure for the CBlastScopeSource.
void OptimizeForWholeLargeSequenceRetrieval(bool value=true)
Configures the BLAST database data loader to optimize the retrieval of *entire* large sequences.
Structure to represent a single sequence to be fed to BLAST.
CConstRef< objects::CSeq_loc > seqloc
Seq-loc describing the sequence to use as query/subject to BLAST The types of Seq-loc currently suppo...
CRef< objects::CScope > scope
Scope where the sequence referenced can be found by the toolkit's object manager.
Defines database alias file access classes.
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