use of dr.app.seqgen.MicrosatelliteSimulator 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