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

Search Toolkit Book for CSeqVector

CSeqVector –. More...

#include <objmgr/seq_vector.hpp>

+ Inheritance diagram for CSeqVector:
+ Collaboration diagram for CSeqVector:

Public Types

typedef CBioseq_Handle::EVectorCoding EVectorCoding
 
typedef CSeqVector_CI const_iterator
 
typedef CMutex TMutex
 
typedef TMutex::TWriteLockGuard TMutexGuard
 
typedef CSeq_inst::TMol TMol
 
- 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...
 
- Public Types inherited from CSeqVectorTypes
enum  ECaseConversion { eCaseConversion_none , eCaseConversion_upper , eCaseConversion_lower }
 
typedef unsigned char TResidue
 
typedef CSeq_data::E_Choice TCoding
 
typedef TResidue value_type
 
typedef TSeqPos size_type
 
typedef TSignedSeqPos difference_type
 
typedef std::random_access_iterator_tag iterator_category
 
typedef const TResiduepointer
 
typedef const TResiduereference
 

Public Member Functions

 CSeqVector (void)
 
 CSeqVector (const CBioseq_Handle &bioseq, EVectorCoding coding=CBioseq_Handle::eCoding_Ncbi, ENa_strand strand=eNa_strand_unknown)
 
 CSeqVector (const CSeqMap &seqMap, CScope &scope, EVectorCoding coding=CBioseq_Handle::eCoding_Ncbi, ENa_strand strand=eNa_strand_unknown)
 
 CSeqVector (const CSeqMap &seqMap, const CTSE_Handle &top_tse, EVectorCoding coding=CBioseq_Handle::eCoding_Ncbi, ENa_strand strand=eNa_strand_unknown)
 
 CSeqVector (const CSeq_loc &loc, CScope &scope, EVectorCoding coding=CBioseq_Handle::eCoding_Ncbi, ENa_strand strand=eNa_strand_unknown)
 
 CSeqVector (const CSeq_loc &loc, const CTSE_Handle &top_tse, EVectorCoding coding=CBioseq_Handle::eCoding_Ncbi, ENa_strand strand=eNa_strand_unknown)
 
 CSeqVector (const CBioseq &bioseq, CScope *scope=0, EVectorCoding coding=CBioseq_Handle::eCoding_Ncbi, ENa_strand strand=eNa_strand_unknown)
 
 CSeqVector (const CSeqVector &vec)
 
virtual ~CSeqVector (void)
 
CSeqVectoroperator= (const CSeqVector &vec)
 
bool empty (void) const
 
TSeqPos size (void) const
 
TMutexGetMutex (void) const
 Get mutex for a few non-MT-safe methods to make them MT-safe at a cost of performance. More...
 
TResidue operator[] (TSeqPos pos) const
 0-based array of residues Note: this method is not MT-safe, do not call it in parallel with other, even MT-safe method. More...
 
bool IsInGap (TSeqPos pos) const
 true if sequence at 0-based position 'pos' has gap Note: this method is not MT-safe, do not call it in parallel with other, even MT-safe method. More...
 
TSeqPos GetGapSizeForward (TSeqPos pos) const
 returns number of gap symbols ahead including base at position 'pos' returns 0 if the position is not in gap More...
 
CConstRef< CSeq_literalGetGapSeq_literal (TSeqPos pos) const
 returns gap Seq-literal object ref returns null if it's not a gap or an unspecified gap More...
 
bool CanGetRange (TSeqPos start, TSeqPos stop) const
 Check if the sequence data is available for the interval [start, stop). More...
 
bool CanGetRange (const const_iterator &start, const const_iterator &stop) const
 
void GetSeqData (TSeqPos start, TSeqPos stop, string &buffer) const
 Fill the buffer string with the sequence data for the interval [start, stop). More...
 
void GetSeqData (const const_iterator &start, const const_iterator &stop, string &buffer) const
 
void GetPackedSeqData (string &buffer, TSeqPos start=0, TSeqPos stop=kInvalidSeqPos)
 
TMol GetSequenceType (void) const
 
bool IsProtein (void) const
 
bool IsNucleotide (void) const
 
CScopeGetScope (void) const
 
const CSeqMapGetSeqMap (void) const
 
ENa_strand GetStrand (void) const
 
void SetStrand (ENa_strand strand)
 
TCoding GetCoding (void) const
 Target sequence coding. More...
 
void SetCoding (TCoding coding)
 
void SetIupacCoding (void)
 Set coding to either Iupacaa or Iupacna depending on molecule type. More...
 
void SetNcbiCoding (void)
 Set coding to either Ncbi8aa or Ncbi8na depending on molecule type. More...
 
void SetCoding (EVectorCoding coding)
 Set coding to either Iupac or Ncbi8xx. More...
 
TResidue GetGapChar (ECaseConversion case_cvt=eCaseConversion_none) const
 Return gap symbol corresponding to the selected coding. More...
 
const_iterator begin (void) const
 
const_iterator end (void) const
 
void SetRandomizeAmbiguities (void)
 Randomization of ambiguities and gaps in ncbi2na coding. More...
 
void SetRandomizeAmbiguities (Uint4 seed)
 
void SetRandomizeAmbiguities (CRandom &random_gen)
 
void SetRandomizeAmbiguities (CRef< INcbi2naRandomizer > randomizer)
 
void SetNoAmbiguities (void)
 
- 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

void x_InitSequenceType (void)
 
CSeqVector_CIx_GetIterator (TSeqPos pos) const
 
CSeqVector_CIx_CreateIterator (TSeqPos pos) const
 
void x_ResetIterator (void) const
 
void x_InitRandomizer (CRandom &random_gen)
 
void x_GetPacked8SeqData (string &dst_str, TSeqPos src_pos, TSeqPos src_end)
 
void x_GetPacked4naSeqData (string &dst_str, TSeqPos src_pos, TSeqPos src_end)
 
void x_GetPacked2naSeqData (string &dst_str, TSeqPos src_pos, TSeqPos src_end)
 

Private Attributes

CHeapScope m_Scope
 
CConstRef< CSeqMapm_SeqMap
 
CTSE_Handle m_TSE
 
TSeqPos m_Size
 
TMol m_Mol
 
ENa_strand m_Strand
 
TCoding m_Coding
 
CRef< INcbi2naRandomizerm_Randomizer
 
TMutex m_IteratorMutex
 
AutoPtr< CSeqVector_CIm_Iterator
 

Friends

class CBioseq_Handle
 
class CSeqVector_CI
 

Additional Inherited Members

- 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...
 
- Static Protected Member Functions inherited from CSeqVectorTypes
static TResidue sx_GetGapChar (TCoding coding, ECaseConversion case_cvt)
 
static const char * sx_GetConvertTable (TCoding src, TCoding dst, bool reverse, ECaseConversion case_cvt)
 
- Static Protected Attributes inherited from CSeqVectorTypes
static const char sm_TrivialTable [256]
 

Detailed Description

CSeqVector –.

Provide sequence data in the selected coding

Definition at line 64 of file seq_vector.hpp.


The documentation for this class was generated from the following files:
Modified on Wed Apr 24 14:16:22 2024 by modify_doxy.py rev. 669887