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

VLMarkov.h

Go to the documentation of this file.
00001 /* seqpp/VLMarkov.h
00002  *
00003  * Copyright (C) 2003 Laboratoire Statistique & Génome
00004  *
00005  * This program is free software; you can redistribute it and/or modify
00006  * it under the terms of the GNU General Public License as published by
00007  * the Free Software Foundation; either version 2 of the License, or (at
00008  * your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software
00017  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  */
00019 
00027 #ifndef SEQPP_VLMARKOV_H
00028 #define SEQPP_VLMARKOV_H
00029 
00030 #include <seqpp/Markov.h>
00031 #include <seqpp/PhasedVLMarkov.h>
00032 #include <seqpp/vlm_tree.h>
00033 
00044 class VLMarkov : public Markov
00045 {
00046  protected :
00048   vlm_tree * _vlmtree;
00049 
00050  public: 
00052 
00057   template <class TSeq>
00058     VLMarkov( const TSeq & tseq,
00059               vector<double> & init, double cutoff )
00060     : Markov( tseq.tell_alphabet_size(), tseq.tell_order() )
00061   {   
00062     _vlmtree = new vlm_tree( tseq.get_coder(),
00063                              _size,                         
00064                              _order,
00065                              init );
00066     tseq.count_occurencies( );
00067     _vlmtree->estimate_context( tseq.get_count(),
00068                                 cutoff );
00069     _vlmtree->tree_to_matrix( _Pi );
00070     _nb_param = _vlmtree->nb_leaves() * (_size-1); 
00071 
00072     delete _vlmtree; 
00073   }
00074   
00076 
00080   template <class TSeq>
00081     VLMarkov( const TSeq & tseq,
00082               double cutoff )
00083     : Markov( tseq.tell_alphabet_size(), tseq.tell_order() )
00084   {
00085     vector<double> init;
00086     for (short i = 0; i<_size; i++)
00087       init.push_back( 1./_size );
00088     
00089     _vlmtree = new vlm_tree( tseq.get_coder(),
00090                              _size,                         
00091                              _order,
00092                              init );
00093     tseq.count_occurencies( );
00094     _vlmtree->estimate_context( tseq.get_count(),
00095                                 cutoff );
00096     _vlmtree->tree_to_matrix( _Pi );
00097     _nb_param = _vlmtree->nb_leaves() * (_size-1);  
00098     
00099     delete _vlmtree;
00100   }
00101 
00102   ~VLMarkov(){}
00103 };
00104 #endif



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


Generated on Sun Apr 3 14:16:10 2005 for seqpp by doxygen 1.3.9.1