NCBI C++ ToolKit
|
Utility functions for BLAST command line applications. More...
#include <ncbi_pch.hpp>
#include "blast_app_util.hpp"
#include <serial/serial.hpp>
#include <serial/objostr.hpp>
#include <objtools/data_loaders/blastdb/bdbloader.hpp>
#include <algo/blast/api/remote_blast.hpp>
#include <algo/blast/api/objmgr_query_data.hpp>
#include <algo/blast/api/blast_options_builder.hpp>
#include <algo/blast/api/search_strategy.hpp>
#include <algo/blast/blastinput/blast_input.hpp>
#include <algo/blast/blastinput/psiblast_args.hpp>
#include <algo/blast/blastinput/tblastn_args.hpp>
#include <algo/blast/blastinput/blast_scope_src.hpp>
#include <objmgr/util/sequence.hpp>
#include <objects/scoremat/Pssm.hpp>
#include <serial/typeinfo.hpp>
#include <objtools/data_loaders/blastdb/bdbloader_rmt.hpp>
#include <algo/blast/format/blast_format.hpp>
#include <objtools/align_format/format_flags.hpp>
Go to the source code of this file.
Go to the SVN repository for this file.
Functions | |
USING_SCOPE (objects) | |
USING_SCOPE (blast) | |
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. More... | |
blast::SDataLoaderConfig | InitializeQueryDataLoaderConfiguration (bool query_is_protein, CRef< blast::CLocalDbAdapter > db_adapter) |
Initialize the data loader configuration for the query. More... | |
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. More... | |
string | RegisterOMDataLoader (CRef< CSeqDB > db_handle) |
Register the BLAST database data loader using the already initialized CSeqDB object. More... | |
static CRef< blast::CExportStrategy > | s_InitializeExportStrategy (CRef< blast::IQueryFactory > queries, CRef< blast::CBlastDatabaseArgs > db_args, CRef< blast::CBlastOptionsHandle > opts_hndl, const string &client_id, CRef< objects::CPssmWithParameters > pssm, unsigned int num_iters) |
static void | s_ExportSearchStrategy (CNcbiOstream *out, CRef< blast::IQueryFactory > queries, CRef< blast::CBlastOptionsHandle > options_handle, CRef< blast::CBlastDatabaseArgs > db_args, CRef< objects::CPssmWithParameters > pssm, unsigned int num_iters) |
Real implementation of search strategy extraction. More... | |
static TSeqLocVector | s_ConvertBioseqs2TSeqLocVector (const CBlast4_subject::TSequences &subjects) |
Converts a list of Bioseqs into a TSeqLocVector. More... | |
static void | s_ImportPssm (const CBlast4_queries &queries, CRef< blast::CBlastOptionsHandle > opts_hndl, blast::CBlastAppArgs *cmdline_args) |
Import PSSM into the command line arguments object. More... | |
static void | s_ImportQueries (const CBlast4_queries &queries, CRef< blast::CBlastOptionsHandle > opts_hndl, blast::CBlastAppArgs *cmdline_args) |
Import queries into command line arguments object. More... | |
static CRef< blast::CBlastDatabaseArgs > | s_ImportDatabase (const CBlast4_subject &subj, CBlastOptionsBuilder &opts_builder, bool subject_is_protein, bool is_remote_search) |
Import the database and return it in a CBlastDatabaseArgs object. More... | |
static CRef< blast::CBlastDatabaseArgs > | s_ImportSubjects (const CBlast4_subject &subj, bool subject_is_protein) |
Import the subject sequences into a CBlastDatabaseArgs object. More... | |
static void | s_ImportSearchStrategy (CNcbiIstream *in, blast::CBlastAppArgs *cmdline_args, bool is_remote_search, bool override_query, bool override_subject) |
Imports search strategy, using CImportStrategy. More... | |
bool | RecoverSearchStrategy (const CArgs &args, blast::CBlastAppArgs *cmdline_args) |
Recover search strategy from input file. More... | |
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. More... | |
static void | s_ExtractSeqidsAndRanges (const blast::CSearchResultSet &results, CScope::TIds &ids, vector< TSeqRange > &ranges) |
Extracts the subject sequence IDs and ranges from the BLAST results. More... | |
static bool | s_IsUsingRemoteBlastDbDataLoader () |
Returns true if the remote BLAST DB data loader is being used. More... | |
static bool | s_IsPrefetchFormat (blast::CFormattingArgs::EOutputFormat format_type) |
static bool | s_PreFetchSeqs (const blast::CSearchResultSet &results, blast::CFormattingArgs::EOutputFormat format_type) |
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. More... | |
CRef< CBlastAncillaryData > | ExtractPssmAncillaryData (const CPssmWithParameters &pssm) |
Auxiliary function to extract the ancillary data from the PSSM. More... | |
void | CheckForFreqRatioFile (const string &rps_dbname, CRef< CBlastOptionsHandle > &opt_handle, bool isRpsblast) |
bool | IsIStreamEmpty (CNcbiIstream &in) |
string | GetCmdlineArgs (const CNcbiArguments &a) |
bool | UseXInclude (const CFormattingArgs &f, const string &s) |
string | GetSubjectFile (const CArgs &args) |
Get name of subject file @parameter args arguments class [in]. More... | |
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. More... | |
void | QueryBatchCleanup () |
Clean up formatter scope and release. More... | |
void | LogQueryInfo (CBlastUsageReport &report, const CBlastInput &q_info) |
void | LogBlastOptions (blast::CBlastUsageReport &report, const CBlastOptions &opt) |
void | LogCmdOptions (blast::CBlastUsageReport &report, const CBlastAppArgs &args) |
int | GetMTByQueriesBatchSize (EProgram p, int num_threads, const string &task) |
void | MTByQueries_DBSize_Warning (const Int8 length_limit, bool is_db_protein) |
void | CheckMTByQueries_QuerySize (EProgram prog, int batch_size) |
Utility functions for BLAST command line applications.
Definition in file blast_app_util.cpp.
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.
results | BLAST results [in] |
scope | CScope object from which the sequence data will be fetched [in] |
format_type | Blast output fomat type |
Definition at line 756 of file blast_app_util.cpp.
References _ASSERT, _TRACE, ERR_POST, LoadSequencesToScope(), CRef< C, Locker >::NotEmpty(), results, s_ExtractSeqidsAndRanges(), s_IsUsingRemoteBlastDbDataLoader(), s_PreFetchSeqs(), and Warning().
Referenced by CPsiBlastApp::DoIterations(), CDeltaBlastApp::DoPsiBlastIterations(), CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CIgBlastnApp::CIgFormatter::Main(), CBlastFormatterApp::PrintFormattedOutput(), CDeltaBlastApp::Run(), CTblastxApp::Run(), CIgBlastpApp::Run(), CPsiBlastApp::x_RunLocalPsiBlastIterations(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
void CheckForFreqRatioFile | ( | const string & | rps_dbname, |
CRef< CBlastOptionsHandle > & | opt_handle, | ||
bool | isRpsblast | ||
) |
Definition at line 806 of file blast_app_util.cpp.
References eNoCompositionBasedStats, CSeqDB::eProtein, ERR_POST, f, CSeqDB::FindVolumePaths(), CBlastOptions::GetCompositionBasedStats(), CBlastOptionsHandle::GetOptions(), i, NStr::Join(), msg(), NCBI_RETHROW, CBlastOptions::SetCompositionBasedStats(), CBlastOptionsHandle::SetOptions(), NStr::Split(), and Warning().
Referenced by CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), and CRPSBlastApp::x_RunMTBySplitDB().
Definition at line 1013 of file blast_app_util.cpp.
References Blast_QueryIsProtein(), EProgramToEBlastProgramType(), ERR_POST, NStr::IntToString(), prog, and Warning().
Referenced by CRPSBlastApp::x_RunMTBySplitQuery(), and CRPSTBlastnApp::x_RunMTBySplitQuery().
CRef<CBlastAncillaryData> ExtractPssmAncillaryData | ( | const CPssmWithParameters & | pssm | ) |
Auxiliary function to extract the ancillary data from the PSSM.
Definition at line 791 of file blast_app_util.cpp.
References _ASSERT, CPssmWithParameters_Base::CanGetPssm(), CPssm::GetH(), CPssm::GetHUngapped(), CPssm::GetKappa(), CPssm::GetKappaUngapped(), CPssm::GetLambda(), CPssm::GetLambdaUngapped(), CPssmWithParameters_Base::GetPssm(), and lambda().
Referenced by CDeltaBlastApp::SavePssmToFile(), and CPsiBlastApp::SavePssmToFile().
string GetCmdlineArgs | ( | const CNcbiArguments & | a | ) |
Definition at line 877 of file blast_app_util.cpp.
References a, cmd, i, and kEmptyStr.
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CBlastFormatterApp::PrintFormattedOutput(), CBlastFormatterVdbApp::PrintFormattedOutput(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
Definition at line 980 of file blast_app_util.cpp.
References GetQueryBatchSize(), and NStr::StringToInt().
Referenced by CBlastnApp::x_RunMTBySplitQuery(), CBlastpApp::x_RunMTBySplitQuery(), CBlastxApp::x_RunMTBySplitQuery(), and CTblastnApp::x_RunMTBySplitQuery().
Get name of subject file @parameter args arguments class [in].
Definition at line 902 of file blast_app_util.cpp.
References CArgs::Exist(), and kArgSubject.
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CTblastnNode::Main(), CTblastxApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
blast::SDataLoaderConfig InitializeQueryDataLoaderConfiguration | ( | bool | query_is_protein, |
CRef< blast::CLocalDbAdapter > | db_adapter | ||
) |
Initialize the data loader configuration for the query.
query_is_protein | is/are the query sequence(s) protein? [in] |
db_adapter | the database/subject information [in] |
Definition at line 128 of file blast_app_util.cpp.
References _TRACE, SDataLoaderConfig::m_BlastDbName, SDataLoaderConfig::m_UseBlastDbs, SDataLoaderConfig::m_UseGenbank, SDataLoaderConfig::OptimizeForWholeLargeSequenceRetrieval(), and NStr::Split().
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
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 = kEmptyStr , |
||
CRef< objects::CPssmWithParameters > | pssm = CRef< objects::CPssmWithParameters >() |
||
) |
Initializes a CRemoteBlast instance for usage by command line BLAST binaries.
queries | query sequence(s) or NULL in case of PSSM input [in] |
db_args | database/subject arguments [in] |
opts_hndl | BLAST options handle [in] |
verbose_output | set to true if CRemoteBlast should produce verbose output [in] |
pssm | PSSM to use for single iteration remote PSI-BLAST |
CInputException | in case of remote PSI-BL2SEQ, as it's not supported |
Definition at line 84 of file blast_app_util.cpp.
References _ASSERT, CRef< C, Locker >::Empty(), kEmptyStr, NCBI_THROW, CRef< C, Locker >::NotEmpty(), CRef< C, Locker >::Reset(), CRemoteBlast::SetClientId(), and CRemoteBlast::SetVerbose().
Referenced by CPsiBlastApp::DoIterations(), CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CDeltaBlastApp::Run(), CTblastxApp::Run(), CRMBlastnApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
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.
db_args | database/subject arguments [in] |
opts_hndl | BLAST options handle [in] |
is_remote_search | true if it's a remote search, otherwise false [in] |
db_adapter | Database/subject adapter [out] |
scope | subject scope [out] |
Definition at line 163 of file blast_app_util.cpp.
References _ASSERT, _TRACE, CBlastScopeSource::AddDataLoaders(), Blast_SubjectIsProtein(), CRef< C, Locker >::Empty(), CSearchDatabase::GetDatabaseName(), CObjectManager::GetInstance(), CSearchDatabase::GetSeqDb(), kEmptyStr, CBlastDatabaseArgs::kSubjectsDataLoaderPriority, CBlastScopeSource::NewScope(), CRef< C, Locker >::NotEmpty(), RegisterOMDataLoader(), CRef< C, Locker >::Reset(), and true.
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CIgBlastnApp::CIgWorker::Main(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CIgBlastnApp::Run(), CIgBlastpApp::Run(), CRMBlastnApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
bool IsIStreamEmpty | ( | CNcbiIstream & | in | ) |
Definition at line 845 of file blast_app_util.cpp.
References in().
Referenced by CBlastnNode::Main(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CTblastnApp::x_RunMTBySplitDB(), CBlastnApp::x_RunMTBySplitQuery(), CBlastpApp::x_RunMTBySplitQuery(), CBlastxApp::x_RunMTBySplitQuery(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), and CTblastnApp::x_RunMTBySplitQuery().
void LogBlastOptions | ( | blast::CBlastUsageReport & | report, |
const CBlastOptions & | opt | ||
) |
Definition at line 946 of file blast_app_util.cpp.
References Blast_ProgramIsNucleotide(), Blast_ProgramNameFromType(), CBlastUsageReport::eCompBasedStats, CBlastUsageReport::eEvalueThreshold, CBlastUsageReport::eHitListSize, CBlastUsageReport::eProgram, CBlastOptions::GetCompositionBasedStats(), CBlastOptions::GetEvalueThreshold(), CBlastOptions::GetHitlistSize(), and CBlastOptions::GetProgramType().
Referenced by CBlastnApp::x_RunMTBySplitQuery(), CBlastpApp::x_RunMTBySplitQuery(), CBlastxApp::x_RunMTBySplitQuery(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), and CTblastnApp::x_RunMTBySplitQuery().
void LogCmdOptions | ( | blast::CBlastUsageReport & | report, |
const CBlastAppArgs & | args | ||
) |
Definition at line 957 of file blast_app_util.cpp.
References CBlastUsageReport::eDBDate, CBlastUsageReport::eDBLength, CBlastUsageReport::eDBName, CBlastUsageReport::eDBNumSeqs, CBlastUsageReport::eOutputFmt, CBlastAppArgs::GetBlastDatabaseArgs(), CSeqDB::GetDate(), CSeqDB::GetDBNameList(), CFormattingArgs::GetFormattedOutputChoice(), CBlastAppArgs::GetFormattingArgs(), CSeqDB::GetNumSeqs(), CDirEntry::GetPathSeparator(), CBlastDatabaseArgs::GetSearchDatabase(), CSearchDatabase::GetSeqDb(), CSeqDB::GetTotalLength(), and CRef< C, Locker >::NotEmpty().
Referenced by CBlastnApp::x_RunMTBySplitQuery(), CBlastpApp::x_RunMTBySplitQuery(), CBlastxApp::x_RunMTBySplitQuery(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), and CTblastnApp::x_RunMTBySplitQuery().
void LogQueryInfo | ( | CBlastUsageReport & | report, |
const CBlastInput & | q_info | ||
) |
Definition at line 939 of file blast_app_util.cpp.
References CBlastUsageReport::AddParam(), CBlastUsageReport::eNumQueries, CBlastUsageReport::eTotalQueryLength, CBlastInput::GetNumSeqsProcessed(), and CBlastInput::GetTotalLengthProcessed().
Referenced by CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
Definition at line 998 of file blast_app_util.cpp.
References ERR_POST, NStr::fWithCommas, NStr::Int8ToString(), and Warning().
Referenced by CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), and CTblastnApp::Run().
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.
a | cmdline args [in] |
msg | list of errors and warning to be added to blast4 archive for printing |
Definition at line 912 of file blast_app_util.cpp.
References a, CFormattingArgs::eArchiveFormat, info, kArgOutput, kArgOutputFormat, msg(), CBlastFormat::PrintArchive(), results, CBlast4_request_Base::SetBody(), CBlast4_archive_Base::SetMessages(), CBlast4_archive_Base::SetRequest(), CBlast4_archive_Base::SetResults(), NStr::StringToInt(), and NStr::TruncateSpaces().
Referenced by CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastnApp::Run(), CTblastxApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CTblastnApp::x_RunMTBySplitDB(), CBlastnApp::x_RunMTBySplitQuery(), CBlastpApp::x_RunMTBySplitQuery(), CBlastxApp::x_RunMTBySplitQuery(), CRPSBlastApp::x_RunMTBySplitQuery(), CRPSTBlastnApp::x_RunMTBySplitQuery(), and CTblastnApp::x_RunMTBySplitQuery().
void QueryBatchCleanup | ( | ) |
Clean up formatter scope and release.
Definition at line 930 of file blast_app_util.cpp.
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
Recover search strategy from input file.
args | the command line arguments provided by the application [in] |
cmdline_args | output command line arguments. Will have the database arguments set, as well as options handle [in|out] @Return true if recovered from save search strategy |
Definition at line 608 of file blast_app_util.cpp.
References ERR_POST, CArgs::Exist(), CBlastDatabaseArgs::HasBeenSet(), CMbIndexArgs::HasBeenSet(), in(), kArgQuery, kArgRemote, kArgUseIndex, kDfltArgQuery, kDfltArgUseIndex, s_ImportSearchStrategy(), and Warning().
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CBlastnApp::Run(), CBlastpApp::Run(), CBlastxApp::Run(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastnApp::Run(), CTblastxApp::Run(), CRMBlastnApp::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitQuery(), and CRPSTBlastnApp::x_RunMTBySplitQuery().
Register the BLAST database data loader using the already initialized CSeqDB object.
db_handle | properly initialized CSeqDB instance [in] |
Definition at line 246 of file blast_app_util.cpp.
References _TRACE, CObjectManager::eDefault, CObjectManager::GetInstance(), CBlastDbDataLoader::GetLoaderNameFromArgs(), CBlastDatabaseArgs::kSubjectsDataLoaderPriority, om, and CBlastDbDataLoader::RegisterInObjectManager().
Referenced by InitializeSubject(), CDeltaBlastApp::Run(), CSeedTopApp::Run(), and s_InitializeSubject().
|
static |
Converts a list of Bioseqs into a TSeqLocVector.
All Bioseqs are added to the same CScope object
subjects | Bioseqs to convert |
Definition at line 355 of file blast_app_util.cpp.
References CScope::AddBioseq(), CSeq_id::BestRank(), FindBestChoice(), CObjectManager::GetInstance(), and ITERATE.
Referenced by s_ImportSubjects().
|
static |
Real implementation of search strategy extraction.
Definition at line 319 of file blast_app_util.cpp.
References _ASSERT, CBlastException::eNotSupported, CException::GetErrCode(), kEmptyStr, NCBI_THROW, out(), and s_InitializeExportStrategy().
Referenced by SaveSearchStrategy().
|
static |
Extracts the subject sequence IDs and ranges from the BLAST results.
Definition at line 659 of file blast_app_util.cpp.
References _ASSERT, eNa_strand_minus, eNa_strand_plus, CSeq_id_Handle::GetHandle(), ITERATE, r(), compile_time_bits::range(), result, results, CRange_Base::SetFrom(), and COpenRange< Position >::SetToOpen().
Referenced by BlastFormatter_PreFetchSequenceData().
|
static |
Import the database and return it in a CBlastDatabaseArgs object.
Definition at line 444 of file blast_app_util.cpp.
References _ASSERT, CSeqDBGiList::AddGi(), CSeqDBGiList::AddTaxIds(), dbname(), CSearchDatabase::eBlastDbIsNucleotide, CSearchDatabase::eBlastDbIsProtein, eSoftSubjMasking, CBlast4_subject_Base::GetDatabase(), CBlastOptionsBuilder::GetDbFilteringAlgorithmId(), CBlastOptionsBuilder::GetDbFilteringAlgorithmKey(), CBlastOptionsBuilder::GetEntrezQuery(), CBlastOptionsBuilder::GetGiList(), CBlastOptionsBuilder::GetNegativeGiList(), CBlastOptionsBuilder::GetNegativeTaxidList(), CBlastOptionsBuilder::GetSubjectMaskingType(), CBlastOptionsBuilder::GetTaxidList(), CBlastOptionsBuilder::HasDbFilteringAlgorithmId(), CBlastOptionsBuilder::HasDbFilteringAlgorithmKey(), CBlastOptionsBuilder::HasSubjectMaskingType(), CBlastOptionsBuilder::HaveEntrezQuery(), CBlastOptionsBuilder::HaveGiList(), CBlastOptionsBuilder::HaveNegativeGiList(), CBlastOptionsBuilder::HaveNegativeTaxidList(), CBlastOptionsBuilder::HaveTaxidList(), CBlast4_subject_Base::IsDatabase(), ITERATE, msg(), CSearchDatabase::SetEntrezQueryLimitation(), CSearchDatabase::SetFilteringAlgorithm(), CSearchDatabase::SetGiList(), CSearchDatabase::SetNegativeGiList(), CBlastDatabaseArgs::SetSearchDatabase(), and string.
Referenced by s_ImportSearchStrategy().
|
static |
Import PSSM into the command line arguments object.
Definition at line 372 of file blast_app_util.cpp.
References Blast_ProgramNameFromType(), CBlast4_queries_Base::GetPssm(), msg(), NCBI_THROW, NULL, CPsiBlastAppArgs::SetInputPssm(), and CTblastnAppArgs::SetInputPssm().
Referenced by s_ImportSearchStrategy().
|
static |
Import queries into command line arguments object.
Definition at line 396 of file blast_app_util.cpp.
References _ASSERT, CTmpFile::AsOutputFile(), Blast_QueryIsProtein(), CFastaOstream::eAssembleParts, CTmpFile::eIfExists_Throw, CTmpFile::eNoRemove, CBlast4_queries_Base::GetBioseq_set(), CScope::GetBioseqHandle(), CTmpFile::GetFileName(), CBlast4_queries_Base::GetSeq_loc_list(), CBioseq_set_Base::GetSeq_set(), CBlast4_queries_Base::IsBioseq_set(), CBlast4_queries_Base::IsSeq_loc_list(), ITERATE, CBlastScopeSource::NewScope(), SDataLoaderConfig::OptimizeForWholeLargeSequenceRetrieval(), out(), prog, CRef< C, Locker >::Reset(), and CBlastScopeSource::RevokeBlastDbDataLoader().
Referenced by s_ImportSearchStrategy().
|
static |
Imports search strategy, using CImportStrategy.
Definition at line 533 of file blast_app_util.cpp.
References _ASSERT, _TRACE, Blast_SubjectIsProtein(), BlastNumber2Program(), ERR_POST, ExtractBlast4Request(), COpenRange< TSeqPos >::GetEmpty(), in(), CBlast4_subject_Base::IsDatabase(), CBlast4_queries_Base::IsPssm(), NCBI_THROW, CRef< C, Locker >::NotEmpty(), prog, s_ImportDatabase(), s_ImportPssm(), s_ImportQueries(), s_ImportSubjects(), sfree, true, and Warning().
Referenced by RecoverSearchStrategy().
|
static |
Import the subject sequences into a CBlastDatabaseArgs object.
Definition at line 519 of file blast_app_util.cpp.
References _ASSERT, CBlast4_subject_Base::GetSequences(), CBlast4_subject_Base::IsSequences(), s_ConvertBioseqs2TSeqLocVector(), and CBlastDatabaseArgs::SetSubjects().
Referenced by s_ImportSearchStrategy().
|
static |
Definition at line 264 of file blast_app_util.cpp.
References _ASSERT, CRef< C, Locker >::Empty(), NCBI_THROW, CRef< C, Locker >::NotEmpty(), and CRef< C, Locker >::Reset().
Referenced by s_ExportSearchStrategy().
|
static |
Definition at line 716 of file blast_app_util.cpp.
References CFormattingArgs::eArchiveFormat, CFormattingArgs::eAsnBinary, CFormattingArgs::eAsnText, and CFormattingArgs::eJsonSeqalign.
Referenced by s_PreFetchSeqs().
Returns true if the remote BLAST DB data loader is being used.
Definition at line 703 of file blast_app_util.cpp.
References CObjectManager::GetInstance(), CObjectManager::GetRegisteredNames(), ITERATE, and NStr::StartsWith().
Referenced by BlastFormatter_PreFetchSequenceData().
|
static |
Definition at line 728 of file blast_app_util.cpp.
References i, results, s_IsPrefetchFormat(), and NStr::StringToInt().
Referenced by BlastFormatter_PreFetchSequenceData().
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.
Definition at line 636 of file blast_app_util.cpp.
References out(), and s_ExportSearchStrategy().
Referenced by CPsiBlastApp::DoIterations(), CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CDeltaBlastApp::Run(), CTblastxApp::Run(), CRMBlastnApp::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
bool UseXInclude | ( | const CFormattingArgs & | f, |
const string & | s | ||
) |
Definition at line 887 of file blast_app_util.cpp.
References CFormattingArgs::eJson, CFormattingArgs::eXml2, f, and NCBI_THROW.
Referenced by CBlastnNode::Main(), CBlastpNode::Main(), CBlastxNode::Main(), CRPSBlastNode::Main(), CRPSTBlastnNode::Main(), CTblastnNode::Main(), CBlastFormatterApp::PrintFormattedOutput(), CBlastFormatterVdbApp::PrintFormattedOutput(), CDeltaBlastApp::Run(), CPsiBlastApp::Run(), CTblastxApp::Run(), CVDBBlastnApp::Run(), CBlastnApp::x_RunMTBySplitDB(), CBlastpApp::x_RunMTBySplitDB(), CBlastxApp::x_RunMTBySplitDB(), CRPSBlastApp::x_RunMTBySplitDB(), CRPSTBlastnApp::x_RunMTBySplitDB(), and CTblastnApp::x_RunMTBySplitDB().
USING_SCOPE | ( | blast | ) |
USING_SCOPE | ( | objects | ) |