calculating nonsynonymous ( ka ) and synonymous ( ks ) substitution rates is of great significance in reconstructing phylogeny and understanding evolutionary dynamics of protein - coding sequences across closely related and yet diverged species 1 .
, 2 . , 3 .. it is known that ka and ks , or often their ratio ( ka / ks ) , indicate neutral mutation when ka equals to ks , negative ( purifying ) selection when ka is less than ks , and positive ( diversifying ) selection when ka exceeds ks .
therefore , statistics of the two variables in genes from different evolutionary lineages provides a powerful tool for quantifying molecular evolution . over the past two decades
, several methods have been developed for this purpose , which can generally be classified into two classes : approximate method and maximum likelihood method .
the approximate method involves three basic steps : ( 1 ) counting the numbers of synonymous and nonsynonymous sites , ( 2 ) calculating the numbers of synonymous and nonsynonymous substitutions , and ( 3 ) correcting for multiple substitutions . on the other hand
, the maximum likelihood method integrates evolutionary features ( reflected in nucleotide models ) into codon - based models and uses the probability theory to finish all the three steps in one go ( 4 ) .
however , these methods adopt different substitution or mutation models based on different assumptions that take account of various sequence features , giving rise to varied estimates of evolutionary distance ( 5 ) . in other words , ka and
in addition , since the amount and the degree of sequence substitutions vary among datasets from diverse taxa , a single model or method may not be adequate for accurate ka and ks calculations . therefore , a model selection step , that is , to choose a best - fit model when estimating ka and ks , becomes critical for capturing appropriate evolutionary information 6 . , 7
.. toward this end , we have applied model selection and model averaging techniques for ka and ks estimations .
we use a maximum likelihood method based on a set of candidate substitution models and adopt the akaike information criterion ( aic ) to measure fitness between models and data . after choosing the best - fit model for calculating ka and ks , we average the parameters across the candidate models to include as many features as needed
since the true model is seldom one of the candidate models in practice ( 8) . finally , these considerations are incorporated into a software package , namely kaks_calculator .
substitution models play a significant role in phylogenetic and evolutionary analyses of protein - coding sequences by integrating diverse processes of sequence evolution through various assumptions and providing approximations to datasets .
, 14 . , 15 . , 16 . as shown in table 1 
 17 . ,
