modified: SpatialOmicsCoord.py
[GalaxyCodeBases.git] / c_cpp / etc / KaKs_Calculator / src / MYN.h
blob30f8de81645fde705ca894f14df2c4b77156950f
1 /************************************************************
2 * Copyright (c) 2005, BGI of Chinese Academy of Sciences
3 * All rights reserved.
5 * Filename: MYN.h
6 * Abstract: Declaration of Modified YN00 (MYN) class.
8 * Version: 1.0
9 * Author: Zhang Zhang(zhanghzhang@genomics.org.cn)
10 * Date: Dec.30, 2005
12 References:
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 *************************************************************/
18 #if !defined(MYN_H)
19 #define MYN_H
21 #define CODONFREQ 12
22 #define min(a,b) ((a)<(b)?(a):(b))
23 #define max(a,b) ((a)>(b)?(a):(b))
24 #define square(a) ((a)*(a))
26 #include "base.h"
27 #include "YN00.h"
29 using namespace std;
31 class MYN: public YN00 {
33 public:
34 MYN();
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);
39 /* Count S and N */
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);
45 /* Count Sd and Nd */
46 int CountDiffs(const string seq1, const string seq2, double &Sdts1, double &Sdts2, double &Sdtv,double &Ndts1, double &Ndts2, double &Ndtv,double PMatrix[]);
47 /* Main function */
48 virtual int DistanceYN00(const string seq1, const string seq2, double &dS,double &dN, double &SEdS, double &SEdN);
52 #endif