| 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.evomodelxml.speciation; |
| 27 |
|
| 28 |
import dr.evomodel.speciation.MultiSpeciesCoalescent; |
| 29 |
import dr.evomodel.speciation.SpeciesBindings; |
| 30 |
import dr.evomodel.speciation.SpeciesTreeModel; |
| 31 |
import dr.xml.*; |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
public class MultiSpeciesCoalescentParser extends AbstractXMLObjectParser { |
| 36 |
public static final String SPECIES_COALESCENT = "speciesCoalescent"; |
| 37 |
|
| 38 |
public Object parseXMLObject(XMLObject xo) throws XMLParseException { |
| 39 |
final SpeciesBindings sb = (SpeciesBindings) xo.getChild(SpeciesBindings.class); |
| 40 |
final SpeciesTreeModel tree = (SpeciesTreeModel) xo.getChild(SpeciesTreeModel.class); |
| 41 |
return new MultiSpeciesCoalescent(sb, tree); |
| 42 |
} |
| 43 |
|
| 44 |
public XMLSyntaxRule[] getSyntaxRules() { |
| 45 |
return new XMLSyntaxRule[]{ |
| 46 |
new ElementRule(SpeciesBindings.class), |
| 47 |
new ElementRule(SpeciesTreeModel.class), |
| 48 |
}; |
| 49 |
} |
| 50 |
|
| 51 |
public String getParserDescription() { |
| 52 |
return "Compute coalecent log-liklihood of a set of gene trees embedded inside one species tree."; |
| 53 |
} |
| 54 |
|
| 55 |
public Class getReturnType() { |
| 56 |
return MultiSpeciesCoalescent.class; |
| 57 |
} |
| 58 |
|
| 59 |
public String getParserName() { |
| 60 |
return SPECIES_COALESCENT; |
| 61 |
} |
| 62 |
} |