use of dr.oldevomodel.substmodel.MicrosatelliteModel in project beast-mcmc by beast-dev.
the class MicrosatelliteFullAncestryImportanceSamplingOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
final Parameter parameter = (Parameter) xo.getChild(Parameter.class);
final MicrosatelliteSamplerTreeModel msatSamplerTreeModel = (MicrosatelliteSamplerTreeModel) xo.getChild(MicrosatelliteSamplerTreeModel.class);
final MicrosatelliteModel msatModel = (MicrosatelliteModel) xo.getChild(MicrosatelliteModel.class);
final BranchRateModel branchRateModel = (BranchRateModel) xo.getChild(BranchRateModel.class);
return new MicrosatelliteFullAncestryImportanceSamplingOperator(parameter, msatSamplerTreeModel, msatModel, branchRateModel, weight);
}
use of dr.oldevomodel.substmodel.MicrosatelliteModel in project beast-mcmc by beast-dev.
the class MicrosatelliteSamplerTreeLikelihoodParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
MicrosatelliteSamplerTreeModel mstModel = (MicrosatelliteSamplerTreeModel) xo.getChild(MicrosatelliteSamplerTreeModel.class);
MicrosatelliteModel microsatelliteModel = (MicrosatelliteModel) xo.getChild(MicrosatelliteModel.class);
BranchRateModel branchRateModel;
Object cxo = xo.getChild(BranchRateModel.class);
if (xo.getChild(BranchRateModel.class) != null) {
branchRateModel = (BranchRateModel) cxo;
System.out.println("BranchRateModel provided to MicrosatelliteSamplerTreeLikelihood");
} else if (xo.hasChildNamed(MUTATION_RATE)) {
Parameter muRate = (Parameter) xo.getElementFirstChild(MUTATION_RATE);
branchRateModel = new StrictClockBranchRates(muRate);
System.out.println("mutation rate provided to MicrosatelliteSamplerTreeLikelihood");
} else {
branchRateModel = new StrictClockBranchRates(new Parameter.Default(1.0));
}
return new MicrosatelliteSamplerTreeLikelihood(mstModel, microsatelliteModel, branchRateModel);
}
use of dr.oldevomodel.substmodel.MicrosatelliteModel in project beast-mcmc by beast-dev.
the class MicrosatelliteSingleAncestralStateGibbsOperatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
final Parameter parameter = (Parameter) xo.getChild(Parameter.class);
final MicrosatelliteSamplerTreeModel msatSamplerTreeModel = (MicrosatelliteSamplerTreeModel) xo.getChild(MicrosatelliteSamplerTreeModel.class);
final MicrosatelliteModel msatModel = (MicrosatelliteModel) xo.getChild(MicrosatelliteModel.class);
final BranchRateModel branchRateModel = (BranchRateModel) xo.getChild(BranchRateModel.class);
return new MicrosatelliteSingleAncestralStateGibbsOperator(parameter, msatSamplerTreeModel, msatModel, branchRateModel, weight);
}
use of dr.oldevomodel.substmodel.MicrosatelliteModel in project beast-mcmc by beast-dev.
the class MicrosatelliteSimulatorParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
Microsatellite msatDataType = (Microsatellite) xo.getChild(Microsatellite.class);
Taxa taxa = (Taxa) xo.getChild(Taxa.class);
Tree tree = (Tree) xo.getChild(Tree.class);
MicrosatelliteModel msatModel = (MicrosatelliteModel) xo.getChild(MicrosatelliteModel.class);
BranchRateModel brModel = (BranchRateModel) xo.getChild(BranchRateModel.class);
if (brModel == null) {
brModel = new DefaultBranchRateModel();
}
MicrosatelliteSimulator msatSim = new MicrosatelliteSimulator(msatDataType, taxa, tree, new GammaSiteModel(msatModel), brModel);
Patterns patterns = msatSim.simulateMsatPattern();
String msatPatId = xo.getAttribute("id", "simMsatPat");
patterns.setId(msatPatId);
MicrosatellitePatternParser.printDetails(patterns);
MicrosatellitePatternParser.printMicrosatContent(patterns);
return patterns;
}
Aggregations