From: kjvdheide Date: Mon, 13 Nov 2017 19:34:25 +0000 (+0000) Subject: JAL-2805 Added tree building interface X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3c25793183128e530d2d90bb8f312952011ca208;p=jalview.git JAL-2805 Added tree building interface --- diff --git a/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java b/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java index 21a4e30..02ecdf0 100644 --- a/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java +++ b/src/jalview/ext/archaeopteryx/ArchaeopteryxTreeBuilder.java @@ -25,7 +25,8 @@ import org.forester.phylogeny.data.Sequence; * @author kjvanderheide * */ -public class ArchaeopteryxTreeConverter +public class ArchaeopteryxTreeBuilder + implements ExternalTreeBuilderI { protected final SequenceI[] sequences; @@ -43,7 +44,7 @@ public class ArchaeopteryxTreeConverter private final Map nodesBoundAlignment; - public ArchaeopteryxTreeConverter(final TreeBuilder calculatedTree) + public ArchaeopteryxTreeBuilder(final TreeBuilder calculatedTree) { jalviewTree = calculatedTree; sequences = jalviewTree.getSequences(); @@ -57,7 +58,8 @@ public class ArchaeopteryxTreeConverter } - public Phylogeny buildAptxTree(final PhylogenyNode treeRoot) + @Override + public Phylogeny buildTree(final PhylogenyNode treeRoot) { if (treeRoot != null) @@ -65,14 +67,15 @@ public class ArchaeopteryxTreeConverter rootNode = treeRoot; } - buildAptxTree(); + buildTree(); return aptxTree; } - public Phylogeny buildAptxTree() + @Override + public Phylogeny buildTree() { for (SequenceI sequence : sequences) @@ -98,11 +101,13 @@ public class ArchaeopteryxTreeConverter } + @Override public Map getAlignmentBoundNodes() { return alignmentBoundNodes; } + @Override public Map getNodesBoundAlignment() { return nodesBoundAlignment; @@ -122,6 +127,7 @@ public class ArchaeopteryxTreeConverter * * @return */ + @Override public String generateTreeName() // Move this and add selection region to the // title when applicable { diff --git a/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java b/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java new file mode 100644 index 0000000..f27117d --- /dev/null +++ b/src/jalview/ext/archaeopteryx/ExternalTreeBuilderI.java @@ -0,0 +1,19 @@ +package jalview.ext.archaeopteryx; + +import jalview.datamodel.SequenceI; + +import java.util.Map; + +interface ExternalTreeBuilderI +{ + public T buildTree(N treeRoot); + + public T buildTree(); + + public Map getAlignmentBoundNodes(); + + public Map getNodesBoundAlignment(); + + public String generateTreeName(); + +}