Package pal.substmodel
Class YangCodonModel
- java.lang.Object
-
- pal.substmodel.AbstractRateMatrix
-
- pal.substmodel.CodonModel
-
- pal.substmodel.YangCodonModel
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,ExternalParameterListener
,NamedParameterized
,Parameterized
,Report
,RateMatrix
,XMLConstants
public class YangCodonModel extends CodonModel implements java.io.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
YangCodonModel.SimpleNeutralSelection
A Substitution Model which can be used to implment the Neutral Model (with out continuous rate stuff) Codon model of [1] which uses the weighted sum of trwo base YangCodon models where omega=0, omega=1 repectively
[1] Nielsen, R., Yang Z., 1998 Likelihood Models for Detecting Positively Selected Amino Acid Sites and Applications to the HIV-1 Envelope Gene.static class
YangCodonModel.SimplePositiveSelection
A Substitution Model which can be used to implment the Postitive Selection (with out continuous rate stuff) Codon model of [1] which uses the weighted sum of a three base Codon model where omega=0, omega=1 and omega=free
[1] Nielsen, R., Yang Z., 1998 Likelihood Models for Detecting Positively Selected Amino Acid Sites and Applications to the HIV-1 Envelope Gene.static class
YangCodonModel.Utils
A Utility class-
Nested classes/interfaces inherited from interface pal.misc.Parameterized
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser
-
-
Field Summary
Fields Modifier and Type Field Description static double
DEFAULT_KAPPA
static double
DEFAULT_OMEGA
static int
KAPPA_PARAMETER
static double
MAXIMUM_KAPPA
static double
MAXIMUM_OMEGA
static double
MINIMUM_KAPPA
static double
MINIMUM_OMEGA
static int
OMEGA_PARAMETER
-
Fields inherited from class pal.substmodel.AbstractRateMatrix
format
-
Fields inherited from interface pal.util.XMLConstants
A_TO_C, A_TO_G, A_TO_T, ALIGNMENT, ALPHA, ANCESTRAL_MU_RATE, ANCESTRAL_POP_SIZE, ATTRIBUTE, BACKWARDS, BLOSUM62, C_TO_G, C_TO_T, COALESCENT, CONST_EXP_CONST, CONST_EXP_GROWTH, CONSTANT_MUTATION_RATE, CONSTANT_POPULATION, CPREV, CURRENT_POP_SIZE_DURATION, DATA_TYPE, DATA_TYPE_ID, DAYHOFF, DAYS, DEMOGRAPHIC_MODEL, DIRECTION, EDGE, EXPANDING_POPULATION, EXPONENTIAL_GROWTH, F81, F84, FREQUENCIES, G_TO_T, GAMMA_ALPHA, GAMMA_DISTRIBUTION, GENERATIONS, GROWTH_PHASE_DURATION, GROWTH_RATE, GTR, HEIGHT, HKY, ID, JC, JTT, KAPPA, LENGTH, MISSING, MODEL, MONTHS, MTREV24, MU_STEP_TIME, MUTATION_RATE, MUTATION_RATE_MODEL, MUTATIONS, NAME, NODE, NUMBER_CATEGORIES, OMEGA, ORIGIN, PARAMETER, POPULATION_SIZE, PYRIMIDINE_PURINE_RATIO, RATE_DISTRIBUTION, RATE_MATRIX, SEQUENCE, SPACES_PER_LEVEL, STEPPED_MUTATION_RATE, TIME, TIME_DATA, TN, TREE, TS_TV_RATIO, TWO_STATE, TYPE, UNIFORM, UNIFORM_RATE_DISTRIBUTION, UNITS, UNKNOWN, VALUE, VT, WAG, YANG_CODON_MODEL, YEARS
-
-
Constructor Summary
Constructors Constructor Description YangCodonModel(double[] params, double[] freq)
constructor 4 (universal codon table)YangCodonModel(double[] params, double[] freq, CodonTable codonTable)
constructor 3YangCodonModel(double omega, double kappa, double[] freq)
constructor 2 (universal codon table)YangCodonModel(double omega, double kappa, double[] freq, CodonTable codonTable)
constructor 1
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MutableDouble
createKappaStore(double initialValue)
static MutableDouble
createKappaStore(double initialValue, java.lang.String name)
static MutableDouble
createOmegaStore(double initialValue)
static MutableDouble
createOmegaStore(double initialValue, java.lang.String name)
double
getDefaultValue(int n)
get default value of parameterdouble
getKappa()
double
getKappaDefaultValue()
double
getKappaLowerLimit()
double
getKappaUpperLimit()
double
getLowerLimit(int n)
get lower parameter limitint
getModelID()
get numerical code describing the model typeint
getNumParameters()
get number of parametersdouble
getOmega()
double
getOmegaDefaultValue()
double
getOmegaLowerLimit()
double
getOmegaUpperLimit()
java.lang.String
getParameterName(int i)
java.lang.String
getUniqueName()
double
getUpperLimit(int n)
get upper parameter limitprotected void
rebuildRateMatrix(double[][] rate, double[] parameters)
void
report(java.io.PrintWriter out)
print human readable report (e.g., on parameters and associated model)void
setKappa(double value)
void
setKappaSE(double value)
void
setOmega(double value)
void
setOmegaSE(double value)
void
setParameterSE(double paramSE, int n)
set standard errors for model parameterjava.lang.String
toString()
-
Methods inherited from class pal.substmodel.CodonModel
getInstance, printFrequencies, printRatios
-
Methods inherited from class pal.substmodel.AbstractRateMatrix
addPalObjectListener, clone, fireParametersChangedEvent, fireParametersChangedEvent, getDataType, getDimension, getEquilibriumFrequencies, getEquilibriumFrequency, getFrequencies, getOrthogonalHints, getParameter, getRelativeRates, getTransitionProbabilities, getTransitionProbability, getTypeID, parameterChanged, rebuild, removePalObjectListener, scale, setDataType, setDistance, setDistanceTranspose, setFrequencies, setParameter, setParameters, setParametersNoScale, updateMatrixExp
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface pal.misc.Parameterized
getParameter, setParameter
-
Methods inherited from interface pal.substmodel.RateMatrix
addPalObjectListener, clone, getDataType, getDimension, getEquilibriumFrequencies, getEquilibriumFrequency, getOrthogonalHints, getRelativeRates, getTransitionProbabilities, getTransitionProbability, getTypeID, removePalObjectListener, scale, setDistance, setDistanceTranspose, setParametersNoScale
-
-
-
-
Field Detail
-
MAXIMUM_OMEGA
public static final double MAXIMUM_OMEGA
- See Also:
- Constant Field Values
-
MAXIMUM_KAPPA
public static final double MAXIMUM_KAPPA
- See Also:
- Constant Field Values
-
MINIMUM_OMEGA
public static final double MINIMUM_OMEGA
- See Also:
- Constant Field Values
-
MINIMUM_KAPPA
public static final double MINIMUM_KAPPA
- See Also:
- Constant Field Values
-
DEFAULT_KAPPA
public static final double DEFAULT_KAPPA
- See Also:
- Constant Field Values
-
DEFAULT_OMEGA
public static final double DEFAULT_OMEGA
- See Also:
- Constant Field Values
-
KAPPA_PARAMETER
public static final int KAPPA_PARAMETER
- See Also:
- Constant Field Values
-
OMEGA_PARAMETER
public static final int OMEGA_PARAMETER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
YangCodonModel
public YangCodonModel(double omega, double kappa, double[] freq, CodonTable codonTable)
constructor 1- Parameters:
omega
- N/S rate ratiokappa
- transition/transversion rate ratiofreq
- codon frequenciescodonTable
- codon table
-
YangCodonModel
public YangCodonModel(double omega, double kappa, double[] freq)
constructor 2 (universal codon table)- Parameters:
omega
- N/S rate ratiokappa
- transition/transversion rate ratiofreq
- codon frequencies
-
YangCodonModel
public YangCodonModel(double[] params, double[] freq)
constructor 4 (universal codon table)- Parameters:
params
- parameter listfreq
- nucleotide frequencies
-
YangCodonModel
public YangCodonModel(double[] params, double[] freq, CodonTable codonTable)
constructor 3- Parameters:
params
- parameter listfreq
- nucleotide frequenciescodonTable
- codon table
-
-
Method Detail
-
getModelID
public int getModelID()
Description copied from class:AbstractRateMatrix
get numerical code describing the model type- Specified by:
getModelID
in interfaceRateMatrix
- Specified by:
getModelID
in classAbstractRateMatrix
- Returns:
- integer code identifying a substitution model
-
report
public void report(java.io.PrintWriter out)
Description copied from interface:Report
print human readable report (e.g., on parameters and associated model)
-
getNumParameters
public int getNumParameters()
Description copied from interface:Parameterized
get number of parameters- Specified by:
getNumParameters
in interfaceParameterized
- 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 interfaceParameterized
- Parameters:
paramSE
- standard error of parameter valuen
- 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 interfaceParameterized
- 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 interfaceParameterized
- 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 interfaceParameterized
- Parameters:
n
- parameter number- Returns:
- default value
-
getParameterName
public java.lang.String getParameterName(int i)
- Specified by:
getParameterName
in interfaceNamedParameterized
- Returns:
- a short identifier for this parameter type. Should be the same for all instances of a given class!
-
getUniqueName
public java.lang.String getUniqueName()
- Specified by:
getUniqueName
in interfaceRateMatrix
- Returns:
- a short unique human-readable identifier for this rate matrix.
-
rebuildRateMatrix
protected void rebuildRateMatrix(double[][] rate, double[] parameters)
- Specified by:
rebuildRateMatrix
in classAbstractRateMatrix
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
createKappaStore
public static final MutableDouble createKappaStore(double initialValue)
-
createKappaStore
public static final MutableDouble createKappaStore(double initialValue, java.lang.String name)
-
createOmegaStore
public static final MutableDouble createOmegaStore(double initialValue)
-
createOmegaStore
public static final MutableDouble createOmegaStore(double initialValue, java.lang.String name)
-
-