![]() |
Version 4.2.0 |
#include <seqpp/Markov.h>

Public Member Functions | |
| Markov (const char *ConfFile, bool calc_rank=false) | |
| Constructor 1 : read a configuration file. | |
| Markov (const SequenceSet &seqset, bool calc_rank=false, const string &prior_alpha_file=string()) | |
| Constructor 2 : Estimate the transition matrices on the sequences of seqset. | |
| Markov (const Sequence &seq, bool calc_rank=false, const string &prior_alpha_file=string()) | |
| Constructor 3 : Estimate the transition matrices on the sequence seq. | |
| Markov (const Markov &) | |
| Constructor 4 : Copy constructor. | |
| Markov () | |
| Constructor 5 : Default constructor. | |
| Markov (short size, short order, bool alloc=true, const string &prior_alpha_file=string()) | |
| Constructor 6 : Minimal Constructor. | |
| Markov (const Markov &M1, const Markov &M2, const float p) | |
| Constructor 7 : Creation of a mixed Markov chain M = p*M1 + (1-p)*M2 */. | |
| Markov (const gsl_rng *r, short size, short order, bool calc_rank=false) | |
| Constructor 8 : random markov matrices. | |
| Markov (unsigned long *count, short size, short order, const string &prior_alpha_file=string(), bool calc_rank=false) | |
| Constructor 9 : Estimate the transition matrices on a word-count. | |
| virtual | ~Markov () |
| Destructor. | |
| template<class TSeq> | |
| void | estimate (const TSeq &tseq, unsigned long beg, unsigned long end, bool calc_rank) |
| Estimate the transition matrices on the sequence/sequenceset tseq. | |
| void | estimate (unsigned long *count, bool decal_required, bool calc_rank=false) |
| Estimate the transition matrices from a word count. | |
| void | estimate (const string &count_file, bool calc_rank=false) |
| Estimate the transition matrices from a file containing the count. | |
| const double * | markov_matrix () const |
| access to the markov matrix | |
| void | draw_markov_matrix (const gsl_rng *r) |
| draw at random the markov matrix | |
| void | free_markov_matrix () |
| free the memory allocated for markov matrix | |
| void | compute_stat_law (bool force=false) |
| Compute the stationnary laws. | |
| void | free_stat_law () |
| free the memory allocated for stationnary law | |
| const double * | stat_law () const |
| access to the stationnary distrib | |
| virtual int | compute_rank () |
| Computes the rank of convergence of the Markov Chain. | |
| void | compute_power () |
| Initialisation the _rank powers of the markov matrix. | |
| int | free_power () |
| free the memory allocated for the power | |
| double | proba_step (long w1, long w2, int step) |
| transition from word w1 to word w2 in step steps | |
| bool | isPi () const |
| bool | isPow () const |
| bool | isMu () const |
| double & | operator() (int index) |
| () operator for Markov matrix Pi elements | |
| double | Mu (int index) const |
| Access to stationnary vector Mu elements. | |
Protected Attributes | |
| double * | _Pi |
| Pointer to "Matrix" (in a vector format) of transition probabilities (=_Pis[0]). | |
| double * | _container |
| Container of "Matrix" (in a vector format) of transition probabilities (=_containers[0]). | |
| double * | _Mu |
| Vector of stationnary probabilities (=_Mus[0]). | |
| double *** | _PowPi |
| Power of the _Pi matrix. | |
This is a special case of a phased Markov [PhasedMarkov] model when only one phase is considered.
| Markov::Markov | ( | const SequenceSet & | seqset, | |
| bool | calc_rank = false, |
|||
| const string & | prior_alpha_file = string() | |||
| ) |
Constructor 2 : Estimate the transition matrices on the sequences of seqset.
| seqset | set of sequences for estimation | |
| calc_rank | calculus of the convergence rank if true | |
| prior_alpha_file | file containing the alpha for the a priori law, one value per alphabet element |
References _container, PhasedMarkov::_containers, _Mu, PhasedMarkov::_Mus, _Pi, PhasedMarkov::_Pis, and _PowPi.
| Markov::Markov | ( | const Sequence & | seq, | |
| bool | calc_rank = false, |
|||
| const string & | prior_alpha_file = string() | |||
| ) |
Constructor 3 : Estimate the transition matrices on the sequence seq.
| seq | sequence for estimation | |
| calc_rank | calculus of the convergence rank if true | |
| prior_alpha_file | file containing the alpha for the a priori law, one value per alphabet element |
References _container, PhasedMarkov::_containers, _Mu, PhasedMarkov::_Mus, _Pi, PhasedMarkov::_Pis, and _PowPi.
| Markov::Markov | ( | short | size, | |
| short | order, | |||
| bool | alloc = true, |
|||
| const string & | prior_alpha_file = string() | |||
| ) | [inline] |
Constructor 6 : Minimal Constructor.
Initialises the constants of the model but not the matrix nor the stat law
| size | alphabet size | |
| order | markovian order | |
| alloc | true for matrices memory allocation | |
| prior_alpha_file | file containing the alpha for the a priori law, one value per alphabet element |
References _container, PhasedMarkov::_containers, _Mu, _Pi, PhasedMarkov::_Pis, and _PowPi.
Constructor 7 : Creation of a mixed Markov chain M = p*M1 + (1-p)*M2 */.
| M1 | first Markov chain object | |
| M2 | second Markov chain object | |
| p | weight of M1 in the resulting M(with 0<=p<=1) |
References _container, PhasedMarkov::_containers, _Mu, PhasedMarkov::_Mus, _Pi, PhasedMarkov::_Pis, and _PowPi.
| Markov::Markov | ( | const gsl_rng * | r, | |
| short | size, | |||
| short | order, | |||
| bool | calc_rank = false | |||
| ) | [inline] |
Constructor 8 : random markov matrices.
| r | gsl random generator | |
| size | alphabet size | |
| order | markovian order | |
| calc_rank | calculus of the convergence rank if true GSL use exple: const gsl_rng_type * T; // Choice a default generator and seed // from environment variables gsl_rng_env_setup(); // New created instance of the generator T = gsl_rng_default; gsl_rng * r = gsl_rng_alloc (T); // Initialize/Seeds the random number generator gsl_rng_set( r, (long)getpid() ); |
References _container, PhasedMarkov::_containers, _Mu, _Pi, PhasedMarkov::_Pis, and _PowPi.
| Markov::Markov | ( | unsigned long * | count, | |
| short | size, | |||
| short | order, | |||
| const string & | prior_alpha_file = string(), |
|||
| bool | calc_rank = false | |||
| ) |
Constructor 9 : Estimate the transition matrices on a word-count.
| count | count of all the coded word(base size) of size order+1 for estimation | |
| size | alphabet size | |
| order | markovian order | |
| calc_rank | calculus of the convergence rank if true | |
| prior_alpha_file | file containing the alpha for the a priori law, one value per alphabet element |
References _container, PhasedMarkov::_containers, _Mu, PhasedMarkov::_Mus, _Pi, PhasedMarkov::_Pis, and _PowPi.
| void Markov::estimate | ( | const TSeq & | tseq, | |
| unsigned long | beg, | |||
| unsigned long | end, | |||
| bool | calc_rank | |||
| ) | [inline] |
Estimate the transition matrices on the sequence/sequenceset tseq.
| tseq | sequence/sequenceset for estimation | |
| beg | begin position in sequence(s) if subsequences | |
| end | end position in sequence(s) if subsequences | |
| calc_rank | calculus of the convergence rank if true |
References PhasedMarkov::estimate().
| void Markov::estimate | ( | unsigned long * | count, | |
| bool | decal_required, | |||
| bool | calc_rank = false | |||
| ) | [inline] |
Estimate the transition matrices from a word count.
| count | count of all the coded word(base size) of size order+1, for estimation | |
| decal_required | necessary when using a count of word from 1-word to (_order+1)-word | |
| calc_rank | calculus of the convergence rank if true |
References PhasedMarkov::estimate().
| void Markov::estimate | ( | const string & | count_file, | |
| bool | calc_rank = false | |||
| ) | [inline] |
Estimate the transition matrices from a file containing the count.
| count_file | file containing the count in the adapted format | |
| calc_rank | calculus of the convergence rank if true |
Reimplemented from PhasedMarkov.
References PhasedMarkov::estimate().
| void Markov::draw_markov_matrix | ( | const gsl_rng * | r | ) | [inline] |
draw at random the markov matrix
| r | gsl random generator |
const gsl_rng_type * T; // Choice a default generator and seed // from environment variables gsl_rng_env_setup(); // New created instance of the generator T = gsl_rng_default; gsl_rng * r = gsl_rng_alloc (T); // Initialize/Seeds the random number generator gsl_rng_set( r, (long)(time( NULL )) ); ... ... gsl_rng_free( r );
References PhasedMarkov::draw_markov_matrices().
| double Markov::proba_step | ( | long | w1, | |
| long | w2, | |||
| int | step | |||
| ) | [inline] |
transition from word w1 to word w2 in step steps
-a Translator object is required to process string to int, use link_to_translator- if step > _rank, give stat_law(w2). You must have w1, w2 of length order
| w1 | first word (of length order) as a string | |
| w2 | second word (of length order) as a string transition from word w1 to word w2 in step steps |
| w1 | first word (of length order) as a vector of short | |
| w2 | second word (of length order) as a vector of short transition from word w1 to word w2 in step steps |
| w1 | first word (of length order) as a Sequence-coded-like integer (see Sequence) | |
| w2 | second word (of length order) as a Sequence-coded-like integer (see Sequence) | |
| step | number of steps between w1 and w2 |
References _Mu, _PowPi, PhasedMarkov::_rank, compute_power(), and compute_rank().
| bool Markov::isPi | ( | ) | const [inline] |
_Pi == NULL ?
References _Pi.
| bool Markov::isPow | ( | ) | const [inline] |
| bool Markov::isMu | ( | ) | const [inline] |
_Mu == NULL ?
References _Mu.
| double& Markov::operator() | ( | int | index | ) | [inline] |
| double Markov::Mu | ( | int | index | ) | const [inline] |
| Download seq++ 4.2.0 |
| Download previous versions |
| Statistique & Genome Home |
| Contributors : M.Baudry, P.Y.Bourguignon, M.Hoebeke, V.Miele, P.Nicolas, G.Nuel, H.Richard, D.Robelin |
1.5.6