gatb.core-API-0.0.0
HistogramCache Class Reference

Cached implementation of the IHistogram interface. More...

#include <Histogram.hpp>

Inheritance diagram for HistogramCache:
Inheritance graph

Public Member Functions

 HistogramCache (IHistogram *ref, system::ISynchronizer *synchro=0)
 
 ~HistogramCache ()
 
void inc (u_int16_t index)
 
void inc2D (u_int16_t index1, u_int16_t index2)
 
void save (tools::storage::impl::Group &group)
 
void compute_threshold (int min_auto_threshold)
 
u_int16_t get_solid_cutoff ()
 
u_int64_t get_nbsolids_auto ()
 
float get_ratio_weak ()
 
u_int16_t get_first_peak ()
 
size_t getLength ()
 
size_t getLength2 ()
 
u_int64_t & get (u_int16_t idx)
 
u_int64_t & get2D (u_int16_t idx1, u_int16_t idx2)
 
- Public Member Functions inherited from IHistogram
virtual ~IHistogram ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 

Additional Inherited Members

- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

Cached implementation of the IHistogram interface.

This implementation is a Proxy design pattern. It allows to modify a IHistogram instance by several threads at the same time. Actually, each thread has a local copy and at the end, all the local copies are merged into the referred instance.

Constructor & Destructor Documentation

HistogramCache ( IHistogram ref,
system::ISynchronizer synchro = 0 
)
inline

Constructor.

Parameters
[in]ref: the referred instance.
[in]synchro: used for synchronization
~HistogramCache ( )
inline

Destructor.

Member Function Documentation

void compute_threshold ( int  min_auto_threshold)
inlinevirtual

Compute first minimum at x0 and firt maximum at x1 (x1>x0).

Implements IHistogram.

u_int64_t& get ( u_int16_t  idx)
inlinevirtual

Retrieve the value for x.

Parameters
[in]idx: x value.
Returns
y(x).

Implements IHistogram.

u_int64_t& get2D ( u_int16_t  idx1,
u_int16_t  idx2 
)
inlinevirtual

Retrieve the value for x and y of histo2D.

Parameters
[in]idx1: x value.
[in]idx2: y value.
Returns
cpt(x,y).

Implements IHistogram.

u_int16_t get_first_peak ( )
inlinevirtual

Get the x1 value at the first maximum after x0.

Implements IHistogram.

u_int64_t get_nbsolids_auto ( )
inlinevirtual

Get the number of kmers for x>x0, aka solid kmers for x0 threshold

Returns
number of kmers.

Implements IHistogram.

float get_ratio_weak ( )
inlinevirtual

Get the ratio of weak kmers in total volume

Returns
ratio

Implements IHistogram.

u_int16_t get_solid_cutoff ( )
inlinevirtual

Get the solid cutoff, ie the x0 at first minimum.

Returns
x0

Implements IHistogram.

size_t getLength ( )
inlinevirtual

Return the maximum allowed for X.

Returns
the max X value.

Implements IHistogram.

size_t getLength2 ( )
inlinevirtual

Return the maximum allowed for Y in case of 2D histogram.

Returns
the max Y value.

Implements IHistogram.

void inc ( u_int16_t  index)
inlinevirtual

Increase the number of kmers occurring X time

Parameters
[in]index: the X value.

Implements IHistogram.

void inc2D ( u_int16_t  index1,
u_int16_t  index2 
)
inlinevirtual

Increase the number of kmers occurring X time in genome and Y times in read

Parameters
[in]index1: the X value.
[in]index2: the Y value.

Implements IHistogram.

void save ( tools::storage::impl::Group group)
inlinevirtual

Save the distribution. It is saved into the bag provided at construction.

Implements IHistogram.


The documentation for this class was generated from the following file: