NCBI C++ ToolKit
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
SDataLoaderConfig Struct Reference

Search Toolkit Book for SDataLoaderConfig

Configuration structure for the CBlastScopeSource. More...

#include <algo/blast/blastinput/blast_scope_src.hpp>

Public Types

enum  EConfigOpts { eUseBlastDbDataLoader = (0x1 << 0) , eUseGenbankDataLoader = (0x1 << 1) , eUseNoDataLoaders = (0x1 << 2) , eDefault = (eUseBlastDbDataLoader | eUseGenbankDataLoader) }
 Configuration options for the BlastScopeSource. More...
 

Public Member Functions

 SDataLoaderConfig (bool load_proteins, EConfigOpts options=eDefault)
 Constructor which relies on the configuration file to set the BLAST database to use. More...
 
 SDataLoaderConfig (const string &dbname, bool protein_data, EConfigOpts options=eDefault)
 Constructor which allows the specification of a BLAST database to use to initialize the BLAST DB data loader, without the option to override this at runtime via the configuration file. More...
 
void OptimizeForWholeLargeSequenceRetrieval (bool value=true)
 Configures the BLAST database data loader to optimize the retrieval of *entire* large sequences. More...
 
bool UseDataLoaders () const
 Determine whether either of the data loaders should be used. More...
 
bool operator== (const SDataLoaderConfig &rhs) const
 Equality operator. More...
 
bool operator!= (const SDataLoaderConfig &rhs) const
 Inequality operator. More...
 

Public Attributes

bool m_UseBlastDbs
 Use the BLAST database data loaders. More...
 
string m_BlastDbName
 Name of the BLAST database to use (non-empty if m_UseBlastDbs is true) More...
 
bool m_IsLoadingProteins
 Is this intended to load protein sequences. More...
 
bool m_UseGenbank
 Use the Genbank data loader. More...
 
bool m_UseFixedSizeSlices
 Argument to configure BLAST database data loader. More...
 

Static Public Attributes

static const char * kDefaultProteinBlastDb = "nr"
 Default protein BLAST database to use for the BLAST DB data loaders. More...
 
static const char * kDefaultNucleotideBlastDb = "nt"
 Default nucleotide BLAST database to use for the BLAST DB data loaders. More...
 

Private Member Functions

void x_Init (EConfigOpts options, const string &dbname, bool load_proteins)
 Initialization method. More...
 
void x_LoadDataLoadersConfig (const CNcbiRegistry &registry)
 Load the DATA_LOADERS configuration value from the config file. More...
 
void x_LoadBlastDbDataLoaderConfig (const CNcbiRegistry &registry)
 Load the BLAST database configured to search for the blastdb DATA_LOADERS option from the config file. More...
 

Detailed Description

Configuration structure for the CBlastScopeSource.

Note
the choice of data loaders to use to configure the scope as well as the BLAST database(s) to search if the BLAST database data loader is used can be configured in the NCBI configuration file, BLAST section. For details, refer to the section 'Configuring BLAST' in the BLAST+ user manual

Definition at line 57 of file blast_scope_src.hpp.

Member Enumeration Documentation

◆ EConfigOpts

Configuration options for the BlastScopeSource.

Enumerator
eUseBlastDbDataLoader 

Use the local BLAST database loader first, if this fails, use the remote BLAST database data loader.

eUseGenbankDataLoader 

Use the Genbank data loader.

eUseNoDataLoaders 

Do not add any data loaders.

eDefault 

Definition at line 65 of file blast_scope_src.hpp.

Constructor & Destructor Documentation

◆ SDataLoaderConfig() [1/2]

SDataLoaderConfig::SDataLoaderConfig ( bool  load_proteins,
EConfigOpts  options = eDefault 
)
inline

Constructor which relies on the configuration file to set the BLAST database to use.

Parameters
load_proteinsis this object going to load/read proteins only [in]
optionsconfiguration options [in]

Definition at line 81 of file blast_scope_src.hpp.

References kEmptyStr.

◆ SDataLoaderConfig() [2/2]

SDataLoaderConfig::SDataLoaderConfig ( const string dbname,
bool  protein_data,
EConfigOpts  options = eDefault 
)
inline

Constructor which allows the specification of a BLAST database to use to initialize the BLAST DB data loader, without the option to override this at runtime via the configuration file.

Parameters
dbnamename of BLAST database [in]
protein_datais this object going to load/read proteins only [in]
optionsconfiguration options [in]

Definition at line 93 of file blast_scope_src.hpp.

References dbname().

Member Function Documentation

◆ operator!=()

bool SDataLoaderConfig::operator!= ( const SDataLoaderConfig rhs) const

Inequality operator.

Definition at line 354 of file blast_scope_src.cpp.

◆ operator==()

bool SDataLoaderConfig::operator== ( const SDataLoaderConfig rhs) const

Equality operator.

Definition at line 333 of file blast_scope_src.cpp.

References m_BlastDbName, m_IsLoadingProteins, m_UseBlastDbs, and m_UseGenbank.

◆ OptimizeForWholeLargeSequenceRetrieval()

