Class YangCodonModel

All Implemented Interfaces:
Serializable, Cloneable, ExternalParameterListener, NamedParameterized, Parameterized, Report, RateMatrix, XMLConstants

public class YangCodonModel extends CodonModel implements Serializable, XMLConstants
Yang's model of codon evolution More advanced codon Substitution Models (of Neilson and Yang) are now included (the M1, and M2 models). They appear to be correct compare to PAML for the purposes of evaluating the likelihood. More models (eg M3 and others) will be added over time.
Version:
$Id: YangCodonModel.java,v 1.25 2004/10/18 01:45:40 matt Exp $
Author:
Andrew Rambaut, Alexei Drummond, Matthew Goode
See Also:
  • Field Details

  • Constructor Details

    • YangCodonModel

      public YangCodonModel(double omega, double kappa, double[] freq, CodonTable codonTable)
      constructor 1
      Parameters:
      omega - N/S rate ratio
      kappa - transition/transversion rate ratio
      freq - codon frequencies
      codonTable - codon table
    • YangCodonModel

      public YangCodonModel(double omega, double kappa, double[] freq)
      constructor 2 (universal codon table)
      Parameters:
      omega - N/S rate ratio
      kappa - transition/transversion rate ratio
      freq - codon frequencies
    • YangCodonModel

      public YangCodonModel(double[] params, double[] freq)
      constructor 4 (universal codon table)
      Parameters:
      params - parameter list
      freq - nucleotide frequencies
    • YangCodonModel

      public YangCodonModel(double[] params, double[] freq, CodonTable codonTable)
      constructor 3
      Parameters:
      params - parameter list
      freq - nucleotide frequencies
      codonTable - codon table
  • Method Details

    • getModelID

      public int getModelID()
      Description copied from class: AbstractRateMatrix
      get numerical code describing the model type
      Specified by:
      getModelID in interface RateMatrix
      Specified by:
      getModelID in class AbstractRateMatrix
      Returns:
      integer code identifying a substitution model
    • report

      public void report(PrintWriter out)
      Description copied from interface: Report
      print human readable report (e.g., on parameters and associated model)
      Specified by:
      report in interface Report
      Parameters:
      out - output stream
    • getNumParameters

      public int getNumParameters()
      Description copied from interface: Parameterized
      get number of parameters
      Specified by:
      getNumParameters in interface Parameterized
      Returns:
      number of parameters
    • setParameterSE

      public void setParameterSE(double paramSE, int n)
      Description copied from interface: Parameterized
      set standard errors for model parameter
      Specified by:
      setParameterSE in interface Parameterized
      Parameters:
      paramSE - standard error of parameter value
      n - parameter number
    • getKappaLowerLimit

      public final double getKappaLowerLimit()
    • getOmegaLowerLimit

      public final double getOmegaLowerLimit()
    • getKappaUpperLimit

      public final double getKappaUpperLimit()
    • getOmegaUpperLimit

      public final double getOmegaUpperLimit()
    • getKappaDefaultValue

      public final double getKappaDefaultValue()
    • getOmegaDefaultValue

      public final double getOmegaDefaultValue()
    • getOmega

      public final double getOmega()
    • getKappa

      public final double getKappa()
    • setKappaSE

      public final void setKappaSE(double value)
    • setOmegaSE

      public final void setOmegaSE(double value)
    • setKappa

      public final void setKappa(double value)
    • setOmega

      public final void setOmega(double value)
    • getLowerLimit

      public double getLowerLimit(int n)
      Description copied from interface: Parameterized
      get lower parameter limit
      Specified by:
      getLowerLimit in interface Parameterized
      Parameters:
      n - parameter number
      Returns:
      lower bound
    • getUpperLimit

      public double getUpperLimit(int n)
      Description copied from interface: Parameterized
      get upper parameter limit
      Specified by:
      getUpperLimit in interface Parameterized
      Parameters:
      n - parameter number
      Returns:
      upper bound
    • getDefaultValue

      public double getDefaultValue(int n)
      Description copied from interface: Parameterized
      get default value of parameter
      Specified by:
      getDefaultValue in interface Parameterized
      Parameters:
      n - parameter number
      Returns:
      default value
    • getParameterName

      public String getParameterName(int i)
      Specified by:
      getParameterName in interface NamedParameterized
      Returns:
      a short identifier for this parameter type. Should be the same for all instances of a given class!
    • getUniqueName

      public String getUniqueName()
      Specified by:
      getUniqueName in interface RateMatrix
      Returns:
      a short unique human-readable identifier for this rate matrix.
    • rebuildRateMatrix

      protected void rebuildRateMatrix(double[][] rate, double[] parameters)
      Specified by:
      rebuildRateMatrix in class AbstractRateMatrix
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createKappaStore

      public static final MutableDouble createKappaStore(double initialValue)
    • createKappaStore

      public static final MutableDouble createKappaStore(double initialValue, String name)
    • createOmegaStore

      public static final MutableDouble createOmegaStore(double initialValue)
    • createOmegaStore

      public static final MutableDouble createOmegaStore(double initialValue, String name)