Search in sources :

Example 6 with AlloppSpeciesBindings

use of dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings in project beast-mcmc by beast-dev.

the class AlloppChangeNumHybridizationsParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    AlloppSpeciesBindings apsp = (AlloppSpeciesBindings) xo.getChild(AlloppSpeciesBindings.class);
    AlloppSpeciesNetworkModel apspnet = (AlloppSpeciesNetworkModel) xo.getChild(AlloppSpeciesNetworkModel.class);
    if (apspnet.getOneHybridization()) {
        throw new XMLParseException("oneHybridization is set to true but there is a changeNumHybridizations operator");
    }
    final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    return new AlloppChangeNumHybridizations(apspnet, apsp, weight);
}
Also used : AlloppSpeciesNetworkModel(dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel) AlloppSpeciesBindings(dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings) AlloppChangeNumHybridizations(dr.evomodel.alloppnet.operators.AlloppChangeNumHybridizations)

Example 7 with AlloppSpeciesBindings

use of dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings in project beast-mcmc by beast-dev.

the class AlloppHybPopSizesScaleParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    AlloppSpeciesBindings apsp = (AlloppSpeciesBindings) xo.getChild(AlloppSpeciesBindings.class);
    AlloppSpeciesNetworkModel apspnet = (AlloppSpeciesNetworkModel) xo.getChild(AlloppSpeciesNetworkModel.class);
    final double weight = xo.getDoubleAttribute(MCMCOperator.WEIGHT);
    final double scalingfactor = xo.getDoubleAttribute(ScaleOperatorParser.SCALE_FACTOR);
    return new AlloppHybPopSizesScale(apspnet, apsp, scalingfactor, weight);
}
Also used : AlloppSpeciesNetworkModel(dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel) AlloppSpeciesBindings(dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings) AlloppHybPopSizesScale(dr.evomodel.alloppnet.operators.AlloppHybPopSizesScale)

Example 8 with AlloppSpeciesBindings

use of dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings in project beast-mcmc by beast-dev.

the class AlloppMSCoalescentParser method parseXMLObject.

public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    final AlloppSpeciesBindings apsp = (AlloppSpeciesBindings) xo.getChild(AlloppSpeciesBindings.class);
    final AlloppSpeciesNetworkModel apspnetwork = (AlloppSpeciesNetworkModel) xo.getChild(AlloppSpeciesNetworkModel.class);
    return new AlloppMSCoalescent(apsp, apspnetwork);
}
Also used : AlloppSpeciesNetworkModel(dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel) AlloppSpeciesBindings(dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings) AlloppMSCoalescent(dr.evomodel.alloppnet.speciation.AlloppMSCoalescent)

Example 9 with AlloppSpeciesBindings

use of dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings in project beast-mcmc by beast-dev.

the class AlloppSpeciesNetworkModelParser method parseXMLObject.

@Override
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
    AlloppSpeciesBindings apspb = (AlloppSpeciesBindings) xo.getChild(AlloppSpeciesBindings.class);
    boolean onehyb = xo.getBooleanAttribute(ONEHYBRIDIZATION);
    boolean diprootisroot = xo.getBooleanAttribute(DIPLOIDROOT_ISROOT);
    final XMLObject tippopxo = xo.getChild(TIP_POPULATIONS);
    final double tippopvalue = tippopxo.getAttribute(Attributable.VALUE, 1.0);
    final XMLObject rootpopxo = xo.getChild(ROOT_POPULATIONS);
    final double rootpopvalue = rootpopxo.getAttribute(Attributable.VALUE, 1.0);
    final XMLObject hybpopxo = xo.getChild(HYBRID_POPULATIONS);
    final double hybpopvalue = hybpopxo.getAttribute(Attributable.VALUE, 1.0);
    AlloppSpeciesNetworkModel asnm = new AlloppSpeciesNetworkModel(apspb, tippopvalue, rootpopvalue, hybpopvalue, onehyb, diprootisroot);
    // don't know dimensionality until network created, so replace parameters
    ParameterParser.replaceParameter(tippopxo, asnm.tippopvalues);
    final Parameter.DefaultBounds tippopbounds = new Parameter.DefaultBounds(Double.MAX_VALUE, 0, asnm.tippopvalues.getDimension());
    asnm.tippopvalues.addBounds(tippopbounds);
    ParameterParser.replaceParameter(rootpopxo, asnm.rootpopvalues);
    final Parameter.DefaultBounds rootpopbounds = new Parameter.DefaultBounds(Double.MAX_VALUE, 0, asnm.rootpopvalues.getDimension());
    asnm.rootpopvalues.addBounds(rootpopbounds);
    ParameterParser.replaceParameter(hybpopxo, asnm.logginghybpopvalues);
    final Parameter.DefaultBounds hybpopbounds = new Parameter.DefaultBounds(Double.MAX_VALUE, 0, asnm.logginghybpopvalues.getDimension());
    asnm.logginghybpopvalues.addBounds(hybpopbounds);
    // note hybpopvalues are different and only work for logging.
    return asnm;
}
Also used : AlloppSpeciesNetworkModel(dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel) AlloppSpeciesBindings(dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings) Parameter(dr.inference.model.Parameter)

Aggregations

AlloppSpeciesBindings (dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings)9 AlloppSpeciesNetworkModel (dr.evomodel.alloppnet.speciation.AlloppSpeciesNetworkModel)8 ApSpInfo (dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings.ApSpInfo)2 Individual (dr.evomodel.alloppnet.speciation.AlloppSpeciesBindings.Individual)2 AlloppChangeNumHybridizations (dr.evomodel.alloppnet.operators.AlloppChangeNumHybridizations)1 AlloppHybPopSizesScale (dr.evomodel.alloppnet.operators.AlloppHybPopSizesScale)1 AlloppMoveLegs (dr.evomodel.alloppnet.operators.AlloppMoveLegs)1 AlloppNetworkNodeSlide (dr.evomodel.alloppnet.operators.AlloppNetworkNodeSlide)1 AlloppSequenceReassignment (dr.evomodel.alloppnet.operators.AlloppSequenceReassignment)1 AlloppMSCoalescent (dr.evomodel.alloppnet.speciation.AlloppMSCoalescent)1 AlloppMulLabTree (dr.evomodel.alloppnet.speciation.AlloppMulLabTree)1 Parameter (dr.inference.model.Parameter)1