use of dr.evolution.distance.JukesCantorDistanceMatrix in project beast-mcmc by beast-dev.
the class DistanceMatrixParser method parseXMLObject.
public Object parseXMLObject(XMLObject xo) throws XMLParseException {
PatternList patterns = (PatternList) xo.getChild(PatternList.class);
DistanceMatrix matrix = null;
String type = xo.getStringAttribute(CORRECTION);
if (type.equals(Nucleotides.JC)) {
Logger.getLogger("dr.evoxml").info("Creating Jukes-Cantor distance matrix");
matrix = new JukesCantorDistanceMatrix(patterns);
} else if (type.equals(Nucleotides.F84)) {
Logger.getLogger("dr.evoxml").info("Creating F84 distance matrix");
matrix = new F84DistanceMatrix(patterns);
} else if (type.equals("SMM")) {
Logger.getLogger("dr.evoxml").info("Creating SMM distance matrix");
matrix = new SMMDistanceMatrix(patterns);
} else {
matrix = new DistanceMatrix(patterns);
}
return matrix;
}
use of dr.evolution.distance.JukesCantorDistanceMatrix in project beast-mcmc by beast-dev.
the class AbstractPartitionData method calculateMeanDistance.
protected void calculateMeanDistance(Patterns patterns) {
if (patterns != null) {
distances = new JukesCantorDistanceMatrix(patterns);
meanDistance = distances.getMeanDistance();
} else {
distances = null;
meanDistance = 1.0;
}
}
Aggregations