use of dr.xml.AttributeParser in project beast-mcmc by beast-dev.
the class GreatCircleDistances method main.
public static void main(String[] args) throws ParserConfigurationException, IOException, SAXException, XMLParseException {
XMLParser parser = new XMLParser(true, true);
parser.addXMLObjectParser(new TaxonParser());
parser.addXMLObjectParser(new TaxaParser());
parser.addXMLObjectParser(new AttributeParser());
parser.addXMLObjectParser(new DateParser());
parser.parse(new FileReader(new File(args[0])), true);
Taxa taxa = (Taxa) parser.getRoot().getChild(0);
System.out.println("Found " + taxa.getTaxonCount() + " taxa");
GreatCircleDistances distances = new GreatCircleDistances(taxa, "location");
Statistic statistic = distances.getDistanceStatistic(true);
for (int i = 0; i < statistic.getDimension(); i++) {
System.out.println(statistic.getStatisticValue(i));
}
}
Aggregations