| 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.app.beauti.options; |
| 27 |
|
| 28 |
import dr.app.beauti.types.OperatorType; |
| 29 |
import dr.evomodelxml.tree.MicrosatelliteSamplerTreeModelParser; |
| 30 |
|
| 31 |
import java.util.List; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
public class MicrosatelliteOptions extends ModelOptions { |
| 38 |
private static final long serialVersionUID = -814539657791957173L; |
| 39 |
|
| 40 |
private final BeautiOptions options; |
| 41 |
|
| 42 |
public MicrosatelliteOptions(BeautiOptions options) { |
| 43 |
this.options = options; |
| 44 |
|
| 45 |
} |
| 46 |
|
| 47 |
@Override |
| 48 |
public void initModelParametersAndOpererators() { |
| 49 |
|
| 50 |
for (PartitionPattern partitionData : options.getPartitionPattern()) { |
| 51 |
createParameter(partitionData.getName() + "." + MicrosatelliteSamplerTreeModelParser.TREE_MICROSATELLITE_SAMPLER_MODEL + |
| 52 |
".internalNodesParameter", "Microsatellite sampler tree internal node parameter"); |
| 53 |
createOperator(partitionData.getName() + "." + "microsatInternalNodesParameter", partitionData.getName() + " microsat internal nodes", |
| 54 |
"Random integer walk on microsatellite sampler tree internal node parameter", |
| 55 |
partitionData.getName() + "." + MicrosatelliteSamplerTreeModelParser.TREE_MICROSATELLITE_SAMPLER_MODEL + ".internalNodesParameter", |
| 56 |
OperatorType.INTEGER_RANDOM_WALK, 1.0, branchWeights); |
| 57 |
} |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
@Override |
| 62 |
public List<Parameter> selectParameters(List<Parameter> params) { |
| 63 |
for (PartitionPattern partitionData : options.getPartitionPattern()) { |
| 64 |
getParameter(partitionData.getName() + "." + MicrosatelliteSamplerTreeModelParser.TREE_MICROSATELLITE_SAMPLER_MODEL + |
| 65 |
".internalNodesParameter"); |
| 66 |
} |
| 67 |
return params; |
| 68 |
} |
| 69 |
|
| 70 |
@Override |
| 71 |
public List<Operator> selectOperators(List<Operator> ops) { |
| 72 |
for (PartitionPattern partitionData : options.getPartitionPattern()) { |
| 73 |
ops.add(getOperator(partitionData.getName() + "." + "microsatInternalNodesParameter")); |
| 74 |
} |
| 75 |
return ops; |
| 76 |
} |
| 77 |
|
| 78 |
@Override |
| 79 |
public String getPrefix() { |
| 80 |
return ""; |
| 81 |
} |
| 82 |
} |