NCBI C++ ToolKit
Public Member Functions | Private Member Functions | Private Attributes | List of all members
CBlastInput Class Reference

Search Toolkit Book for CBlastInput

Generalized converter from an abstract source of biological sequence data to collections of blast input. More...

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

+ Inheritance diagram for CBlastInput:
+ Collaboration diagram for CBlastInput:

Public Member Functions

 CBlastInput (CBlastInputSource *source, int batch_size=kMax_Int)
 Constructor. More...
 
 ~CBlastInput ()
 Destructor. More...
 
TSeqLocVector GetAllSeqLocs (CScope &scope)
 Read and convert all the sequences from the source. More...
 
CRef< CBlastQueryVectorGetAllSeqs (CScope &scope)
 Read and convert all the sequences from the source. More...
 
TSeqLocVector GetNextSeqLocBatch (CScope &scope)
 Read and convert the next batch of sequences. More...
 
CRef< CBlastQueryVectorGetNextSeqBatch (CScope &scope)
 Read and convert the next batch of sequences. More...
 
TSeqPos GetBatchSize () const
 Retrieve the target size of a batch of sequences. More...
 
void SetBatchSize (TSeqPos batch_size)
 Set the target size of a batch of sequences. More...
 
bool End ()
 Determine if we have reached the end of the BLAST input. More...
 
Int8 GetNumSeqsProcessed () const
 
Int8 GetTotalLengthProcessed () const
 
- Public Member Functions inherited from CObject
 CObject (void)
 Constructor. More...
 
 CObject (const CObject &src)
 Copy constructor. More...
 
virtual ~CObject (void)
 Destructor. More...
 
CObjectoperator= (const CObject &src) THROWS_NONE
 Assignment operator. More...
 
bool CanBeDeleted (void) const THROWS_NONE
 Check if object can be deleted. More...
 
bool IsAllocatedInPool (void) const THROWS_NONE
 Check if object is allocated in memory pool (not system heap) More...
 
bool Referenced (void) const THROWS_NONE
 Check if object is referenced. More...
 
bool ReferencedOnlyOnce (void) const THROWS_NONE
 Check if object is referenced only once. More...
 
void AddReference (void) const
 Add reference to object. More...
 
void RemoveReference (void) const
 Remove reference to object. More...
 
void ReleaseReference (void) const
 Remove reference without deleting object. More...
 
virtual void DoNotDeleteThisObject (void)
 Mark this object as not allocated in heap – do not delete this object. More...
 
virtual void DoDeleteThisObject (void)
 Mark this object as allocated in heap – object can be deleted. More...
 
void * operator new (size_t size)
 Define new operator for memory allocation. More...
 
void * operator new[] (size_t size)
 Define new[] operator for 'array' memory allocation. More...
 
void operator delete (void *ptr)
 Define delete operator for memory deallocation. More...
 
void operator delete[] (void *ptr)
 Define delete[] operator for memory deallocation. More...
 
void * operator new (size_t size, void *place)
 Define new operator. More...
 
void operator delete (void *ptr, void *place)
 Define delete operator. More...
 
void * operator new (size_t size, CObjectMemoryPool *place)
 Define new operator using memory pool. More...
 
void operator delete (void *ptr, CObjectMemoryPool *place)
 Define delete operator. More...
 
virtual void DebugDump (CDebugDumpContext ddc, unsigned int depth) const
 Define method for dumping debug information. More...
 
- Public Member Functions inherited from CDebugDumpable
 CDebugDumpable (void)
 
virtual ~CDebugDumpable (void)
 
void DebugDumpText (ostream &out, const string &bundle, unsigned int depth) const
 
void DebugDumpFormat (CDebugDumpFormatter &ddf, const string &bundle, unsigned int depth) const
 
void DumpToConsole (void) const
 

Private Member Functions

 CBlastInput (const CBlastInput &rhs)
 Prohibit copy constructor. More...
 
CBlastInputoperator= (const CBlastInput &rhs)
 Prohibit assignment operator. More...
 
void do_copy (const CBlastInput &input)
 Perform the actual copy for assignment operator and copy constructor. More...
 

Private Attributes

CRef< CBlastInputSourcem_Source
 pointer to source of sequences More...
 
TSeqPos m_BatchSize
 total size of one block of sequences More...
 
Int8 m_NumSeqs
 
Int8 m_TotalLength
 

Additional Inherited Members

