NCBI C++ ToolKit
|
Implementation for the CSeqDB class, the top level class for SeqDB. More...
#include <ncbi_pch.hpp>
#include <objtools/blast/seqdb_reader/seqdb.hpp>
#include <util/sequtil/sequtil_convert.hpp>
#include "seqdbimpl.hpp"
#include <objtools/blast/seqdb_reader/impl/seqdbgeneral.hpp>
#include <map>
#include <string>
#include <serial/objistr.hpp>
#include <serial/objostr.hpp>
#include <serial/serial.hpp>
#include <serial/objostrasnb.hpp>
#include <serial/objistrasnb.hpp>
#include <objects/general/Object_id.hpp>
#include <objects/general/User_object.hpp>
#include <objects/general/User_field.hpp>
#include <objects/general/Dbtag.hpp>
Go to the source code of this file.
Go to the SVN repository for this file.
Classes | |
class | CBlastDbFinder |
Functor class for FindFilesInDir. More... | |
class | PathFinder |
Functor object for s_RemoveAliasComponents where the path name is matched in SSeqDBInitInfo. More... | |
Functions | |
static char | s_GetSeqTypeChar (CSeqDB::ESeqType seqtype) |
Helper function to translate enumerated type to character. More... | |
static CSeqDBImpl * | s_SeqDBInit (const string &dbname, char prot_nucl, int oid_begin, int oid_end, bool use_atlas_lock, CSeqDBGiList *gi_list=NULL, CSeqDBNegativeList *neg_list=NULL, CSeqDBIdSet idset=CSeqDBIdSet()) |
Helper function to build private implementation object. More... | |
static void | s_RemoveAliasComponents (CBlastDbFinder &finder) |
vector< SSeqDBInitInfo > | FindBlastDBs (const string &path, const string &dbtype, bool recurse, bool include_alias_files, bool remove_redundant_dbs) |
Find BLAST DBs in the directory specified. More... | |
CSeqDB::ESeqType | ParseMoleculeTypeString (const string &s) |
Convert a string to a CSeqDB ESeqType object. More... | |
bool | DeleteBlastDb (const string &dbpath, CSeqDB::ESeqType seq_type) |
Deletes all files associated with a BLAST database. More... | |
bool DeleteBlastDb | ( | const string & | dbpath, |
CSeqDB::ESeqType | seq_type | ||
) |
Deletes all files associated with a BLAST database.
dbpath | BLAST database file path [in] |
seq_type | Sequence type [in] |
Definition at line 1542 of file seqdb.cpp.
References eBDB_Version4, CSeqDB::eProtein, f(), CSeqDB::FindVolumePaths(), Info(), NStr::IntToString(), ITERATE, LOG_POST, CDirEntry::Remove(), SeqDB_GetFileExtensions(), and SeqDB_GetLMDBFileExtensions().
Referenced by BOOST_AUTO_TEST_CASE(), CBuildDatabase::CBuildDatabase(), CBlastdbConvertApp::Run(), BlastdbCopyApplication::Run(), and s_DeleteMakeprofileDb().
vector<SSeqDBInitInfo> FindBlastDBs | ( | const string & | path, |
const string & | dbtype, | ||
bool | recurse, | ||
bool | include_alias_files = false , |
||
bool | remove_redundant_dbs = false |
||
) |
Find BLAST DBs in the directory specified.
path | directory to search BLAST DBs [in] |
dbtype | BLAST DB molecule type, allowed values are 'prot', 'nucl', and 'guess' (which means any) [in] |
recurse | whether BLAST DBs should be found recursively or not [in] |
include_alias_files | Should alias files be included also? [in] |
remove_redundant_dbs | Should BLASTDBs that are referenced by other alias files in the return value be removed? [in] |
Definition at line 1429 of file seqdb.cpp.
References fFF_File, fFF_Recursive, FindFilesInDir(), flags, CBlastDbFinder::m_DBs, s_RemoveAliasComponents(), and ct::sort().
Referenced by CDirTest::Test().
CSeqDB::ESeqType ParseMoleculeTypeString | ( | const string & | str | ) |
Convert a string to a CSeqDB ESeqType object.
str | string containing the molecule type (e.g.: prot, nucl, guess) |
Definition at line 1527 of file seqdb.cpp.
References _ASSERT, NStr::eNocase, CSeqDB::eNucleotide, CSeqDB::eProtein, CSeqDB::eUnknown, and NStr::StartsWith().
Referenced by CBuildDatabase::CBuildDatabase(), CBlastdbConvertApp::Run(), BlastdbCopyApplication::Run(), CDbTest::Test(), CBlastDBCmdApp::x_InitBlastDB(), and CBlastDBCmdApp::x_InitBlastDB_TaxIdList().
|
static |
Helper function to translate enumerated type to character.
seqtype | The sequence type (eProtein, eNucleotide, or eUnknown). |
Definition at line 62 of file seqdb.cpp.
References CSeqDB::eNucleotide, CSeqDB::eProtein, CSeqDB::eUnknown, and NCBI_THROW.
Referenced by CSeqDB::CSeqDB().
|
static |
Definition at line 1397 of file seqdb.cpp.
References NStr::fSplit_MergeDelimiters, NStr::fSplit_Truncate, CBlastDbFinder::GetFileName(), i, in(), set< Key, Compare >::insert(), ITERATE, CBlastDbFinder::m_DBs, remove_if(), NStr::Split(), and NStr::StartsWith().
Referenced by FindBlastDBs().
|
static |
Helper function to build private implementation object.
This method builds and returns the object which implements the functionality for the CSeqDB API. If this method is called with '-' for the sequence data type, protein will be tried first, then nucleotide. The created object will be returned. Either kSeqTypeProt for a protein database, kSeqTypeNucl for nucleotide, or kSeqTypeUnkn to less this function try one then the other.
dbname | A list of database or alias names, seperated by spaces. |
prot_nucl | Specify whether to use protein, nucleotide, or either. |
oid_begin | Iterator will skip OIDs less than this value. Only OIDs found in the OID lists (if any) will be returned. |
oid_end | Iterator will return up to (but not including) this OID. |
use_mmap | If kSeqDBMMap is specified (the default), memory mapping is attempted. If kSeqDBNoMMap is specified, or memory mapping fails, this platform does not support it, the less efficient read and write calls are used instead. |
gi_list | This ID list specifies OIDs and deflines to include. |
neg_list | This negative ID list specifies deflines and OIDs to exclude. |
idset | If set, this specifies IDs to either include or exclude. |
Definition at line 111 of file seqdb.cpp.
References _ASSERT, and dbname().
Referenced by CSeqDB::CSeqDB().