Version 4.0.0
Main Page | Class Hierarchy | Class List | File List | Class Members | Related Pages

PrimaryCount Class Reference

Abstract class designed for the (coded)word count. More...

#include <seqpp/PrimaryCount.h>

Inheritance diagram for PrimaryCount:

Sequence SequenceSet List of all members.

Public Member Functions

virtual ~PrimaryCount ()
 destructor
void clear_count () const
 clear the count
void null_count () const
 put all counts down to 0
short tell_order () const
 returns the markovian order
int tell_nb_value () const
 returns the nber of codes/words taking into interest
long tell_jump () const
 returns the jump to the codes of _order+1 letters
long * get_jump () const
 returns the vector of the jumps to the codes of i letters, 0<i<=order+2
Coderget_coder () const
 allows a const access to the coder
bool is_count_ok () const
 checks if the count is available
unsigned long ** get_p_count () const
 get the total count, in the phased case
unsigned long * get_count (short p=0) const
 get the total count in a phase p, or in the unphased case
short tell_phase () const
 returns nb of phase
void count_p_occurencies (short phase, short initial_phase, unsigned long beg, unsigned long end) const
 Phased count the number of occurencies of all the nbvalue codes (in the sub-sequence [beg...end])... beware: beg>=0 but not >0.
void count_p_occurencies (unsigned long **extern_count, short phase, short initial_phase, unsigned long beg, unsigned long end) const
 Phased extern count the number of occurencies of all the nbvalue codes (in the sub-sequence [beg...end])... beware: beg>=0 but not >0.
void count_p_occurencies (unsigned long **extern_count, short phase, short initial_phase=0) const
 Phased extern count the number of occurencies of all the nbvalue codes in the whole sequence.
void count_p_occurencies (short phase, short initial_phase=0) const
 Phased count the number of occurencies of all the nbvalue codes in the whole sequence.
void count_occurencies (unsigned long beg, unsigned long end) const
 Extern count the number of occurencies of all the nbvalue codes (in the sub-sequence [beg...end])... beware: beg>=0 but not >0.
void count_occurencies () const
 Count the number of occurencies of all the nbvalue codes in the whole sequence.
unsigned long tell_p_occurencies (long code, short numphase) const
 extract the number of occurencies of code in phase
unsigned long tell_occurencies (long code) const
 extract the number of occurencies of obs

Protected Member Functions

void init_count () const
 initialize the count
virtual unsigned long tell_max_count () const =0
 return the max length for the count
virtual void compute_count (unsigned long **extern_count, short phase, short initial_phase, unsigned long beg, unsigned long end) const =0
 compute the count

Protected Attributes

short _order
 Order of the model.
long _nbvalue
 nber of codes/words taking into interest
short _nbinv
 number of invalid negative code
Coder_coder
 markovian coder associated to the order of the sequence
bool _coder_in
 true if _coder is build in the class
unsigned long ** _count
 count of each code/word, even invalid (-1)
bool _count_ok
 if the count is available
short _phase
 phase for the count

Detailed Description

Abstract class designed for the (coded)word count.

This object is based on integer codes to store words as required for a markov modelling (see Sequence). The words are coded in alphabet_size base, coding the 1-token words, then the 2-tokens words, the 3-tokens words... Let call jump(i) the first code of a i-tokens words, a PrimaryCount object is designed to count all words:

  (example with alphabet AGCT and order=2)
  0              first word ( 0 -> A)
  ..
  ..             1-token words (from A to T)
  ..
  jump(1)        (4 -> AA)
  ..
  ..             2-tokens words (from AA to TT)
  ..
  jump(2)        (20 -> AAA)
  ..
  ..             3-tokens words (from AAA to TTT)
  ..
  ..
  ..             last word (TTT)
  jump(order+1)  (64 -> /end)
The count can also be phased.


Member Function Documentation

void PrimaryCount::count_occurencies unsigned long  beg,
unsigned long  end
const [inline]
 

Extern count the number of occurencies of all the nbvalue codes (in the sub-sequence [beg...end])... beware: beg>=0 but not >0.

Parameters:
beg the sub-sequence [beg...
end the sub-sequence ...end]

void PrimaryCount::count_p_occurencies short  phase,
short  initial_phase = 0
const [inline]
 

Phased count the number of occurencies of all the nbvalue codes in the whole sequence.

Parameters:
phase phase
initial_phase phase of the first element of associated sequence

void PrimaryCount::count_p_occurencies unsigned long **  extern_count,
short  phase,
short  initial_phase = 0
const [inline]
 

Phased extern count the number of occurencies of all the nbvalue codes in the whole sequence.

Parameters:
extern_count extern count storage
phase phase
initial_phase phase of the first element of associated sequence

void PrimaryCount::count_p_occurencies unsigned long **  extern_count,
short  phase,
short  initial_phase,
unsigned long  beg,
unsigned long  end
const [inline]
 

Phased extern count the number of occurencies of all the nbvalue codes (in the sub-sequence [beg...end])... beware: beg>=0 but not >0.

Parameters:
extern_count extern count storage
phase phase
initial_phase phase of the first element of associated sequence
beg the sub-sequence [beg...
end the sub-sequence ...end]

void PrimaryCount::count_p_occurencies short  phase,
short  initial_phase,
unsigned long  beg,
unsigned long  end
const [inline]
 

Phased count the number of occurencies of all the nbvalue codes (in the sub-sequence [beg...end])... beware: beg>=0 but not >0.

Parameters:
phase phase
initial_phase phase of the first element of associated sequence
beg the sub-sequence [beg...
end the sub-sequence ...end]

unsigned long* PrimaryCount::get_count short  p = 0  )  const [inline]
 

get the total count in a phase p, or in the unphased case

Parameters:
p selected phase, default 0 if unphased case.


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



Download seq++ 4.0.0
Download previous versions
Statistique & Genome Home


Generated on Wed Mar 23 09:25:58 2005 for seqpp by doxygen 1.3.9.1