| 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.oldevomodelxml.treelikelihood; |
| 27 |
|
| 28 |
import dr.evolution.alignment.PatternList; |
| 29 |
import dr.evomodel.branchratemodel.BranchRateModel; |
| 30 |
import dr.oldevomodel.sitemodel.SiteModel; |
| 31 |
import dr.evomodel.tree.TreeModel; |
| 32 |
import dr.oldevomodel.treelikelihood.AncestralStateTreeLikelihood; |
| 33 |
import dr.xml.*; |
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
@Deprecated |
| 38 |
public class AncestralStateTreeLikelihoodParser extends AbstractXMLObjectParser { |
| 39 |
|
| 40 |
public static final String RECONSTRUCTING_TREE_LIKELIHOOD = "ancestralTreeLikelihood"; |
| 41 |
public static final String RECONSTRUCTION_TAG = AncestralStateTreeLikelihood.STATES_KEY; |
| 42 |
public static final String RECONSTRUCTION_TAG_NAME = "stateTagName"; |
| 43 |
public static final String MAP_RECONSTRUCTION = "useMAP"; |
| 44 |
public static final String MARGINAL_LIKELIHOOD = "useMarginalLikelihood"; |
| 45 |
|
| 46 |
public String[] getParserNames() { |
| 47 |
return new String[]{ |
| 48 |
getParserName(), "beast_" + getParserName() |
| 49 |
}; |
| 50 |
} |
| 51 |
|
| 52 |
public String getParserName() { |
| 53 |
return RECONSTRUCTING_TREE_LIKELIHOOD; |
| 54 |
} |
| 55 |
|
| 56 |
public Object parseXMLObject(XMLObject xo) throws XMLParseException { |
| 57 |
|
| 58 |
throw new XMLParseException("Ancestral state functionality is only support when using the BEAGLE library.\nAvailable from http://github.com/beagle-dev/beagle-lib/"); |
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
|
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
} |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
public String getParserDescription() { |
| 89 |
return "This element represents the likelihood of a patternlist on a tree given the site model."; |
| 90 |
} |
| 91 |
|
| 92 |
public Class getReturnType() { |
| 93 |
return AncestralStateTreeLikelihood.class; |
| 94 |
} |
| 95 |
|
| 96 |
public XMLSyntaxRule[] getSyntaxRules() { |
| 97 |
return rules; |
| 98 |
} |
| 99 |
|
| 100 |
private XMLSyntaxRule[] rules = new XMLSyntaxRule[]{ |
| 101 |
AttributeRule.newBooleanRule(TreeLikelihoodParser.USE_AMBIGUITIES, true), |
| 102 |
AttributeRule.newBooleanRule(TreeLikelihoodParser.STORE_PARTIALS, true), |
| 103 |
AttributeRule.newStringRule(RECONSTRUCTION_TAG_NAME, true), |
| 104 |
AttributeRule.newBooleanRule(TreeLikelihoodParser.FORCE_RESCALING, true), |
| 105 |
AttributeRule.newBooleanRule(MAP_RECONSTRUCTION, true), |
| 106 |
AttributeRule.newBooleanRule(MARGINAL_LIKELIHOOD, true), |
| 107 |
new ElementRule(PatternList.class), |
| 108 |
new ElementRule(TreeModel.class), |
| 109 |
new ElementRule(SiteModel.class), |
| 110 |
new ElementRule(BranchRateModel.class, true) |
| 111 |
}; |
| 112 |
} |