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

Search Toolkit Book for CSubjectRangesSet

Set of ranges of subject sequence offsets to fetch during the traceback stage. More...

#include <algo/blast/api/subj_ranges_set.hpp>

+ Inheritance diagram for CSubjectRangesSet:
+ Collaboration diagram for CSubjectRangesSet:

Public Member Functions

 CSubjectRangesSet (int expand_hsp=kHspExpandSize, int min_gap=kMinGap)
 Construct a set of sequence ranges. More...
 
void AddRange (int q_oid, int s_oid, int begin, int end)
 Add new offset range for subject HSP. More...
 
void RemoveSubject (int s_oid)
 Remove a given subject OID from the set. More...
 
void ApplyRanges (CSeqDB &db) const
 Apply existing ranges to a database. More...
 
- 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
 

Static Public Attributes

static const int kHspExpandSize = 1024
 Default number of letters to expand for each HSP after all merging has taken place. More...
 
static const int kMinGap = 1024
 Default minimum gap size to avoid merge. More...
 
- 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...
 

Private Types

typedef map< int, CRef< CSubjectRanges > > TSubjOid2RangesMap
 List of OIDs and sequence ranges. More...
 

Private Member Functions

 CSubjectRangesSet (const CSubjectRangesSet &other)
 Prevent copy constructor. More...
 
CSubjectRangesSetoperator= (const CSubjectRangesSet &rhs)
 Prevent assignment operator. More...
 
void x_ExpandHspRange (int &begin, int &end)
 Add, expand, and merge new range. More...
 
void x_TranslateOffsets (int &begin, int &end)
 Translate subject offsets from protein to DNA coordinates. More...
 

Private Attributes

TSubjOid2RangesMap m_SubjRanges
 Set of query ids and ranges for an OID. More...
 
int m_ExpandHSP
 Expansion amount for each HSP range. More...
 
int m_MinGap
 Minimum gap between sequences to avoid merging. More...
 

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)
 
- Protected Member Functions inherited from CObject
virtual void DeleteThis (void)
 Virtual method "deleting" this object. More...
 

Detailed Description

Set of ranges of subject sequence offsets to fetch during the traceback stage.

This is applicable only to nucleotide sequences and improves performance during the traceback stage when dealing with large subject sequences.

Definition at line 100 of file subj_ranges_set.hpp.

Member Typedef Documentation

◆ TSubjOid2RangesMap

List of OIDs and sequence ranges.

Definition at line 170 of file subj_ranges_set.hpp.

Constructor & Destructor Documentation

◆ CSubjectRangesSet() [1/2]

CSubjectRangesSet::CSubjectRangesSet ( int  expand_hsp = kHspExpandSize,
int  min_gap = kMinGap 
)
inline

Construct a set of sequence ranges.

Create a new sequence map set, specifying that expand_hsp letters should be fetched on either side of every region of a database sequence. The min_gap value is applied to the results of extension, and joins any ranges where the intervening gap is smaller than the specified value.

These numbers have not (yet) been 'tuned' to find an optimal value for performance; it is expected that few searches will hit the 'fence' at the current default values.

It may be unsafe to specify either of these values at very small numbers (less than 10 or so).

Parameters
expand_hspExpand each range by at least this much.
min_gapJoin ranges if gap is smaller than this.

Definition at line 127 of file subj_ranges_set.hpp.

◆ CSubjectRangesSet() [2/2]

CSubjectRangesSet::CSubjectRangesSet ( const CSubjectRangesSet other)
private

Prevent copy constructor.

Member Function Documentation

◆ AddRange()

void CSubjectRangesSet::AddRange ( int  q_oid,
int  s_oid,
int  begin,
int  end 
)

Add new offset range for subject HSP.

Parameters
q_oidQuery OID or index.
s_oidSubject OID.
beginStart offset in subject HSP.
beginEnd offset in subject HSP.

Definition at line 118 of file subj_ranges_set.cpp.

References m_ExpandHSP, m_MinGap, m_SubjRanges, CRandom::Reset(), and x_ExpandHspRange().

Referenced by BOOST_AUTO_TEST_CASE().

◆ ApplyRanges()

void CSubjectRangesSet::ApplyRanges ( CSeqDB db) const

Apply existing ranges to a database.

Parameters
seqdbSeqDB object to modify.

Definition at line 156 of file subj_ranges_set.cpp.

References CSubjectRanges::GetRanges(), CSubjectRanges::IsUsedByMultipleQueries(), ITERATE, m_SubjRanges, and CSeqDB::SetOffsetRanges().

Referenced by BOOST_AUTO_TEST_CASE().

◆ operator=()

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

Prevent assignment operator.

◆ RemoveSubject()

void CSubjectRangesSet::RemoveSubject ( int  s_oid)

Remove a given subject OID from the set.

Any ranges for the given subject oid are cleared, causing the entire offset range to be included. The normal use of this method is to remove ranges specified for query sequences that are also found in the subject database. If the OID is not found, there is no effect.

Parameters
s_oidSubject OID.

Definition at line 133 of file subj_ranges_set.cpp.

References map_checker< Container >::erase(), and m_SubjRanges.

Referenced by BOOST_AUTO_TEST_CASE().

◆ x_ExpandHspRange()

void CSubjectRangesSet::x_ExpandHspRange ( int begin,
int end 
)
private

Add, expand, and merge new range.

Definition at line 138 of file subj_ranges_set.cpp.

References m_ExpandHSP.

Referenced by AddRange().

◆ x_TranslateOffsets()

void CSubjectRangesSet::x_TranslateOffsets ( int begin,
int end 
)
private

Translate subject offsets from protein to DNA coordinates.

Parameters
beginStarting offset.
endEnding offset of desired sequence range.
lengthTotal length of sequence.
negativeSpecify true for negative frames.

Member Data Documentation

◆ kHspExpandSize

const int CSubjectRangesSet::kHspExpandSize = 1024
static

Default number of letters to expand for each HSP after all merging has taken place.

Definition at line 104 of file subj_ranges_set.hpp.

Referenced by BOOST_AUTO_TEST_CASE().

◆ kMinGap

const int CSubjectRangesSet::kMinGap = 1024
static

Default minimum gap size to avoid merge.

Definition at line 107 of file subj_ranges_set.hpp.

◆ m_ExpandHSP

int CSubjectRangesSet::m_ExpandHSP
private

Expansion amount for each HSP range.

Definition at line 176 of file subj_ranges_set.hpp.

Referenced by AddRange(), and x_ExpandHspRange().

◆ m_MinGap

int CSubjectRangesSet::m_MinGap
private

Minimum gap between sequences to avoid merging.

Definition at line 179 of file subj_ranges_set.hpp.

Referenced by AddRange().

◆ m_SubjRanges

TSubjOid2RangesMap CSubjectRangesSet::m_SubjRanges
private

Set of query ids and ranges for an OID.

Definition at line 173 of file subj_ranges_set.hpp.

Referenced by AddRange(), ApplyRanges(), and RemoveSubject().


The documentation for this class was generated from the following files:
Modified on Wed Sep 04 15:01:49 2024 by modify_doxy.py rev. 669887