From f2046fb81157088cd140dc1e49487af2410cce87 Mon Sep 17 00:00:00 2001 From: kjvdheide Date: Mon, 13 Nov 2017 19:19:10 +0000 Subject: [PATCH] JAL-2805 deleted old Aptx class for loading just Newick files --- .../ext/archaeopteryx/ArchaeopteryxNewickInit.java | 123 -------------------- 1 file changed, 123 deletions(-) delete mode 100644 src/jalview/ext/archaeopteryx/ArchaeopteryxNewickInit.java diff --git a/src/jalview/ext/archaeopteryx/ArchaeopteryxNewickInit.java b/src/jalview/ext/archaeopteryx/ArchaeopteryxNewickInit.java deleted file mode 100644 index eb4af6f..0000000 --- a/src/jalview/ext/archaeopteryx/ArchaeopteryxNewickInit.java +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) - * Copyright (C) $$Year-Rel$$ The Jalview Authors - * - * This file is part of Jalview. - * - * Jalview is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 - * of the License, or (at your option) any later version. - * - * Jalview is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Jalview. If not, see . - * The Jalview Authors are detailed in the 'AUTHORS' file. - */ -package jalview.ext.archaeopteryx; - -import jalview.analysis.TreeModel; -import jalview.io.NewickFile; - -import java.io.File; -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.PrintWriter; - -import org.forester.archaeopteryx.Archaeopteryx; - -public class ArchaeopteryxNewickInit -{ - private String filePath = "/tmp/jalviewtree.nwk"; - - private TreeModel tree; - - private NewickFile newickTree; - - public ArchaeopteryxNewickInit(TreeModel jalviewTreeModel) - { - this.tree = jalviewTreeModel; - this.newickTree = treeToNewick(tree); - } - - public ArchaeopteryxNewickInit(NewickFile newickTreeModel) - { - this.newickTree = newickTreeModel; - } - - public void startArchaeopteryx() - { - String newickOutput = newickTree.print(newickTree.hasBootstrap(), - newickTree.hasDistances(), newickTree.hasRootDistance()); - - File newickFile = new File(filePath); - PrintWriter writer; - - try - { - writer = new PrintWriter(newickFile); - writer.println(newickOutput); - - writer.close(); - - String[] commandLineArgs = { "-open", newickFile.getCanonicalPath() }; - Archaeopteryx.main(commandLineArgs); - - } catch (FileNotFoundException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IOException e) - { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - - } - - - public String getFilePath() - { - return filePath; - } - - public void setFilePath(String newFilePath) - { - this.filePath = newFilePath; - } - - public TreeModel getTree() - { - return tree; - } - - public void setTree(TreeModel newTree) - { - this.tree = newTree; - } - - public NewickFile getNewickTree() - { - return newickTree; - } - - public void setNewickTree(NewickFile newNewickTree) - { - this.newickTree = newNewickTree; - } - - public static NewickFile treeToNewick(TreeModel tree) - { - NewickFile newickTree = new NewickFile(tree.getTopNode(), - tree.hasBootstrap(), tree.hasDistances(), - tree.hasRootDistance()); - - return newickTree; - } - -} \ No newline at end of file -- 1.7.10.2