- Public Types inherited from CObject
enum  EAllocFillMode { eAllocFillNone = 1 , eAllocFillZero , eAllocFillPattern }
 Control filling of newly allocated memory. More...
 
typedef CObjectCounterLocker TLockerType
 Default locker type for CRef. More...
 
typedef atomic< Uint8TCounter
 Counter type is CAtomiCounter. More...
 
typedef Uint8 TCount
 Alias for value type of counter. More...
 
- Static Public Member Functions inherited from CObject
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (void)
 Define method to throw null pointer exception. More...
 
static NCBI_XNCBI_EXPORT void ThrowNullPointerException (const type_info &type)
 
static EAllocFillMode GetAllocFillMode (void)
 
static void SetAllocFillMode (EAllocFillMode mode)
 
static void SetAllocFillMode (const string &value)
 Set mode from configuration parameter value. More...
 
- Static Public Member Functions inherited from CDebugDumpable
static void EnableDebugDump (bool on)
 
- Static Public Attributes inherited from CObject
static const TCount eCounterBitsCanBeDeleted = 1 << 0
 Define possible object states. More...
 
static const TCount eCounterBitsInPlainHeap = 1 << 1
 Heap signature was found. More...
 
static const TCount eCounterBitsPlaceMask
 Mask for 'in heap' state flags. More...
 
static const int eCounterStep = 1 << 2
 Skip over the "in heap" bits. More...
 
static const TCount eCounterValid = TCount(1) << (sizeof(TCount) * 8 - 2)
 Minimal value for valid objects (reference counter is zero) Must be a single bit value. More...
 
static const TCount eCounterStateMask
 Valid object, and object in heap. More...
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Generalized converter from an abstract source of biological sequence data to collections of blast input.

Definition at line 303 of file blast_input.hpp.

Constructor & Destructor Documentation

◆ CBlastInput() [1/2]

CBlastInput::CBlastInput ( CBlastInputSource source,
int  batch_size = kMax_Int 
)
inline

Constructor.

Parameters
sourcePointer to abstract source of sequences
batch_sizeA hint specifying how many letters should be in a batch of converted sequences

Definition at line 312 of file blast_input.hpp.

◆ ~CBlastInput()

CBlastInput::~CBlastInput ( )
inline

Destructor.

Definition at line 317 of file blast_input.hpp.

◆ CBlastInput() [2/2]

CBlastInput::CBlastInput ( const CBlastInput rhs)
private

Prohibit copy constructor.

Definition at line 76 of file blast_input.cpp.

References do_copy().

Member Function Documentation

◆ do_copy()

void CBlastInput::do_copy ( const CBlastInput input)
private

Perform the actual copy for assignment operator and copy constructor.

Definition at line 89 of file blast_input.cpp.

References m_BatchSize, and m_Source.

Referenced by CBlastInput(), and operator=().

◆ End()

bool CBlastInput::End ( void  )
inline

Determine if we have reached the end of the BLAST input.

Definition at line 358 of file blast_input.hpp.

References CBlastInputSource::End(), and m_Source.

Referenced by GetAllSeqLocs(), GetAllSeqs(), GetNextSeqBatch(), GetNextSeqLocBatch(), CBlastKmerThread::Main(), CIgBlastnApp::CIgWorker::Main(), and CIgBlastnApp::x_CountUserBatches().

◆ GetAllSeqLocs()

TSeqLocVector CBlastInput::GetAllSeqLocs ( CScope scope)

Read and convert all the sequences from the source.

Parameters
scopeCScope object to use in return value [in]
Returns
The converted sequences

Definition at line 180 of file blast_input.cpp.

References CObjReaderParseException::eEOF, End(), CParseTemplException< TBase >::GetErrCode(), CBlastInputSource::GetNextSSeqLoc(), and m_Source.

Referenced by BOOST_AUTO_TEST_CASE(), CBlastDemoApplication::Run(), and s_ReadAndTestQueryFromString().

◆ GetAllSeqs()

CRef< CBlastQueryVector > CBlastInput::GetAllSeqs ( CScope scope)

Read and convert all the sequences from the source.

Parameters
scopeCScope object to use in return value [in]
Returns
The converted sequences

Definition at line 199 of file blast_input.cpp.

References CBlastQueryVector::AddQuery(), CObjReaderParseException::eEOF, End(), CObjReaderParseException::eNoDefline, CParseTemplException< TBase >::GetErrCode(), CBlastInputSource::GetNextSequence(), CParseTemplException< TBase >::GetPos(), m_Source, and NCBI_THROW.

