Search in sources :

Example 1 with JukesCantorDistanceMatrix

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;
}
Also used : F84DistanceMatrix(dr.evolution.distance.F84DistanceMatrix) SMMDistanceMatrix(dr.evolution.distance.SMMDistanceMatrix) PatternList(dr.evolution.alignment.PatternList) F84DistanceMatrix(dr.evolution.distance.F84DistanceMatrix) JukesCantorDistanceMatrix(dr.evolution.distance.JukesCantorDistanceMatrix) DistanceMatrix(dr.evolution.distance.DistanceMatrix) SMMDistanceMatrix(dr.evolution.distance.SMMDistanceMatrix) JukesCantorDistanceMatrix(dr.evolution.distance.JukesCantorDistanceMatrix)

Example 2 with JukesCantorDistanceMatrix

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;
    }
}
Also used : JukesCantorDistanceMatrix(dr.evolution.distance.JukesCantorDistanceMatrix)

Aggregations

JukesCantorDistanceMatrix (dr.evolution.distance.JukesCantorDistanceMatrix)2 PatternList (dr.evolution.alignment.PatternList)1 DistanceMatrix (dr.evolution.distance.DistanceMatrix)1 F84DistanceMatrix (dr.evolution.distance.F84DistanceMatrix)1 SMMDistanceMatrix (dr.evolution.distance.SMMDistanceMatrix)1