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

PhasedMTDMarkov.h

Go to the documentation of this file.
00001 /* seqpp/PhasedMTDMarkov.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 
00028 #ifndef SEQPP_PHASEDMTDMARKOV_H
00029 #define SEQPP_PHASEDMTDMARKOV_H
00030 
00031 #include <seqpp/PhasedMarkov.h>
00032 #include <seqpp/mtd_core.h>
00033 
00045 class PhasedMTDMarkov : public PhasedMarkov
00046 {
00047  protected : 
00049   mtd_core * _mtdcore;
00050 
00051  public:
00053 
00063   template< class TSeq >
00064   PhasedMTDMarkov( const TSeq & tseq, short mkv_order,
00065                    short phase, short initial_phase = 0,
00066                    short nbseed = NBSEED, int nbiter_max = NBITERMAX, double eps = EPS,
00067                    bool log = false )
00068     :  PhasedMarkov(  tseq.tell_alphabet_size(), tseq.tell_order(), phase )
00069   { 
00070     tseq.count_p_occurencies( phase, initial_phase ); 
00071     estimate( tseq.get_p_count(), true, mkv_order, phase, initial_phase, 
00072               nbseed, nbiter_max, eps, log );
00073   }
00074  
00076 
00088   PhasedMTDMarkov( unsigned long * * count,
00089                    short size, 
00090                    short mtd_order, short mkv_order,
00091                    short phase, short initial_phase = 0,
00092                    short nbseed = NBSEED, int nbiter_max = NBITERMAX, double eps = EPS,
00093                    bool log = false )
00094     :  PhasedMarkov( size, mtd_order, phase )
00095   {       
00096     estimate( count, false, mkv_order, phase, initial_phase, 
00097               nbseed, nbiter_max, eps, log );
00098   }
00099 
00101   void estimate( unsigned long * * count, bool decal_required,
00102                  short mkv_order,
00103                  short phase, short initial_phase,
00104                  short nbseed, int nbiter_max, double eps,
00105                  bool log )
00106  {   _mtdcore = new mtd_core( _size, _order, mkv_order );
00107    
00108    _nb_param = 0; 
00109 
00110    for (int i=0; i<phase; i++){    
00111      _nb_param += _mtdcore->nb_params();
00112      _mtdcore->estimate( count[i], decal_required,
00113                          nbseed, nbiter_max, eps, log );
00114      _mtdcore->mtd_to_matrix( _Pis[i] );
00115    }
00116    delete _mtdcore;
00117  }
00118  
00120  ~PhasedMTDMarkov(){} 
00121 };
00122 #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