18 . , ranging from the jukes - cantor ( jc ) model , which assumes that all substitutions have equal rates and equal nucleotide frequencies , to the general time - reversible ( gtr ) model that considers six different substitution rates and unequal nucleotide frequencies .
subsequently , we incorporated the parameters in each nucleotide model into a codon - based model 19 . , 20 .. as a result , a general formula of the substitution rate qij from any sense
codon i to j ( i  j ) is given for all candidate models ( 19):qij={0ifiandjdifferbymorethanonedifferencekxyjifiandjdifferbyasynonymoussubstitutionofxforykxyjifiandjdifferbyanonsynonymoussubstitutionofxforywhere  
 j is the frequency of codon j ,  is the ka / ks ratio , and kxy is the ratio of rxy to rca , x , y {a , c , g , t } ( table 1 ) .
for example , in the jc model , kxy and j are equal to 1 owing to equal substitution rates and equal nucleotide frequencies assumed . in the hasegawa - kishino - yano ( hky ) model , ktc and kag become equivalent to the transition / transversion rate ratio and j can be estimated from sequences , similar to the method reported by goldman and yang ( 19 ) .
therefore , we could acquire maximum likelihood scores in various values generated from individual candidate model by implementing the codon - based models in a maximum likelihood framework 19 .
, 20 .. aic ( 21 ) has been widely used in model selection aside from other methods such as the likelihood ratio test ( lrt ) and the bayesian information criterion ( bic ) ( 8) .
aic characterizes the kullback - leibler distance between a true model and an examined model , and this distance can be regarded as quantifying the information lost by approximating the true model .
kaks_calculator uses a modification of aic ( aicc ) , which takes account of sampling size ( n ) , maximum likelihood score ( lnli ) , and the number of parameters ( ki ) in model i as follows : aicci = aici+2ki(ki+1)nki1=2lnli+2ki+2ki(ki+1)nki1 aicc is proposed to correct for small sampling size , and it approaches to aic when sampling size comes to infinity .
consequently , we could use this equation to compute aicc for each candidate model and then identify a model that possesses the smallest aicc , which is a sign for appropriateness between models and data .
model selection is merely an approximate fit to a dataset , whereas a true evolutionary model is seldom one of the candidate models ( 8) .
therefore , an alternative way is model averaging , which assigns each candidate model a weight value and engages more than one model to estimate average parameters across models .
accordingly , we first need to compute the akaike weight ( wi , where i = 1 , 2 ,  , m ) for each model in a set of candidate models : wi = exp[12(aicciminaicc)]j=1mexp[12(aiccjminaicc)]where min aicc is the smallest aicc value among candidate models . we can then estimate model - averaged parameters . taking ktc as an example , a model - averaged estimate can be calculated by : ktc=i=1m[wii(ktc , i)ktc , i]i=1m[wii(ktc , i)]where ktc , i is ktc in model i andi(ktc , i)={1ifrtcrcainmodeli0otherwise
substitution models play a significant role in phylogenetic and evolutionary analyses of protein - coding sequences by integrating diverse processes of sequence evolution through various assumptions and providing approximations to datasets .
, 14 . , 15 . , 16 . as shown in table 1 
 17 . ,
18 . , ranging from the jukes - cantor ( jc ) model , which assumes that all substitutions have equal rates and equal nucleotide frequencies , to the general time - reversible ( gtr ) model that considers six different substitution rates and unequal nucleotide frequencies .
subsequently , we incorporated the parameters in each nucleotide model into a codon - based model 19 . , 20 .. as a result , a general formula of the substitution rate qij from any sense
codon i to j ( i  j ) is given for all candidate models ( 19):qij={0ifiandjdifferbymorethanonedifferencekxyjifiandjdifferbyasynonymoussubstitutionofxforykxyjifiandjdifferbyanonsynonymoussubstitutionofxforywhere  
 j is the frequency of codon j ,  is the ka / ks ratio , and kxy is the ratio of rxy to rca , x , y {a , c , g , t } ( table 1 ) .
for example , in the jc model , kxy and j are equal to 1 owing to equal substitution rates and equal nucleotide frequencies assumed . in the hasegawa - kishino - yano ( hky ) model , ktc and kag become equivalent to the transition / transversion rate ratio and j can be estimated from sequences , similar to the method reported by goldman and yang ( 19 ) .
therefore , we could acquire maximum likelihood scores in various values generated from individual candidate model by implementing the codon - based models in a maximum likelihood framework 19 .
aic ( 21 ) has been widely used in model selection aside from other methods such as the likelihood ratio test ( lrt ) and the bayesian information criterion ( bic ) ( 8) .
aic characterizes the kullback - leibler distance between a true model and an examined model , and this distance can be regarded as quantifying the information lost by approximating the true model .
kaks_calculator uses a modification of aic ( aicc ) , which takes account of sampling size ( n ) , maximum likelihood score ( lnli ) , and the number of parameters ( ki ) in model i as follows : aicci = aici+2ki(ki+1)nki1=2lnli+2ki+2ki(ki+1)nki1 aicc is proposed to correct for small sampling size , and it approaches to aic when sampling size comes to infinity .
consequently , we could use this equation to compute aicc for each candidate model and then identify a model that possesses the smallest aicc , which is a sign for appropriateness between models and data .
model selection is merely an approximate fit to a dataset , whereas a true evolutionary model is seldom one of the candidate models ( 8) .
therefore , an alternative way is model averaging , which assigns each candidate model a weight value and engages more than one model to estimate average parameters across models .
accordingly , we first need to compute the akaike weight ( wi , where i = 1 , 2 ,  , m ) for each model in a set of candidate models : wi = exp[12(aicciminaicc)]j=1mexp[12(aiccjminaicc)]where min aicc is the smallest aicc value among candidate models . we can then estimate model - averaged parameters . taking ktc as an example
, a model - averaged estimate can be calculated by : ktc=i=1m[wii(ktc , i)ktc , i]i=1m[wii(ktc , i)]where ktc , i is ktc in model i andi(ktc , i)={1ifrtcrcainmodeli0otherwise
kaks_calculator is written in standard c++ language . it is readily compiled and run on unix / linux or workstation ( tested on aix / irix / solaris ) .
in addition , we use visual c++ 6.0 for graphic user interface and provide its windows version that can run on any ibm compatible computer under windows operating system ( tested on windows 2000/xp ) . compiled executables on aix / irix / solaris and setup application on windows , as well as source codes , example data , instructions for installation and documentation for kaks_calculator is available at http://evolution.genomics.org.cn/software.htm .
, kaks_calculator employs model - selected and model - averaged methods based on a set of candidate models to estimate ka and ks .
it integrates as many features as needed from sequence data and in most cases gives rise to more reliable evolutionary information ( see the comparative results on simulated sequences at http://evolution.genomics.org.cn/doc/simulatedresults.xls ) ( 24 ) .
kaks_calculator also provides comprehensive information estimated from compared sequences , including the numbers of synonymous and nonsynonymous sites and substitutions , gc contents , maximum likelihood scores , and aicc .
, 25 . , 26 . , 27 . , 28 . , 29 . , 30 . , 31 . and allows users to choose one or more methods at one running time ( table 2 ) .
although there exist 203 time - reversible models of nucleotide substitution ( 8) , model selection in practice is often limited to a subset of them ( 32 ) , and thus model averaging can reduce biases arising from model selection .
therefore , model - averaged methods should be preferred for general calculations of ka and ks .
some planned improvements include application of model selection and model averaging to detect positive selection at single amino acid sites , which requires high - speed computing for maximum likelihood estimation , especially when an adopted model becomes complex . in conclusion
, kaks_calculator incorporates as many features as needed for accurately extracting evolutionary information through model selection and model averaging , therefore it may be useful for in - depth studies on phylogeny and molecular evolution .
zz designed and programmed this software , and drafted the manuscript . jl carried out computer simulations to generate sequences .
 kaks_calculator is a software package that calculates nonsynonymous ( ka ) and synonymous ( ks ) substitution rates through model selection and model averaging . since existing methods for 
 this estimation adopt their specific mutation ( substitution ) models that consider different evolutionary features , leading to diverse estimates , kaks_calculator implements a set of candidate models in a maximum likelihood framework and adopts the akaike information criterion to measure fitness between models and data , aiming to include as many features as needed for accurately capturing evolutionary information in protein - coding sequences . 
 in addition , several existing methods for calculating ka and ks are also incorporated into this software . 
 kaks_calculator , including source codes , compiled executables , and documentation , is freely available for academic use at http://evolution.genomics.org.cn/software.htm . 
Introduction
Algorithm
Candidate models
Model selection
Model averaging
Application
Authors contributions
Competing interests