| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
package dr.evomodel.substmodel.aminoacid; |
| 27 |
|
| 28 |
import dr.evomodel.substmodel.BaseSubstitutionModel; |
| 29 |
import dr.evomodel.substmodel.EmpiricalRateMatrix; |
| 30 |
import dr.evomodel.substmodel.FrequencyModel; |
| 31 |
import dr.evolution.datatype.AminoAcids; |
| 32 |
import dr.inference.model.Parameter; |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public class EmpiricalAminoAcidModel extends BaseSubstitutionModel { |
| 40 |
|
| 41 |
public EmpiricalAminoAcidModel(EmpiricalRateMatrix rateMatrix, FrequencyModel freqModel) { |
| 42 |
|
| 43 |
super(rateMatrix.getName(), rateMatrix.getDataType(), freqModel, null); |
| 44 |
|
| 45 |
if (freqModel == null) { |
| 46 |
double[] freqs = rateMatrix.getEmpiricalFrequencies(); |
| 47 |
this.freqModel = new FrequencyModel(AminoAcids.INSTANCE, new Parameter.Default(freqs)); |
| 48 |
} |
| 49 |
|
| 50 |
this.rateMatrix = rateMatrix; |
| 51 |
} |
| 52 |
|
| 53 |
protected void frequenciesChanged() { |
| 54 |
|
| 55 |
} |
| 56 |
|
| 57 |
protected void ratesChanged() { |
| 58 |
|
| 59 |
} |
| 60 |
|
| 61 |
protected void setupRelativeRates(double[] rates) { |
| 62 |
double[] empiricalRates = rateMatrix.getEmpiricalRates(); |
| 63 |
System.arraycopy(empiricalRates, 0, rates, 0, empiricalRates.length); |
| 64 |
|
| 65 |
} |
| 66 |
|
| 67 |
private EmpiricalRateMatrix rateMatrix; |
| 68 |
} |