eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.7
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.7
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
import jalview.analysis.TreeBuilder;
import jalview.datamodel.SequenceI;
+import jalview.ext.forester.ForesterMatrix;
import jalview.util.MessageManager;
+import org.forester.evoinference.distance.NeighborJoiningF;
import org.forester.evoinference.matrix.distance.DistanceMatrix;
import org.forester.phylogeny.Phylogeny;
import org.forester.phylogeny.PhylogenyNode;
public class ArchaeopteryxTreeConverter
{
- protected SequenceI[] sequences;
+ protected final SequenceI[] sequences;
private Phylogeny aptxTree;
private PhylogenyNode rootNode;
- protected DistanceMatrix distances;
+ protected final DistanceMatrix distances;
- protected TreeBuilder jalviewTree;
+ protected final TreeBuilder jalviewTree;
public String treeTitle;
- public ArchaeopteryxTreeConverter(TreeBuilder calculatedTree)
+ public ArchaeopteryxTreeConverter(final TreeBuilder calculatedTree)
{
- this.jalviewTree = calculatedTree;
- this.sequences = jalviewTree.getSequences();
- this.distances = MatrixConverter.convertJalviewToForester(
- jalviewTree.getDistances(), jalviewTree.getSequences());
+ jalviewTree = calculatedTree;
+ sequences = jalviewTree.getSequences();
+ distances = ForesterMatrix.convertJalviewToForester(
+ jalviewTree.testDistances, sequences);
+ aptxTree = new Phylogeny();
+ rootNode = new PhylogenyNode();
}
- public Phylogeny buildAptxTree()
+ public Phylogeny buildAptxTree(final PhylogenyNode treeRoot)
{
- this.rootNode = new PhylogenyNode();
-
- return buildAptxTree(rootNode);
- }
+ rootNode = treeRoot;
- public Phylogeny buildAptxTree(PhylogenyNode treeRoot)
- {
+ buildAptxTree();
- this.rootNode = treeRoot;
- this.aptxTree = new Phylogeny();
+ return aptxTree;
- this.treeTitle = generateTreeName();
- this.aptxTree.setName(treeTitle);
+ }
- // final NeighborJoiningF nj = NeighborJoiningF.createInstance(false, 5);
+ public Phylogeny buildAptxTree()
+ {
- //
- // final Phylogeny phy = nj.execute(JalviewMatrixToForesterMatrix
- // .convertJalviewToForester(distances));
+ NeighborJoiningF foresterClustering = NeighborJoiningF
+ .createInstance();
+ aptxTree = foresterClustering.execute(distances);
+ treeTitle = generateTreeName();
+ aptxTree.setName(treeTitle);
- return buildAptxTree(sequences);
+ return aptxTree;
}
- // testing method to be removed
- public Phylogeny buildAptxTree(SequenceI[] sequences)
+ private Phylogeny clusterNodes()
{
-
- for (SequenceI sequence : sequences)
- {
- PhylogenyNode treeNode = new PhylogenyNode(sequence.getName());
- rootNode.addAsChild(treeNode);
-
- }
-
- aptxTree.setRoot(rootNode);
return aptxTree;
}