NCBI C++ ToolKit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CDensityMap< CntType > Class Template Reference

Search Toolkit Book for CDensityMap

class CDensityMap generates a low-resolution view of a set of features. More...

#include <gui/objutils/density_map.hpp>

+ Inheritance diagram for CDensityMap< CntType >:
+ Collaboration diagram for CDensityMap< CntType >:

Public Types

typedef vector< CntType > container_type
 
typedef container_type::const_iterator const_iterator
 
typedef container_type::iterator iterator
 
typedef CDenMapRunIterator< CntType > runlen_iterator
 
typedef binary_functor< CntType > accum_functor
 
typedef vector< size_t > TDataPoints
 

Public Member Functions

 CDensityMap (TSeqPos start=0, TSeqPos stop=0, double window=1, accum_functor *func=NULL, CntType def=(CntType) 0)
 
 CDensityMap (const objects::CBioseq_Handle &handle, double window=1, accum_functor *func=NULL, CntType def=(CntType) 0)
 
 CDensityMap (const CDensityMap< CntType > &map)
 
CDensityMap< CntType > & operator= (const CDensityMap< CntType > &map)
 
virtual ~CDensityMap ()
 
virtual void AddRange (TSeqRange range, CntType score=1, bool expand=false)
 
virtual void AddRanges (CRangeCollection< TSeqPos > ranges, CntType score=1, bool expand=false)
 
CntType AddLocation (const objects::CSeq_loc &loc)
 
CntType AddFeature (const objects::CSeq_feat &feature)
 
CntType AddFeatures (const objects::CBioseq_Handle &handle, objects::SAnnotSelector sel)
 All features on this bioseq selected by sel in the range of this. More...
 
CntType AddAlignments (const objects::CBioseq_Handle &handle, objects::SAnnotSelector sel)
 All alignments on this bioseq selected by sel in the range of this. More...
 
CntType AddAlignments (const objects::CBioseq_Handle &handle, const objects::CSeq_annot &seq_annot)
 All alignments in a given annotation on this bioseq within the range of this. More...
 
void Clear ()
 
TSeqPos GetStart () const
 
TSeqPos GetStop () const
 
TSeqRange GetRange () const
 
double GetWindow () const
 
size_t GetBins () const
 
CntType GetMax () const
 
CntType GetMin () const
 
CntType GetDefVal () const
 
void SetMax (const CntType &max)
 
void SetMin (const CntType &min)
 
const accum_functorGetAccum () const
 
void ExtendTo (TSeqPos stop)
 extend our density map to cover the sequence position stop. More...
 
const_iterator begin () const
 
const_iterator end () const
 
iterator begin ()
 
iterator end ()
 
runlen_iterator RunLenBegin () const
 
runlen_iterator RunLenIterator (typename container_type::size_type n) const
 
CntType operator[] (typename container_type::size_type n) const
 
CntType & operator[] (typename container_type::size_type n)
 

Static Public Member Functions

static TSeqPos GetDensityMap (const objects::CBioseq_Handle &handle, TSeqPos start, TSeqPos stop, TSeqPos window, objects::SAnnotSelector sel, vector< TSeqPos > &density)
 OLD static method. More...
 

Protected Member Functions

size_t x_CalcNbins ()
 given the range and window size, how many bins should there be? More...
 
size_t x_BinN (TSeqPos p)
 convert from sequence coords to a bin number. More...
 

Protected Attributes

TSeqRange m_Range
 closed range on a sequence this covers. More...
 
double m_Window
 coordinates per bin. More...
 
CntType m_DefVal
 Default value. More...
 
CntType m_Max
 maximum Count accumulated in the bins so far. More...
 
CntType m_Min
 Smallest count in a bin. More...
 
container_type m_Bins
 Where we actually keep the accumulated counts/scores/whatever. More...
 
unique_ptr< accum_functorm_AccumFunc
 

Detailed Description

template<typename CntType>
class CDensityMap< CntType >

class CDensityMap generates a low-resolution view of a set of features.

The features to be processed are defined by the SAnnotSelector object. The return value is a vector of counts, one for each of the bins defined by the window width and spanning the range from start to stop. If start and stop are both zero, then the entire sequence is evaluated.

Definition at line 222 of file density_map.hpp.


The documentation for this class was generated from the following file:
Modified on Wed Jun 19 16:59:44 2024 by modify_doxy.py rev. 669887