kaks                 package:seqinr                 R Documentation

_t_o _G_e_t _a_n _E_s_t_i_m_a_t_i_o_n _o_f _K_a _a_n_d _K_s

_D_e_s_c_r_i_p_t_i_o_n:

     Ks and Ka  are respectively the number of substitutions per
     synonymous site and per nonsynonymous site between two
     protein-coding genes. The ratio of nonsynonymous (Ka) to
     synonymous (Ks) nucleotide substitution rates is an indicator of
     selective pressures on genes. A ratio significantly greater than 1
     indicates positive selective pressure. A ratio around 1 indicates
     either neutral evolution at the protein level or an averaging of
     sites under positive and negative selective pressures. A ratio
     less than 1 indicates pressures to conserve protein sequence (i.e.
     purifying selection). This function estimates the Ka and Ks values
     for a set of aligned sequences using the method published by Li
     (1993) and gives the associated variance matrix.

_U_s_a_g_e:

     kaks(x, debug = FALSE)

_A_r_g_u_m_e_n_t_s:

       x: An object of class 'alignment' 

   debug: If TRUE turns debug mode on

_V_a_l_u_e:

     ks : matrix of Ks values 

     ka : matrix of Ka values 

    vks : variance matrix of Ks 

    vka : variance matrix of Ka 

_N_o_t_e:

     When the alignment does not contain enough information (i.e we
     approach saturation), the Ka and Ks values take the value 10.
     Negative values indicate that Ka and Ks can not be computed.
      Codons with ambiguous bases are treated as gaps.
      Codons with gaps are not used for computations.

_A_u_t_h_o_r(_s):

     D. Charif, J.R. Lobry

_R_e_f_e_r_e_n_c_e_s:

     Li WH. (1993) Unbiased estimation of the rates of synonymous and
     nonsynonymous substitution.  _J Mol Evol._, *Jan*;36(1):96-9.
       Hurst LD. (2002) The Ka/Ks ratio: diagnosing the form of
     sequence evolution. _Trends Genet._, *Sept*;18(9):486.
        The C programm implementing this method was provided by Manolo
     Gouy. More info is needed here to trace back the original C source
     so as to credit correct source.
      'citation("seqinr")'

_S_e_e _A_l_s_o:

     'read.alignment'

_E_x_a_m_p_l_e_s:

      #
      # Simple Toy example:
      #
      s <- read.alignment(File = system.file("sequences/test.phylip", package = "seqinr"), format = "phylip")
      kaks(s)
      #
      # Check numeric results on an simple test example:
      #
      data(AnoukResult)
      Anouk <- read.alignment(File = system.file("sequences/Anouk.fasta", package = "seqinr"), format = "fasta")     
      if( ! all.equal(kaks(Anouk), AnoukResult) ) {
        warning("Poor numeric results with Anouk test file")
      } else {
        print("Results are OK with Anouk test file")
      }

