Example #1
0
 public TreeAccuracyInformation checkAccuracy() throws Exception {
   Phylogeny p = treeConstructor.getPhylogeny();
   if (p == null) throw new Exception("Run process() method before this one.");
   CheckTreeAccuracy acc = new CheckTreeAccuracy();
   acc.process(p, treeConstructor.getDistanceMatrix());
   TreeAccuracyInformation tai = new TreeAccuracyInformation();
   tai.setAverageMatrixDistance(acc.getAverageMatrixDistance());
   tai.setAverageTreeDistance(acc.getAverageTreeDistance());
   tai.setAverageErrorRate(acc.getAverageTreeErrorDistance());
   return tai;
 }
Example #2
0
  /**
   * Budowanie drzewa metodÄ… Neighbour Joining. http://en.wikipedia.org/wiki/Neighbour_joining
   *
   * @return drzewo w formie Newick (zanawiasowane)
   */
  public String NeighbourJoining() {
    alignSequences();

    treeConstructor =
        new TreeConstructor<ProteinSequence, AminoAcidCompound>(
            multipleSequenceAlignment,
            TreeType.NJ,
            TreeConstructionAlgorithm.PID,
            new ProgessListenerStub());
    String newick = null;
    try {
      treeConstructor.process();
      newick = treeConstructor.getNewickString(true, true);
    } catch (Exception ex) {
      Logger.getLogger(TreeBuilder.class.getName()).log(Level.SEVERE, null, ex);
    }
    return newick;
  }