use_fixed_size_slices,
70 booluse_fixed_size_slices,
108 default:
return "Unknown";
136 booluse_fixed_size_slices)
137: m_DbName(db_name), m_DbType(db_type),
138m_UseFixedSizeSlices(use_fixed_size_slices), m_BlastDbHandle(0)
142 booluse_fixed_size_slices)
144m_BlastDbHandle = db_handle;
170 returnthread_id + db_handle->GetDBNameList() +
174 return kPrefix+ db_handle->GetDBNameList() +
271cached->RegisterIds(
m_Ids);
278cached->SplitSeqData(chunks);
300 _ASSERT(ids.size() == loaded.size());
301 _ASSERT(ids.size() == ret.size());
303 for(CDataLoader::TIds::size_type
i= 0;
i< ids.size();
i++) {
324 _ASSERT(ids.size() == loaded.size());
325 _ASSERT(ids.size() == ret.size());
327 for(CDataLoader::TIds::size_type
i= 0;
i< ids.size();
i++) {
348 _ASSERT(ids.size() == loaded.size());
349 _ASSERT(ids.size() == ret.size());
356ret.assign(ids.size(), retval);
357loaded.assign(ids.size(),
true);
368 TSeqPosstart = it->second.GetFrom();
369 TSeqPosend = it->second.GetToOpen();
468ddc.
SetFrame(
"CBlastDbDataLoader");
485 typedefvoid(*TArgFuncType)(list<CPluginManager<CDataLoader>
488::EEntryPointRequest);
490RegisterEntryPoint<CDataLoader>((TArgFuncType)
535 const string& dbtype_str =
538 if( !
dbname.empty() ) {
541 if( !dbtype_str.empty() ) {
DEFINE_STATIC_MUTEX(s_Oid_Mutex)
void DataLoaders_Register_BlastDb(void)
string DbTypeToStr(CBlastDbDataLoader::EDbType dbtype)
static const string kPrefixThread
pair< int, CSeq_id_Handle > TBlastDbId
A BLAST DB (blob) ID The first field represents an OID in the BLAST database.
void NCBI_EntryPoint_xloader_blastdb(CPluginManager< objects::CDataLoader >::TDriverInfoList &info_list, CPluginManager< objects::CDataLoader >::EEntryPointRequest method)
static const string kPrefix
CBlobIdFor< TBlastDbId > CBlobIdBlastDb
Type definition consistent with those defined in objmgr/blob_id.hpp.
void NCBI_EntryPoint_DataLoader_BlastDb(CPluginManager< CDataLoader >::TDriverInfoList &info_list, CPluginManager< CDataLoader >::EEntryPointRequest method)
CSeqDB::ESeqType DbTypeToSeqType(CBlastDbDataLoader::EDbType dbtype)
CBlastDbDataLoader::EDbType SeqTypeToDbType(CSeqDB::ESeqType seq_type)
const string kDataLoader_BlastDb_DriverName("blastdb")
Data loader implementation that uses the blast databases.
const string kCFParam_BlastDb_DbName
const string kCFParam_BlastDb_DbType
@ kSequenceSliceSize
If sequence is shorter than this size but greater than kFastSequenceLoadSize, it will be "split" into...
CRef< CSeq_literal > CreateSeqDataChunk(IBlastDbAdapter &blastdb, int oid, TSeqPos begin, TSeqPos end)
Creates a chunk that corresponds to a given OID and its beginning and ending offsets.
Defines the CCachedSequence class.
virtual void GetSequenceLengths(const TIds &ids, TLoaded &loaded, TSequenceLengths &ret)
void x_LoadData(const CSeq_id_Handle &idh, int oid, CTSE_LoadLock &lock, int slice_size)
Load sequence data from cache or from the database.
virtual TSeqPos GetSequenceLength(const CSeq_id_Handle &idh)
Request for a length of a sequence.
static TRegisterLoaderInfo RegisterInObjectManager(CObjectManager &om, const string &dbname="nr", const EDbType dbtype=eUnknown, bool use_fixed_size_slices=true, CObjectManager::EIsDefault is_default=CObjectManager::eNonDefault, CObjectManager::TPriority priority=CObjectManager::kPriority_NotSet)
CRef< IBlastDbAdapter > m_BlastDb
The sequence database.
TIdMap m_Ids
ID to OID translation.
virtual ~CBlastDbDataLoader()
virtual TBlobId GetBlobId(const CSeq_id_Handle &idh)
Gets the blob id for a given sequence.
virtual bool CanGetBlobById() const
Test method for GetBlobById feature.
string m_DBName
Blast database name.
EDbType m_DBType
Is this database protein or nucleotide?
virtual void GetTaxIds(const TIds &ids, TLoaded &loaded, TTaxIds &ret)
CBlastDbDataLoader()
Default (no-op) constructor.
int x_GetOid(const CSeq_id_Handle &idh)
Gets the OID from m_Ids cache or the BLAST databases.
virtual TTSE_Lock GetBlobById(const TBlobId &blob_id)
For a given TBlobId, get the TTSE_Lock.
virtual CSeq_inst::TMol GetSequenceType(const CSeq_id_Handle &idh)
Request for a type of a sequence Returns CSeq_inst::eMol_not_set if sequence is not known.
EDbType
Describes the type of blast database to use.
@ eNucleotide
nucleotide database
@ eProtein
protein database
@ eUnknown
protein is attempted first, then nucleotide
virtual TTSE_LockSet GetRecords(const CSeq_id_Handle &idh, EChoice choice)
Load TSE.
pair< TBioseqId, TBioseq_setId > TPlace
virtual TTaxId GetTaxId(const CSeq_id_Handle &idh)
Request for a taxonomy id of a sequence.
static string GetLoaderNameFromArgs(CConstRef< CSeqDB > db_handle)
virtual void DebugDump(CDebugDumpContext ddc, unsigned int depth) const
Define method for dumping debug information.
virtual void GetSequenceTypes(const TIds &ids, TLoaded &loaded, TSequenceTypes &ret)
virtual void GetChunk(TChunk chunk)
Load a description or data chunk.
bool m_UseFixedSizeSlices
Configuration value specified to the CCachedSequence.
Data Loader Factory for BlastDbDataLoader.
virtual ~CBlastDb_DataLoaderCF(void)
Destructor.
virtual CDataLoader * CreateAndRegister(CObjectManager &om, const TPluginManagerParamTree *params) const
Create and register a data loader.
CBlastDb_DataLoaderCF(void)
Constructor.
Manages a TSE and its subordinate chunks for all implementations of the IBlastDbAdapter interface.
vector< CRef< CTSE_Chunk_Info > > TCTSE_Chunk_InfoVector
A list of 'chunk' objects, generic sequence related data elements.
CObjectManager::TPriority GetPriority(const TPluginManagerParamTree *params) const
const string & GetDriverName(void) const
CObjectManager::EIsDefault GetIsDefault(const TPluginManagerParamTree *params) const
bool ValidParams(const TPluginManagerParamTree *params) const
CTSE_LoadLock GetTSE_LoadLock(const TBlobId &blob_id)
void SetFrame(const string &frame)
This class allows retrieval of sequence data from locally installed BLAST databases via CSeqDB.
const string & GetDBNameList() const
Get list of database names.
ESeqType GetSequenceType() const
Returns the type of database opened - protein or nucleotide.
ESeqType
Sequence types (eUnknown tries protein, then nucleotide).
TBlobId GetBlobId(void) const
void x_LoadSequence(const TPlace &place, TSeqPos pos, const TSequence &seq)
void SetLoaded(CObject *obj=0)
vector< TLocation > TLocationSet
const TLocationSet & GetSeq_dataInfos(void) const
list< CRef< CSeq_literal > > TSequence
bool IsLoaded(void) const
CTSE_Split_Info & GetSplitInfo(void)
void SetSeq_entry(CSeq_entry &entry, CTSE_SetObjectInfo *set_info=0)
bool IsLoaded(void) const
void AddChunk(CTSE_Chunk_Info &chunk_info)
definition of a Culling tree
virtual TTaxId GetTaxId(const CSeq_id_Handle &)
Retrieve the taxonomy ID for the requested sequence identifier.
virtual bool SeqidToOid(const CSeq_id &id, int &oid)=0
Find a Seq-id in the database and get an OID if found.
virtual list< CRef< CSeq_id > > GetSeqIDs(int oid)=0
Get the list of Seq-ids for the given OID.
list< CRef< CSeq_id > > TSeqIdList
Convenience typedef for a list of CSeq_id-s.
virtual int GetSeqLength(int oid)=0
Get the length of the sequence.
container_type::iterator iterator
iterator_bool insert(const value_type &val)
void DebugDumpValue(CDebugDumpContext &_this, const string &name, const T &value, const string &comment=kEmptyStr)
static DLIST_TYPE *DLIST_NAME() first(DLIST_LIST_TYPE *list)
unsigned int TSeqPos
Type for sequence locations and lengths.
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
SStrictId_Tax::TId TTaxId
Taxon id type.
const TSeqPos kInvalidSeqPos
Define special value for invalid sequence position.
iterator find(const key_type &key)
pair< iterator, bool > insert(const value_type &value)
pair< const key_type, mapped_type > value_type
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
const string AsFastaString(void) const
CConstRef< CSeq_id > GetSeqId(void) const
E_SIC Compare(const CSeq_id &sid2) const
Compare() - more general.
@ e_YES
SeqIds compared, but are different.
const value_type & GetValue(void) const
TLoader * GetLoader(void) const
Get pointer to the loader.
vector< TSeqPos > TSequenceLengths
vector< CSeq_id_Handle > TIds
CDataSource * GetDataSource(void) const
EChoice
main blob is blob with sequence all other blobs are external and contain external annotations
vector< CSeq_inst::TMol > TSequenceTypes
EIsDefault
Flag defining if the data loader is included in the "default" group.
TRegisterInfo GetRegisterInfo(void)
vector< bool > TLoaded
Bulk loading interface for a small pieces of information per id.
static void RegisterInObjectManager(CObjectManager &om, CLoaderMaker_Base &loader_maker, CObjectManager::EIsDefault is_default, CObjectManager::TPriority priority)
Register the loader only if the name is not yet registered in the object manager.
@ eAll
all blobs (main and external)
@ eCore
?only seq-entry core?
@ eBioseq
main blob with complete bioseq
@ eBioseqCore
main blob with bioseq core (no seqdata and annots)
void Reset(void)
Reset reference object.
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty â pointing to an object and has a non-null value.
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.
static void NCBI_EntryPointImpl(TDriverInfoList &info_list, EEntryPointRequest method)
Entry point implementation.
string GetParam(const string &driver_name, const TPluginManagerParamTree *params, const string ¶m_name, bool mandatory, const string &default_value) const
Utility function to get an element of parameter tree Throws an exception when mandatory parameter is ...
list< SDriverInfo > TDriverInfoList
List of driver information.
EEntryPointRequest
Actions performed by the entry point.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define END_SCOPE(ns)
End the previously defined scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
#define BEGIN_SCOPE(ns)
Define a new scope.
static int CompareNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive compare of a substring with another string.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
EMol
molecule class in living organism
@ eMol_not_set
> cdna = rna
@ eMol_na
just a nucleic acid
char * dbname(DBPROCESS *dbproc)
Get name of current database.
Declaration of the CLocalBlastDbAdapter class.
Helper classes and templates to implement plugins.
CRef< objects::CObjectManager > om
SBlastDbParam(const string &db_name="nr", EDbType dbtype=eUnknown, bool use_fixed_size_slices=true)
CRef< CSeqDB > m_BlastDbHandle
string operator()(const TBlastDbId &v) const
Convert TBlastDbId (blob IDs) to human readable strings.
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