void SDataLoaderConfig::OptimizeForWholeLargeSequenceRetrieval ( bool  value = true)
inline

Configures the BLAST database data loader to optimize the retrieval of *entire* large sequences.

Note
This option only has effect upon a BLAST database data loader's first initialization. If this setting should change on the same BLAST database, the data loader must be revoked from the object manager (this can be achieved with CBlastScopeSource::RevokeBlastDbDataLoader()).
Parameters
valueTRUE to turn on, FALSE to turn off

Definition at line 106 of file blast_scope_src.hpp.

References rapidjson::value.

Referenced by BOOST_AUTO_TEST_CASE(), InitializeQueryDataLoaderConfiguration(), ReadSequencesToBlast(), CSeedTopApp::Run(), CIgBlastnApp::Run(), CIgBlastpApp::Run(), CRMBlastnApp::Run(), CVecScreenApp::Run(), CVDBBlastnApp::Run(), CVDBTblastnApp::Run(), s_ImportQueries(), CBlastFormatterApp::x_ExtractQueries(), and CBlastFormatterVdbApp::x_ExtractQueries().

◆ UseDataLoaders()

bool SDataLoaderConfig::UseDataLoaders ( ) const
inline

Determine whether either of the data loaders should be used.

Definition at line 111 of file blast_scope_src.hpp.

Referenced by CBlastFastaInputSource::x_InitInputReader().

◆ x_Init()

void SDataLoaderConfig::x_Init ( SDataLoaderConfig::EConfigOpts  options,
const string dbname,
bool  load_proteins 
)
private

Initialization method.

Parameters
optionsconfiguration options [in]
dbnamename of BLAST database [in]
load_proteinsis this object going to load/read proteins only [in]
Note
the database can be overridden at runtime by the DATA_LOADERS entry in the BLAST section of the NCBI configuration file. Allowed values are blastdb, genbank, and none. If this is changed, please update the BLAST+ user manual

Definition at line 55 of file blast_scope_src.cpp.

References dbname(), CNcbiApplicationAPI::GetConfig(), CNcbiApplication::Instance(), and registry.

◆ x_LoadBlastDbDataLoaderConfig()

void SDataLoaderConfig::x_LoadBlastDbDataLoaderConfig ( const CNcbiRegistry registry)
private

Load the BLAST database configured to search for the blastdb DATA_LOADERS option from the config file.

Definition at line 98 of file blast_scope_src.cpp.

References _ASSERT, IRegistry::Get(), IRegistry::HasEntry(), kDefaultNucleotideBlastDb, kDefaultProteinBlastDb, m_BlastDbName, m_IsLoadingProteins, m_UseBlastDbs, and registry.

◆ x_LoadDataLoadersConfig()

void SDataLoaderConfig::x_LoadDataLoadersConfig ( const CNcbiRegistry registry)
private

Load the DATA_LOADERS configuration value from the config file.

Definition at line 76 of file blast_scope_src.cpp.

References _TRACE, NStr::FindNoCase(), IRegistry::Get(), IRegistry::HasEntry(), m_UseBlastDbs, m_UseGenbank, NPOS, and registry.

Member Data Documentation

◆ kDefaultNucleotideBlastDb

const char * SDataLoaderConfig::kDefaultNucleotideBlastDb = "nt"
static

Default nucleotide BLAST database to use for the BLAST DB data loaders.

Definition at line 62 of file blast_scope_src.hpp.

Referenced by x_LoadBlastDbDataLoaderConfig().

◆ kDefaultProteinBlastDb

const char * SDataLoaderConfig::kDefaultProteinBlastDb = "nr"
static

Default protein BLAST database to use for the BLAST DB data loaders.

Definition at line 60 of file blast_scope_src.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), and x_LoadBlastDbDataLoaderConfig().

◆ m_BlastDbName

string SDataLoaderConfig::m_BlastDbName

Name of the BLAST database to use (non-empty if m_UseBlastDbs is true)

Definition at line 116 of file blast_scope_src.hpp.

Referenced by BOOST_AUTO_TEST_CASE(), CBlastScopeSource::CBlastScopeSource(), InitializeQueryDataLoaderConfiguration(), operator==(), s_RetrieveSequenceLength(), and x_LoadBlastDbDataLoaderConfig().

◆ m_IsLoadingProteins

bool SDataLoaderConfig::m_IsLoadingProteins

Is this intended to load protein sequences.

Definition at line 119 of file blast_scope_src.hpp.

Referenced by CBlastScopeSource::CBlastScopeSource(), operator==(), and x_LoadBlastDbDataLoaderConfig().

◆ m_UseBlastDbs

bool SDataLoaderConfig::m_UseBlastDbs

◆ m_UseFixedSizeSlices

bool SDataLoaderConfig::m_UseFixedSizeSlices

Argument to configure BLAST database data loader.

Definition at line 130 of file blast_scope_src.hpp.

Referenced by CBlastScopeSource::x_InitBlastDatabaseDataLoader().

◆ m_UseGenbank

bool SDataLoaderConfig::m_UseGenbank

The documentation for this struct was generated from the following files:
Modified on Thu May 23 12:30:03 2024 by modify_doxy.py rev. 669887