| 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.oldevomodel.substmodel; |
| 27 |
|
| 28 |
import dr.evolution.datatype.OldHiddenNucleotides; |
| 29 |
import dr.oldevomodelxml.substmodel.CovarionGTRParser; |
| 30 |
import dr.inference.model.Parameter; |
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
public class CovarionGTR extends AbstractCovarionDNAModel { |
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
public CovarionGTR( |
| 58 |
OldHiddenNucleotides dataType, |
| 59 |
Parameter hiddenRates, |
| 60 |
Parameter switchingRates, |
| 61 |
Parameter rateACParameter, |
| 62 |
Parameter rateAGParameter, |
| 63 |
Parameter rateATParameter, |
| 64 |
Parameter rateCGParameter, |
| 65 |
Parameter rateCTParameter, |
| 66 |
Parameter rateGTParameter, |
| 67 |
FrequencyModel freqModel) { |
| 68 |
|
| 69 |
super(CovarionGTRParser.GTR_COVARION_MODEL, dataType, hiddenRates, switchingRates, freqModel); |
| 70 |
if (rateACParameter != null) { |
| 71 |
addVariable(rateACParameter); |
| 72 |
rateACParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, 1)); |
| 73 |
this.rateACParameter = rateACParameter; |
| 74 |
} |
| 75 |
|
| 76 |
if (rateAGParameter != null) { |
| 77 |
addVariable(rateAGParameter); |
| 78 |
rateAGParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, 1)); |
| 79 |
this.rateAGParameter = rateAGParameter; |
| 80 |
} |
| 81 |
|
| 82 |
if (rateATParameter != null) { |
| 83 |
addVariable(rateATParameter); |
| 84 |
rateATParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, 1)); |
| 85 |
this.rateATParameter = rateATParameter; |
| 86 |
} |
| 87 |
|
| 88 |
if (rateCGParameter != null) { |
| 89 |
addVariable(rateCGParameter); |
| 90 |
rateCGParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, 1)); |
| 91 |
this.rateCGParameter = rateCGParameter; |
| 92 |
} |
| 93 |
|
| 94 |
if (rateCTParameter != null) { |
| 95 |
addVariable(rateCTParameter); |
| 96 |
rateCTParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, 1)); |
| 97 |
this.rateCTParameter = rateCTParameter; |
| 98 |
} |
| 99 |
|
| 100 |
if (rateGTParameter != null) { |
| 101 |
addVariable(rateGTParameter); |
| 102 |
rateGTParameter.addBounds(new Parameter.DefaultBounds(Double.POSITIVE_INFINITY, 0.0, 1)); |
| 103 |
this.rateGTParameter = rateGTParameter; |
| 104 |
} |
| 105 |
} |
| 106 |
|
| 107 |
double[] getRelativeDNARates() { |
| 108 |
double[] rr = new double[6]; |
| 109 |
for (int i = 0; i < rr.length; i++) { |
| 110 |
rr[i] = 1.0; |
| 111 |
} |
| 112 |
|
| 113 |
if (rateACParameter != null) { |
| 114 |
rr[0] = rateACParameter.getParameterValue(0); |
| 115 |
} |
| 116 |
if (rateAGParameter != null) { |
| 117 |
rr[1] = rateAGParameter.getParameterValue(0); |
| 118 |
} |
| 119 |
if (rateATParameter != null) { |
| 120 |
rr[2] = rateATParameter.getParameterValue(0); |
| 121 |
} |
| 122 |
if (rateCGParameter != null) { |
| 123 |
rr[3] = rateCGParameter.getParameterValue(0); |
| 124 |
} |
| 125 |
if (rateCTParameter != null) { |
| 126 |
rr[4] = rateCTParameter.getParameterValue(0); |
| 127 |
} |
| 128 |
if (rateGTParameter != null) { |
| 129 |
rr[5] = rateGTParameter.getParameterValue(0); |
| 130 |
} |
| 131 |
return rr; |
| 132 |
} |
| 133 |
|
| 134 |
private Parameter rateACParameter = null; |
| 135 |
private Parameter rateAGParameter = null; |
| 136 |
private Parameter rateATParameter = null; |
| 137 |
private Parameter rateCGParameter = null; |
| 138 |
private Parameter rateCTParameter = null; |
| 139 |
private Parameter rateGTParameter = null; |
| 140 |
} |