◆ GetBatchSize()

TSeqPos CBlastInput::GetBatchSize ( ) const
inline

Retrieve the target size of a batch of sequences.

Returns
The current batch size

Definition at line 352 of file blast_input.hpp.

References m_BatchSize.

Referenced by GetNextSeqBatch(), and GetNextSeqLocBatch().

◆ GetNextSeqBatch()

CRef< CBlastQueryVector > CBlastInput::GetNextSeqBatch ( CScope scope)

Read and convert the next batch of sequences.

Parameters
scopeCScope object to use in return value [in]
Returns
The next batch of sequence. The size of the batch is either all remaining sequences, or the size of sufficiently many whole sequences whose combined size exceeds m_BatchSize, whichever is smaller

Definition at line 135 of file blast_input.cpp.

References _TRACE, abort(), CBlastQueryVector::AddQuery(), CObjReaderParseException::eEOF, End(), GetBatchSize(), CParseTemplException< TBase >::GetErrCode(), CSeq_interval_Base::GetId(), CSeq_loc_Base::GetInt(), GetLength(), CBlastInputSource::GetNextSequence(), CSeq_loc_Base::GetWhole(), CSeq_loc_Base::IsInt(), CSeq_loc_Base::IsWhole(), m_NumSeqs, m_Source, m_TotalLength, CRef< C, Locker >::Reset(), and CBlastQueryVector::Size().

Referenced by CIgBlastnApp::CIgWorker::Main(), and CIgBlastnApp::x_CountUserBatches().

◆ GetNextSeqLocBatch()

TSeqLocVector CBlastInput::GetNextSeqLocBatch ( CScope scope)

Read and convert the next batch of sequences.

Parameters
scopeCScope object to use in return value [in]
Returns
The next batch of sequence. The size of the batch is either all remaining sequences, or the size of sufficiently many whole sequences whose combined size exceeds m_BatchSize, whichever is smaller

Definition at line 98 of file blast_input.cpp.

References _TRACE, abort(), CObjReaderParseException::eEOF, End(), GetBatchSize(), CParseTemplException< TBase >::GetErrCode(), GetLength(), CBlastInputSource::GetNextSSeqLoc(), m_Source, SSeqLoc::scope, and SSeqLoc::seqloc.

Referenced by CBlastKmerThread::Main().

◆ GetNumSeqsProcessed()

Int8 CBlastInput::GetNumSeqsProcessed ( ) const
inline

Definition at line 360 of file blast_input.hpp.

References m_NumSeqs.

Referenced by LogQueryInfo().

◆ GetTotalLengthProcessed()

Int8 CBlastInput::GetTotalLengthProcessed ( ) const
inline

Definition at line 361 of file blast_input.hpp.

References m_TotalLength.

Referenced by LogQueryInfo().

◆ operator=()

CBlastInput & CBlastInput::operator= ( const CBlastInput rhs)
private

Prohibit assignment operator.

Definition at line 82 of file blast_input.cpp.

References do_copy().

◆ SetBatchSize()

void CBlastInput::SetBatchSize ( TSeqPos  batch_size)
inline

Set the target size of a batch of sequences.

Definition at line 355 of file blast_input.hpp.

References m_BatchSize.

Member Data Documentation

◆ m_BatchSize

TSeqPos CBlastInput::m_BatchSize
private

total size of one block of sequences

Definition at line 364 of file blast_input.hpp.

Referenced by do_copy(), GetBatchSize(), and SetBatchSize().

◆ m_NumSeqs

Int8 CBlastInput::m_NumSeqs
private

Definition at line 376 of file blast_input.hpp.

Referenced by GetNextSeqBatch(), and GetNumSeqsProcessed().

◆ m_Source

CRef<CBlastInputSource> CBlastInput::m_Source
private

pointer to source of sequences

Definition at line 363 of file blast_input.hpp.

Referenced by do_copy(), End(), GetAllSeqLocs(), GetAllSeqs(), GetNextSeqBatch(), and GetNextSeqLocBatch().

◆ m_TotalLength

Int8 CBlastInput::m_TotalLength
private

Definition at line 379 of file blast_input.hpp.

Referenced by GetNextSeqBatch(), and GetTotalLengthProcessed().


The documentation for this class was generated from the following files:
Modified on Sun Apr 21 03:41:28 2024 by modify_doxy.py rev. 669887