File: givenRatesMLDistance.h

package info (click to toggle)
fastml 3.11-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,772 kB
  • sloc: cpp: 48,522; perl: 3,588; ansic: 819; makefile: 386; python: 83; sh: 55
file content (61 lines) | stat: -rw-r--r-- 1,822 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
// $Id: givenRatesMLDistance.h 962 2006-11-07 15:13:34Z privmane $

#ifndef ___GIVEN_RATES_ML_DISTANCE_H
#define ___GIVEN_RATES_ML_DISTANCE_H

#include "definitions.h"
#include "countTableComponent.h"
#include "likeDist.h"
#include "stochasticProcess.h"
#include "logFile.h"
#include <cmath>
using namespace std;

class givenRatesMLDistance : public likeDist {
public:
  explicit givenRatesMLDistance(const stochasticProcess& sp,
				const Vdouble& rates,
				const MDOUBLE toll =0.0001,
				const MDOUBLE maxPairwiseDistance = 5.0
				)
    :  likeDist(sp, toll,maxPairwiseDistance),_rates(rates) {}

  explicit givenRatesMLDistance(stochasticProcess& sp,
				const Vdouble& rates,
				const MDOUBLE toll =0.0001,
				const MDOUBLE maxPairwiseDistance = 5.0
				)
    :  likeDist(sp, toll,maxPairwiseDistance),_rates(rates) {}

  explicit givenRatesMLDistance(const stochasticProcess& sp,
				const MDOUBLE toll =0.0001,
				const MDOUBLE maxPairwiseDistance = 5.0
				)
    :  likeDist(sp, toll,maxPairwiseDistance),_rates(0) {}

  explicit givenRatesMLDistance(stochasticProcess& sp,
				const MDOUBLE toll =0.0001,
				const MDOUBLE maxPairwiseDistance = 5.0
				)
    :  likeDist(sp, toll,maxPairwiseDistance),_rates(0) {}

  givenRatesMLDistance(const givenRatesMLDistance& other):
	likeDist(static_cast<likeDist>(other)), _rates(other._rates) {}

  virtual givenRatesMLDistance* clone() const {return new givenRatesMLDistance(*this);}

  void setRates(const Vdouble &rates) {_rates = rates;}

  // Returns the estimated ML distance between the 2 sequences.
  // if score is given, it will be assigned the log-likelihood.
  const MDOUBLE giveDistance(const sequence& s1,
			     const sequence& s2,
			     const vector<MDOUBLE>  * weights,
			     MDOUBLE* score=NULL) const;

private:
	Vdouble _rates;
};

#endif