52 #ifndef SKIP_DOXYGEN_PROCESSING
165 pssm_bioseq.
SetDescr().Set().push_back(*it);
240 query_batch_size = 1;
326 results = deltablast->Run();
327 domain_results = deltablast->GetDomainResults();
328 pssm = deltablast->GetPssm();
355 blast::CSearchResultSet::const_iterator domain_it;
357 domain_it = domain_results->begin();
372 _ASSERT(domain_it != domain_results->end());
376 blast::CPsiBlastIterationState::TSeqIds(),
386 blast::CSearchResults& res = (*results)[0];
395 res.GetAncillaryData());
411 *deltablast->GetDomainResults()) {
415 blast::CPsiBlastIterationState::TSeqIds(),
438 <<
"Search has CONVERGED!"
476 bool converged =
false;
494 formatter.
WriteArchive(*query_factory, *opts_hndl, *results,
507 blast::CSearchResults& results_1st_query = (*results)[0];
508 if ( !results_1st_query.HasAlignments() ) {
524 (*results)[0].GetAncillaryData());
526 if (psiblast.
Empty()) {
536 results = psiblast->
Run();
554 blast::CSearchResults& results_1st_query = (*results)[0];
555 if ( !results_1st_query.HasAlignments() ) {
559 aln.
Reset(results_1st_query.GetSeqAlign());
574 results_1st_query.GetAncillaryData());
598 #ifndef SKIP_DOXYGEN_PROCESSING
599 int main(
int argc,
const char* argv[] )
User-defined methods of the data storage class.
CRef< blast::CRemoteBlast > InitializeRemoteBlast(CRef< blast::IQueryFactory > queries, CRef< blast::CBlastDatabaseArgs > db_args, CRef< blast::CBlastOptionsHandle > opts_hndl, bool verbose_output, const string &client_id, CRef< objects::CPssmWithParameters > pssm)
Initializes a CRemoteBlast instance for usage by command line BLAST binaries.
blast::SDataLoaderConfig InitializeQueryDataLoaderConfiguration(bool query_is_protein, CRef< blast::CLocalDbAdapter > db_adapter)
Initialize the data loader configuration for the query.
void SaveSearchStrategy(const CArgs &args, blast::CBlastAppArgs *cmdline_args, CRef< blast::IQueryFactory > queries, CRef< blast::CBlastOptionsHandle > opts_hndl, CRef< objects::CPssmWithParameters > pssm, unsigned int num_iters)
Save the search strategy corresponding to the current command line search.
void QueryBatchCleanup()
Clean up formatter scope and release.
string RegisterOMDataLoader(CRef< CSeqDB > db_handle)
Register the BLAST database data loader using the already initialized CSeqDB object.
CRef< CBlastAncillaryData > ExtractPssmAncillaryData(const CPssmWithParameters &pssm)
Auxiliary function to extract the ancillary data from the PSSM.
bool RecoverSearchStrategy(const CArgs &args, blast::CBlastAppArgs *cmdline_args)
Recover search strategy from input file.
void PrintErrorArchive(const CArgs &a, const list< CRef< CBlast4_error > > &msg)
Function to print blast archive with only error messages (search failed) to output stream.
void InitializeSubject(CRef< blast::CBlastDatabaseArgs > db_args, CRef< blast::CBlastOptionsHandle > opts_hndl, bool is_remote_search, CRef< blast::CLocalDbAdapter > &db_adapter, CRef< objects::CScope > &scope)
Initializes the subject/database as well as its scope.
string GetCmdlineArgs(const CNcbiArguments &a)
void BlastFormatter_PreFetchSequenceData(const blast::CSearchResultSet &results, CRef< CScope > scope, blast::CFormattingArgs::EOutputFormat format_type)
This method optimize the retrieval of sequence data to scope.
bool UseXInclude(const CFormattingArgs &f, const string &s)
bool IsIStreamEmpty(CNcbiIstream &in)
void LogQueryInfo(CBlastUsageReport &report, const CBlastInput &q_info)
Utility functions for BLAST command line applications.
#define CATCH_ALL(exit_code)
Standard catch statement for all BLAST command line programs.
#define BLAST_EXIT_SUCCESS
Command line binary exit code: success.
PSIDiagnosticsRequest * PSIDiagnosticsRequestNewEx(Boolean save_ascii_pssm)
Allocates a PSIDiagnosticsRequest structure, setting fields to their default values for their use in ...
Definition of classes which constitute the results of running a BLAST search.
const CSeq_id * GetFirstId() const
virtual CNcbiIstream & GetInputStream()
Get the input stream.
size_t GetNumThreads() const
Get the number of threads to spawn.
CRef< CBlastOptionsHandle > SetOptions(const CArgs &args)
Extract the command line arguments into a CBlastOptionsHandle object.
CRef< CBlastDatabaseArgs > GetBlastDatabaseArgs() const
Get the BLAST database arguments.
CArgDescriptions * SetCommandLine()
Set the command line arguments.
bool ExecuteRemotely() const
Determine whether the search should be executed remotely or not.
bool ProduceDebugRemoteOutput() const
Return whether debug (verbose) output should be produced on remote searches (only available when comp...
CRef< CQueryOptionsArgs > GetQueryOptionsArgs() const
Get the options for the query sequence(s)
string GetClientId() const
Retrieve the client ID for remote requests.
CRef< CFormattingArgs > GetFormattingArgs() const
Get the formatting options.
bool ProduceDebugOutput() const
Return whether debug (verbose) output should be produced on remote searches (only available when comp...
virtual CNcbiOstream & GetOutputStream()
Get the output stream.
Class to capture message from diag handler.
static const int kSubjectsDataLoaderPriority
The default priority for subjects, should be used for subjects/databases.
Encapsulates ALL the BLAST algorithm's options.
CRef< CBlastSearchQuery > GetBlastSearchQuery(size_type i) const
Get the CBlastSearchQuery object at index i.
void AddParam(EUsageParams p, int val)
Keeps track of the version of the BLAST engine in the NCBI C++ toolkit.
void DebugDumpText(ostream &out, const string &bundle, unsigned int depth) const
Handle command line arguments for deltablast binary.
size_t GetNumberOfPsiBlastIterations(void) const
Get number of PSI-BLAST iterations.
CNcbiOstream * GetCheckpointStream(void)
Get stream for saving Pssm.
bool GetSaveLastPssm(void) const
Should PSSM after last database search be saved.
virtual int GetQueryBatchSize(void) const
Get query batch size.
bool GetShowDomainHits(void) const
Was printing domain hits requested.
CNcbiOstream * GetAsciiPssmStream(void)
Get stream for saving ascii Pssm.
bool SaveAsciiPssm(void) const
Was saving ascii Pssm requested.
bool SaveCheckpoint(void) const
Was saving Pssm requested.
CRef< CSearchDatabase > GetDomainDatabase(void)
Get conserved domain database.
CRef< CPssmWithParameters > ComputePssmForNextPsiBlastIteration(const CBioseq &bioseq, CConstRef< CSeq_align_set > sset, CConstRef< CPSIBlastOptionsHandle > opts_handle, CRef< CScope > scope, CRef< CBlastAncillaryData > ancillary_data)
Compute PSSM for next PSI-BLAST iteration.
void SavePssmToFile(CConstRef< CPssmWithParameters > pssm)
Save Pssm to file.
CBlastUsageReport m_UsageReport
virtual void Init()
@inheritDoc
virtual int Run()
@inheritDoc
CDeltaBlastApp()
@inheritDoc
bool DoPsiBlastIterations(CRef< CBlastOptionsHandle > opts_hndl, CRef< CBlastQueryVector > query, CConstRef< CBioseq > query_bioseq, CRef< blast::CSearchResultSet > results, CRef< CBlastDatabaseArgs > db_args, const CArgs &args, CRef< CLocalDbAdapter > db_adapter, CRef< CScope > scope, CBlastFormat &formatter)
Do PSI-BLAST iterations follwing DELTA-BLAST.
CRef< CDeltaBlastAppArgs > m_CmdLineArgs
This application's command line args.
CBlastAppDiagHandler m_bah
CRef< CBlastAncillaryData > m_AncillaryData
Handle to the protein-protein options to the BLAST algorithm.
A simple realization of the DELTA-BLAST algorithm: seacrch domain database, compute PSSM,...
Interface to create a BlastSeqSrc suitable for use in CORE BLAST from a a variety of BLAST database/s...
NCBI C++ Object Manager dependant implementation of IQueryFactory.
Handle to the protein-protein options to the BLAST algorithm.
Wrapper class for PSIDiagnosticsRequest .
Represents the iteration state in PSI-BLAST.
Runs a single iteration of the PSI-BLAST algorithm on a BLAST database.
const CSeq_entry & GetQuery() const
Retrieve the query sequence.
CSeq_entry & SetQuery()
Retrieve the query sequence.
objects::ENa_strand GetStrand() const
Get strand to search in query sequence(s)
bool GetParseDeflines() const
Should the defline be parsed?
bool QueryIsProtein() const
Is the query sequence protein?
TSeqRange GetRange() const
Get query sequence range restriction.
bool UseLowercaseMasks() const
Use lowercase masking in FASTA input?
const string kArgOutput
Output file name.
void Print(const CCompactSAMApplication::AlignInfo &ai)
Declares CPsiBlast, the C++ API for the PSI-BLAST engine.
static void s_AddSeqDataToPssm(CRef< CPssmWithParameters > pssm, CRef< CBlastQueryVector > query_batch, CRef< CScope > scope)
int main(int argc, const char *argv[])
static void s_AddSeqTitleToPssm(CRef< CPssmWithParameters > pssm, CRef< CBlastQueryVector > query_batch, CRef< CScope > scope)
Main argument class for DELTA-BLAST application.
CRef< CSearchResultSet > Run()
Run the PSI-BLAST engine for one iteration.
CRef< objects::CPssmWithParameters > GetPSSM(void)
Get the PSSM produced by the search.
int GetDbGeneticCode() const
string GetDatabaseName() const
Returns the database name if appropriate, else kEmptyStr for subject sequences.
virtual void SetNumberOfThreads(size_t nthreads)
Mutator for the number of threads.
void ResetMessages(void)
Reset messgae buffer, erase all saved message.
unsigned int GetIterationNumber() const
Return the number of the current iteration.
TSeqIds GetPreviouslyFoundSeqIds() const
Retrieve the set of Seq-id's found in the previous iteration.
int GetFilteringAlgorithm()
Retrieve the database filtering algorithm.
void SetPssm(CConstRef< objects::CPssmWithParameters > pssm)
This method allows the same object to be reused when performing multiple iterations.
bool HasConverged()
Determines if the PSI-BLAST search has converged (i.e.
const CBlastOptions & GetOptions() const
Return the object which this object is a handle for.
int GetQueryGeneticCode() const
CRef< objects::CPssmWithParameters > PsiBlastComputePssmFromAlignment(const objects::CBioseq &query, CConstRef< objects::CSeq_align_set > alignment, CRef< objects::CScope > database_scope, const CPSIBlastOptionsHandle &opts_handle, CConstRef< CBlastAncillaryData > ancillary_data, PSIDiagnosticsRequest *diagnostics_req=0)
Computes a PSSM from the result of a PSI-BLAST iteration.
bool GetSumStatisticsMode() const
Sum statistics options.
CRef< CSearchResultSet > GetResultSet()
Submit the search (if necessary) and return the results.
void Advance(const TSeqIds &list)
Advance the iterator by passing it the list of Seq-ids which passed the inclusion criteria for the cu...
static void GetSeqIds(CConstRef< objects::CSeq_align_set > seqalign, CConstRef< CPSIBlastOptionsHandle > opts, TSeqIds &retval)
Extract the sequence ids from the sequence alignment which identify those sequences that will be used...
const char * GetMatrixName() const
list< CRef< objects::CBlast4_error > > & GetMessages(void)
Return list of saved diag messages.
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.
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.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
void SetDiagHandler(CDiagHandler *handler, bool can_delete=true)
Set the diagnostic handler using the specified diagnostic handler class.
@ eDiag_Warning
Warning message.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
#define MSerial_AsnText
I/O stream manipulators –.
bool Match(const CSeq_id &sid2) const
Match() - TRUE if SeqIds are equivalent.
void AddDataLoader(const string &loader_name, TPriority pri=kPriority_Default)
Add data loader by name.
CBioseq_Handle GetBioseqHandle(const CSeq_id &id)
Get bioseq handle by seq-id.
CConstRef< CBioseq > GetCompleteBioseq(void) const
Get the complete bioseq.
TObjectType * GetNonNullPointer(void)
Get pointer value and throw a null pointer exception if pointer is null.
bool Empty(void) const THROWS_NONE
Check if CConstRef is empty – not pointing to any object which means having a null value.
void Reset(void)
Reset reference object.
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CConstRef is not empty – pointing to an object and has a non-null value.
bool Empty(void) const THROWS_NONE
Check if CRef is empty – not pointing to any object, which means having a null value.
bool IsEnabled(void)
Indicates whether application usage statistics collection is enabled for a current reporter instance.
double Elapsed(void) const
Return time elapsed since first Start() or last Restart() call (in seconds).
void Start(void)
Start the timer.
const TQuery & GetQuery(void) const
Get the Query member data.
const TPssm & GetPssm(void) const
Get the Pssm member data.
const TSeq & GetSeq(void) const
Get the variant data.
TSeq & SetSeq(void)
Select the variant.
list< CRef< CSeqdesc > > Tdata
bool IsSetSeq_data(void) const
the sequence Check if a value has been assigned to Seq_data data member.
const TInst & GetInst(void) const
Get the Inst member data.
const Tdata & Get(void) const
Get the member data.
void SetInst(TInst &value)
Assign a value to Inst data member.
bool IsSetDescr(void) const
descriptors Check if a value has been assigned to Descr data member.
void SetDescr(TDescr &value)
Assign a value to Descr data member.
const TSeq_data & GetSeq_data(void) const
Get the Seq_data member data.
const TDescr & GetDescr(void) const
Get the Descr member data.
Defines the CNcbiApplication and CAppException classes for creating NCBI applications.
The NCBI C++/STL use hints.
NOTE: This file contains work in progress and the APIs are likely to change, please do not rely on th...
Declares CPsiBlast, the C++ API for the PSI-BLAST engine.
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.