1 /************************************************************
2 * Copyright (c) 2005, BGI of Chinese Academy of Sciences
6 * Abstract: Declaration of Modified YN00 (MYN) class.
9 * Author: Zhang Zhang(zhanghzhang@genomics.org.cn)
13 Zhang Zhang, Jun Li, Jun Yu. (2006) Computing Ka and Ks
14 with a consideration of unequal transitional substitutions.
15 BMC Evolutionary Biology, 6:44.
16 *************************************************************/
22 #define min(a,b) ((a)<(b)?(a):(b))
23 #define max(a,b) ((a)>(b)?(a):(b))
24 #define square(a) ((a)*(a))
31 class MYN
: public YN00
{
35 /* Get the two kappas between purines and between pyrimidines */
36 virtual int GetKappa(const string seq1
, const string seq2
);
37 /* Calculate the transition probability matrix */
38 int GetPMatCodon(double P
[], double kappa
, double omega
);
40 int CountSites(const string z
, double &Stot
,double &Ntot
,double fbS
[],double fbN
[]);
41 /* Correct for multiple substitutions for two kappas */
42 int CorrectKappaTN93(double n
, double P1
, double P2
, double Q
, double pi4
[], double &kappatc_TN93
, double &kappaag_TN93
);
43 /* Correct for multiple substitutions for Ka and Ks */
44 int CorrectKaksTN93(double n
, double P1
, double P2
, double Q
, double pi4
[], double &kaks
, double &SEkaks
);
46 int CountDiffs(const string seq1
, const string seq2
, double &Sdts1
, double &Sdts2
, double &Sdtv
,double &Ndts1
, double &Ndts2
, double &Ndtv
,double PMatrix
[]);
48 virtual int DistanceYN00(const string seq1
, const string seq2
, double &dS
,double &dN
, double &SEdS
, double &SEdN
);