Search in sources :

Example 1 with MicrosatelliteModel

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);
}
Also used : MicrosatelliteModel(dr.oldevomodel.substmodel.MicrosatelliteModel) MicrosatelliteSamplerTreeModel(dr.evomodel.tree.MicrosatelliteSamplerTreeModel) BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) MicrosatelliteFullAncestryImportanceSamplingOperator(dr.evomodel.operators.MicrosatelliteFullAncestryImportanceSamplingOperator) Parameter(dr.inference.model.Parameter)

Example 2 with MicrosatelliteModel

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);
}
Also used : MicrosatelliteModel(dr.oldevomodel.substmodel.MicrosatelliteModel) MicrosatelliteSamplerTreeModel(dr.evomodel.tree.MicrosatelliteSamplerTreeModel) BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) Parameter(dr.inference.model.Parameter) MicrosatelliteSamplerTreeLikelihood(dr.oldevomodel.treelikelihood.MicrosatelliteSamplerTreeLikelihood) StrictClockBranchRates(dr.evomodel.branchratemodel.StrictClockBranchRates)

Example 3 with MicrosatelliteModel

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);
}
Also used : MicrosatelliteModel(dr.oldevomodel.substmodel.MicrosatelliteModel) MicrosatelliteSamplerTreeModel(dr.evomodel.tree.MicrosatelliteSamplerTreeModel) MicrosatelliteSingleAncestralStateGibbsOperator(dr.evomodel.operators.MicrosatelliteSingleAncestralStateGibbsOperator) BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) Parameter(dr.inference.model.Parameter)

Example 4 with MicrosatelliteModel

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;
}
Also used : Microsatellite(dr.evolution.datatype.Microsatellite) Taxa(dr.evolution.util.Taxa) MicrosatelliteModel(dr.oldevomodel.substmodel.MicrosatelliteModel) GammaSiteModel(dr.oldevomodel.sitemodel.GammaSiteModel) BranchRateModel(dr.evomodel.branchratemodel.BranchRateModel) DefaultBranchRateModel(dr.evomodel.branchratemodel.DefaultBranchRateModel) MicrosatelliteSimulator(dr.app.seqgen.MicrosatelliteSimulator) Tree(dr.evolution.tree.Tree) Patterns(dr.evolution.alignment.Patterns) DefaultBranchRateModel(dr.evomodel.branchratemodel.DefaultBranchRateModel)

Aggregations

BranchRateModel (dr.evomodel.branchratemodel.BranchRateModel)4 MicrosatelliteModel (dr.oldevomodel.substmodel.MicrosatelliteModel)4 MicrosatelliteSamplerTreeModel (dr.evomodel.tree.MicrosatelliteSamplerTreeModel)3 Parameter (dr.inference.model.Parameter)3 MicrosatelliteSimulator (dr.app.seqgen.MicrosatelliteSimulator)1 Patterns (dr.evolution.alignment.Patterns)1 Microsatellite (dr.evolution.datatype.Microsatellite)1 Tree (dr.evolution.tree.Tree)1 Taxa (dr.evolution.util.Taxa)1 DefaultBranchRateModel (dr.evomodel.branchratemodel.DefaultBranchRateModel)1 StrictClockBranchRates (dr.evomodel.branchratemodel.StrictClockBranchRates)1 MicrosatelliteFullAncestryImportanceSamplingOperator (dr.evomodel.operators.MicrosatelliteFullAncestryImportanceSamplingOperator)1 MicrosatelliteSingleAncestralStateGibbsOperator (dr.evomodel.operators.MicrosatelliteSingleAncestralStateGibbsOperator)1 GammaSiteModel (dr.oldevomodel.sitemodel.GammaSiteModel)1 MicrosatelliteSamplerTreeLikelihood (dr.oldevomodel.treelikelihood.MicrosatelliteSamplerTreeLikelihood)1