gatb.core-API-1.4.2
SortingCountAlgorithm< span > Class Template Reference

Class performing the kmer counting (also known as 'DSK') More...

#include <SortingCountAlgorithm.hpp>

Inheritance diagram for SortingCountAlgorithm< span >:
Inheritance graph

Public Member Functions

 SortingCountAlgorithm (tools::misc::IProperties *params=0)
 
 SortingCountAlgorithm (gatb::core::bank::IBank *bank, tools::misc::IProperties *params)
 
 SortingCountAlgorithm (gatb::core::bank::IBank *bank, const Configuration &config, Repartitor *repartitor, std::vector< CountProcessor * > processors, tools::misc::IProperties *params)
 
virtual ~SortingCountAlgorithm ()
 
SortingCountAlgorithmoperator= (const SortingCountAlgorithm &s)
 
void execute ()
 
size_t getProcessorNumber () const
 
CountProcessorgetProcessor (size_t idx)
 
void addProcessor (CountProcessor *processor)
 
tools::storage::impl::Partition< Count > * getSolidCounts ()
 
tools::collections::Iterable< Type > * getSolidKmers ()
 
const kmer::impl::Configuration & getConfig () const
 
RepartitorgetRepartitor ()
 
- Public Member Functions inherited from Algorithm
 Algorithm (const std::string &name, int nbCores=-1, gatb::core::tools::misc::IProperties *input=0)
 
virtual ~Algorithm ()
 
std::string getName () const
 
void run ()
 
virtual IPropertiesgetInput ()
 
virtual IPropertiesgetOutput ()
 
virtual IPropertiesgetInfo ()
 
virtual dp::IDispatchergetDispatcher ()
 
virtual TimeInfogetTimeInfo ()
 
virtual IPropertiesgetSystemInfo ()
 
template<typename Item >
dp::Iterator< Item > * createIterator (dp::Iterator< Item > *iter, size_t nbIterations=0, const char *message=0, dp::IteratorListener *listener=0)
 
virtual dp::IteratorListenercreateIteratorListener (size_t nbIterations, const char *message)
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 

Static Public Member Functions

static tools::misc::IOptionsParsergetOptionsParser (bool mandatory=true)
 
static tools::misc::IPropertiesgetDefaultProperties ()
 
static CountProcessorgetDefaultProcessor (tools::misc::IProperties *params, tools::storage::impl::Storage *dskStorage, tools::storage::impl::Storage *otherStorage=0)
 
static std::vector< ICountProcessor< span > * > getDefaultProcessorVector (Configuration &config, tools::misc::IProperties *params, tools::storage::impl::Storage *dskStorage, tools::storage::impl::Storage *otherStorage=0)
 
- Static Public Member Functions inherited from Algorithm
template<template< size_t > class Functor>
static int mainloop (tools::misc::IOptionsParser *parser, int argc, char *argv[])
 

Additional Inherited Members

- Protected Member Functions inherited from Algorithm
std::string getUriByKey (const std::string &key)
 
std::string getUri (const std::string &str)
 
void setInput (IProperties *input)
 
- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

template<size_t span = KMER_DEFAULT_SPAN>
class gatb::core::kmer::impl::SortingCountAlgorithm< span >

Class performing the kmer counting (also known as 'DSK')

This class does the real job of counting the kmers from a reads database.

This is a template class whose template argument is the kind of integer used for kmers (integers on 64 bits, 128 bits, etc...)

We define some template instantiations of this SortingCountAlgorithm; such an instantiation does the real job of kmers counting. By defining several instantiations, we allow to choose dynamically the correct class according to the user choice for kmer size (remember that initial Minia version had to be re-compiled for different kmer size).

Actually, this class is mainly used in the debruijn::impl::Graph class as a first step for the de Bruijn graph creation.

Constructor & Destructor Documentation

Constructor. Can be used as default constructor in no parameters are provided

Parameters
[in]params: parameters to be used for configuring the algorithm

Constructor.

Parameters
[in]bank: input bank from which solid kmers are counted
[in]params: parameters to be used for configuring the algorithm
SortingCountAlgorithm ( gatb::core::bank::IBank bank,
const Configuration &  config,
Repartitor repartitor,
std::vector< CountProcessor * >  processors,
tools::misc::IProperties params 
)

Constructor.

Parameters
[in]bank: input bank from which solid kmers are counted
[in]config: configuration information
[in]repartitor: hash function for minimizers
[in]processor: object that processes counts
~SortingCountAlgorithm ( )
virtual

Destructor

Member Function Documentation

void addProcessor ( CountProcessor processor)
inline

Setter for the CountProcessor to be used by the algorithm.

Parameters
[in]processor: the count processor to be used.
void execute ( )
virtual

Process the kmers counting. It is mainly composed of a loop over the passes, and for each pass : 1) we build the partition files then 2) we fill the solid kmers file from the partitions.

Implements Algorithm.

const kmer::impl::Configuration& getConfig ( ) const
inline

Get the configuration object for the algorithm.

Returns
the Configuration object.
ICountProcessor< span > * getDefaultProcessor ( tools::misc::IProperties params,
tools::storage::impl::Storage dskStorage,
tools::storage::impl::Storage otherStorage = 0 
)
static

Creates a default CountProcessor instance (ie. the default one used by DSK)

Parameters
[in]params: used for configuring the processor
[in]dskStorage: storage for dumping [kmer,count] couples
[in]otherStorage: used for histogram for instance
Returns
a CountProcessor instance
vector< ICountProcessor< span > * > getDefaultProcessorVector ( Configuration &  config,
tools::misc::IProperties params,
tools::storage::impl::Storage dskStorage,
tools::storage::impl::Storage otherStorage = 0 
)
static

Creates a vector holding the default CountProcessor configuration

Parameters
[in]params: used for configuring the processor
[in]dskStorage: storage for dumping [kmer,count] couples
[in]otherStorage: used for histogram for instance
Returns
a vector of CountProcessor instances
IProperties * getDefaultProperties ( )
static

Get the default values defined in the default option parser.

Returns
default properties.
IOptionsParser * getOptionsParser ( bool  mandatory = true)
static

Get an option parser for kmers counting parameters. Dynamic allocation, so must be released when no more used.

Parameters
[in]mandatory: tells whether an argument has to be mandatory
Returns
an instance of IOptionsParser.
CountProcessor* getProcessor ( size_t  idx)
inline

Getter for the CountProcessor to be used by the algorithm.

Parameters
[in]idx: index of the processor to be retrieved
Returns
the processor
size_t getProcessorNumber ( ) const
inline

Get the number of count processors associated to the object.

Returns
number of processors.
Repartitor* getRepartitor ( )
inline

Get the repartitor instance, ie. the hash function built on minimizer information.

Returns
the Repartitor instance
Partition< typename SortingCountAlgorithm< span >::Count > * getSolidCounts ( )

Get the iterable over the computed solid kmers.

Returns
the solid kmers iterable.
Iterable< typename SortingCountAlgorithm< span >::Type > * getSolidKmers ( )

Get the iterable over the computed solid kmers.

Returns
the solid kmers iterable.
SortingCountAlgorithm< span > & operator= ( const SortingCountAlgorithm< span > &  s)

operator=

Parameters
[in]s: object to be copied.

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