private final static NHXParser.TAXONOMY_EXTRACTION TAXONOMY_EXTRACTION = APTX_CONFIG
.getTaxonomyExtraction();
- /**
- * Test method, should generally not be used as it does not bind the tree to
- * its alignment
- *
- * @param aptxTrees
- * @return
- */
- public static MainFrame createUnboundInstance(final Phylogeny aptxTree)
- {
- return createAptxFrame(aptxTree);
- }
- // public static MainFrame createInstance(final Phylogeny[] aptxTrees,
- // AlignmentViewport jalviewAlignmentView)
- // {
- // return createAptxFrameInJalview(aptxTrees);
- //
- // }
- //
- // public static MainFrame createInstance(final Phylogeny aptxTree,
- // final AlignmentViewport jalviewAlignmentView)
- // {
- // Phylogeny[] aptxTrees = { aptxTree }; // future possibility to load in
- // // several trees simultaneously
- // return createAptxFrameInJalview(aptxTrees);
- //
- // }
-
- public static MainFrame createInstance(
+
+ public static MainFrame createInstanceFromCalculation(
final TreeBuilder calculatedTree) // very dense method, to be split up
{
ExternalTreeBuilderI<Phylogeny, PhylogenyNode> aptxTreeBuilder = new AptxTreeBuilder(
Phylogeny aptxTree = aptxTreeBuilder.buildTree();
- MainFrame aptxApp = createAptxFrame(aptxTree);
+ MainFrame aptxApp = createAptxFrame(aptxTree,
+ calculatedTree.getAvport(), null);
- bindNodesToJalviewSequences(aptxApp, calculatedTree.getAvport(),
- aptxTreeBuilder.getAlignmentBoundNodes(),
- aptxTreeBuilder.getNodesBoundAlignment());
-
- return bindFrameToJalview(aptxApp);
-
+ return aptxApp;
}
/**
for (int i = 0; i < phylogenies.length; i++)
{
Phylogeny tree = phylogenies[i];
+
if (nhx_or_nexus && INTERNAL_NUMBERS_AS_CONFIDENCE)
{
PhylogenyMethods.transferInternalNodeNamesToConfidence(tree, "");
}
- MainFrame aptxApp = Archaeopteryx.createApplication(tree, APTX_CONFIG,
- treeTitle);
- LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
- viewport.getAlignment().getSequencesArray(), tree);
-
- bindAptxNodes.associateLeavesToSequences();
- bindNodesToJalviewSequences(aptxApp, viewport,
- bindAptxNodes.getAlignmentWithNodes(),
- bindAptxNodes.getNodesWithAlignment());
- bindFrameToJalview(aptxApp);
- aptxFrames[i] = aptxApp;
+ aptxFrames[i] = createAptxFrame(tree, viewport, treeTitle);
}
return aptxFrames;
for (int i = 0; i < trees.length; i++)
{
Phylogeny tree = trees[i];
- MainFrame aptxApp = Archaeopteryx.createApplication(tree, APTX_CONFIG,
- treeTitle);
- LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
- viewport.getAlignment().getSequencesArray(), tree);
-
- bindAptxNodes.associateLeavesToSequences();
- bindNodesToJalviewSequences(aptxApp, viewport,
- bindAptxNodes.getAlignmentWithNodes(),
- bindAptxNodes.getNodesWithAlignment());
- bindFrameToJalview(aptxApp);
- aptxFrames[i] = aptxApp;
+ aptxFrames[i] = createAptxFrame(tree, viewport, treeTitle);
}
return aptxFrames;
+
public static MainFrame createAptxFrame(
- final Phylogeny aptxTree)
+ final Phylogeny aptxTree,
+ final AlignmentViewport jalviewAlignport, String treeTitle)
{
MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree,
- APTX_CONFIG, null);
+ APTX_CONFIG, treeTitle);
+ LoadedTreeAssociation bindAptxNodes = new LoadedTreeAssociation(
+ jalviewAlignport.getAlignment().getSequencesArray(), aptxTree);
+
+ bindAptxNodes.associateLeavesToSequences();
+ bindNodesToJalviewSequences(aptxApp, jalviewAlignport,
+ bindAptxNodes.getAlignmentWithNodes(),
+ bindAptxNodes.getNodesWithAlignment());
+ bindFrameToJalview(aptxApp);
return aptxApp;
}
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
+import jalview.gui.Desktop;
+
+import org.forester.archaeopteryx.Archaeopteryx;
import org.forester.archaeopteryx.MainFrame;
import org.forester.archaeopteryx.TreePanel;
import org.forester.phylogeny.Phylogeny;
@BeforeClass(dependsOnMethods = { "setUpJalview", "setUpTree" })
public void createTreeView()
{
- treeView = AptxInit.createUnboundInstance(inputTree);
+ treeView = Archaeopteryx.createApplication(inputTree);
aptx = (MainFrame) treeView; // pretty ugly
treePanel = aptx.getMainPanel().getCurrentTreePanel();
tree = treePanel.getPhylogeny();
+
+ Desktop.addInternalFrame(aptx, "Archaeopteryx", 500, 500);
+
}