NCBI C++ ToolKit
|
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>
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... | |
CObject & | operator= (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... | |
CSubjectRangesSet & | operator= (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< Uint8 > | TCounter |
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... | |
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.
|
private |
List of OIDs and sequence ranges.
Definition at line 170 of file subj_ranges_set.hpp.
|
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).
expand_hsp | Expand each range by at least this much. |
min_gap | Join ranges if gap is smaller than this. |
Definition at line 127 of file subj_ranges_set.hpp.
|
private |
Prevent copy constructor.
Add new offset range for subject HSP.
q_oid | Query OID or index. |
s_oid | Subject OID. |
begin | Start offset in subject HSP. |
begin | End 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().
void CSubjectRangesSet::ApplyRanges | ( | CSeqDB & | db | ) | const |
Apply existing ranges to a database.
seqdb | SeqDB 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().
|
private |
Prevent assignment operator.
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.
s_oid | Subject 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().
Add, expand, and merge new range.
Definition at line 138 of file subj_ranges_set.cpp.
References m_ExpandHSP.
Referenced by AddRange().
Translate subject offsets from protein to DNA coordinates.
begin | Starting offset. |
end | Ending offset of desired sequence range. |
length | Total length of sequence. |
negative | Specify true for negative frames. |
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().
Default minimum gap size to avoid merge.
Definition at line 107 of file subj_ranges_set.hpp.
|
private |
Expansion amount for each HSP range.
Definition at line 176 of file subj_ranges_set.hpp.
Referenced by AddRange(), and x_ExpandHspRange().
|
private |
Minimum gap between sequences to avoid merging.
Definition at line 179 of file subj_ranges_set.hpp.
Referenced by AddRange().
|
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().