diff --git a/junit-test-inputs/quick.phy b/junit-test-inputs/quick.phy new file mode 100644 index 0000000..c8cfa06 --- /dev/null +++ b/junit-test-inputs/quick.phy @@ -0,0 +1,21 @@ +20 736 +BOS____001 MDHAEENEILGATKRYYVERPIFSHPVLQERLHKKDKVSDSIGDKLKQAFTCTPKKIRNIIYMFLPITKWLPAYKFKEYVLGDLVSGISTGVLQLPQGLAFAMLAAVPPVFGLYSSFYPVIMYCFFGTSRHVSIGPFAVISLMIGGVAVRLVPDDIVIPGGVNATNGTEA-RDALRVKVAMSVTLLSGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHVFTSMLKYLFGVKTKRYSGIFSVVYSTVAVLQNVKNLNVCSLGVGLMVFGLLLGGKEFNERFKEKLPAPIPLEFFAVVMGTGISAGFNLHESYNVDVVGTLPLGLLPPANPDTSLFHLVYVDAIAIAIVGFSVTISMAKTLANKHGYQVDGNQELIALGLCNSIGSLFQTFSISCSLSRSLVQEGTGGKTQLAGCLASLMILLVILATGFLFESLPQAVLSAIVIVNLKGMFMQFSDLPFFWRTSKIELTIWLTTFVSSLFLGLDYGLITAVIIALLTVIYRTQSPSYKVLGQLPDTDVYIDIDAYEEVKEIPGIKIFQINAPIYYANSDLYSNALKRKTGVNPAFIMGARRKAMRKYAKEVGNANMANATVVK--VDAEVDGEDGTKPEEDENEIKYPP-I--VIKSTLPEELQRFMPPGDNIHTIILDFTQVNFIDSVGVKTLAGIVKEYGDVGIYVYLAGCSAQVVNDLTRNRFFENPALLELLFHSIHDAVLGSQAREALAEQEGSAVPP- +CANIS__002 MDHAEENEILTASQRYYVERPIFSHPVLQERLHKKDKISDSIGDKLKQAFTCTPKKIRNIIYMFLPITKWLPAYKFKEYVLGDLVSGISTGVLQLPQGLAFAMLAAVPPVFGLYSSFYPVIMYCFLGTSRHISIGPFAVISLMIGGVAVRLVPDDIVIPGGVNATNGTEA-RDALRVKVAMSVTLLSGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHVFTS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K-------------------------------------TDGEVDGEDNTKPEEDDDEVKYPP-V--VTKSTFPEELQRFMPPGDNVHTVILDFTQVNFIDSVGVKTLAGIVKEYGDVGIYVYLAGCSAQVVNDLTRNRFFENPALLELLFHSIHDAVLGSQVRETLAEQEASGLPPQ +EQUUS__004 MDHAEENEILAATQRYSVDRPIFSHPVLQERLHKKDKVPDSIGDKLKQAFICTPKKIRNIIYMFLPITKWLPAYKFKEYVLGDLVSGISTRVLQLPQGLAFAMLAAVPPVFGLYSSFYPVIMYCFLGTSRHISIGPFAVISLMIGAVAVRLVPDDIVIPGGVNATNGTEA-RDALRVKVAMSVTLLSGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHVFTSMLKYLFGVKTKRYSGIFSVVYSTVAVLQNVKNLNVCSLGVGLMVFGLLLGGKEFNERFKEKLPAPIPLEFFAVVMGTGISAGFNLQESYNVDVVGTLPLGLLPPANPDTSLFHLVYVDAIAIAIVGFSVTISMAKTLANKHGYQVDGNQELIALGLCNSIGSLFQTFSISCSLSRSLVQEGTGGKTQLAGCLASLMILLVILATGFLFESLPQAVLSAIVIVNLKGMFMQFSDLPFFWRTSKIELTIWLTTFVSSLFLGLDYGLITAVIIALLTVIYRTQSPSYKVLGQLPDTDVYIDIDAFEEVKEIPGIKIFQINAPIYYANSDLYSSALKRKTGVNPAHIMGARRKAMRKYAKEVGNANMANATVVK--VDAAVDGEDGTKPEEEEDEIKFPP-V--VTKSTFPEELQRFMPPGDNIHTIILDFTQVNFIDSVGVKTLAGIVKEYGDVGIYVYLAGCSAQVVNDLTQNRFFENPALKKLLFHSIHDAVLGSQVREALAEQEASAPPP- +ERINACE005 ---------------------------------------------------CTPKKIRNIIYMFLPITKWLPAYKFKEYVLGDLVSGISTGVLQLPQGLAFAMLAAVPPVFGLYSSFYPVIMYCFFGTSRHISIGPFAVISLMIGGVAVRLVPDDIVIPGGVNATNGTEA-RDALRVKVAMSVTLLSGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHV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IFSHLVLQERLHKKDKISDSIGDKLKQAFTCTPKKIRNIIYMFLPITKWLPAYNFKEYVLGDLVSGISTGVLQLPQGLAFAMLAAVPPVFGLYSSFYPVIMYCFFGTSRHISIGPFAVISLMIGGVAVRLVPDDIAVPGGVNATNGTEF-RDALRVKVAMSVTLLAGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHVFTSMLKYLFGVKTKRYSGIFSVVYSTVAVLQNVKNLNVCSLGVGLMVFGLLLGGKEFNERFKEKLPAPIPLEFFAVVMGTGISAGFGLHESYNVDVVGTLPLGLLPPANPDTSLFHLVYVDAIAIAIVGFSVTISMAKTLANKHGYQVDGNQELIALGLCNSTGSLFQTFAISCSLSRSLVQEGIGGKTQLAGCLASLMILMVILATGFLFESLPQAVLSAIVIVNLKGMFMQFSDLPFFWRTSKIELVIWLSTFVSSLFLGLDYGLITAVIIALMTVIYRTQSPTYTVLGQLPDTDVYIDIDAYEEVKEIPGIKIFQINAPIYYANSDLYSNALKRKTGVNPSFILGARRKAMKKYAKEGGNINIANATDVK--ADAEVDAEDGTKPEEEEDEVKYPP-V--VIKSTFPEELQRFMPPLENVHTIILDFTQVNFIDSVGVKTLQGIVKEYGDVGIYVYLAGCSAQVVSDLTRNRFFENPALLDLLFHSIHDAVLGSLVREALEEKEAAAATP- +SOREX__018 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------VVMGTGISAGFNLKESYNVDVVGTLPLGLLPPANPDTSLFHLVYVDAIAIAIVGFSVTISMAKTLANKHGYQVDGNQELIALGLCNSIGSLFQTFSISCSLSRSLVQEGTGGKTQLAGCLASLMILLVILATGFLFESLPQAVLSAIVIVNLKGMFMQFSDLPFFWRTSKIELTIWLTTFVSSLFLGLDYGLITAVIIALLTVIYRTQSPSYKVLGQLPDTDVYIDIDAYEEVKEIPGIKIFQINAPIYYANSDLYSNALKRKTGVNPALIMGARRKAMKKYAKEVGNENIANATVVKVV-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX---IVKEYGDVGIYVYLAGCSAQVVNDLTRNRFFENPAMLELLFHSIHDAVLGSLVREALAEQETSAPAPQ +TURSIOP019 MDHVEETEILAATQRYYVERPIFSHPVLQERLHKKDKISESIGDKLKQAFTCTPKKIRNIIYMFLPITKWLPAYRFKEYVLGDIVSGISTGVLQLPQGLAFAMLAAVPPVFGLYSSFYPVIMYCFFGTSRHISIGPFAVISLMIGGVAVRLVPDDIVIPGGVNATNSTEA-RDALRVKVAMSVTLLTGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHVFTSMLKYLFGVKTKRYSGIFSVVYSTVAVLQNVKNLNVCSLGVGLMVFGLLLGGKEFNERFKEKLPAPIPLEFFAVVMGTGISAGFSLHESYNVDVVGTLPLGLLPPANPDTSLFHLVYVDAIAIAIVGFSVTISMAKTLANKHGYQVDGNQELIALGLCNSTGSLFQTFAISCSLSRSLVQEGTGGKTQLAGCLASLMILLVILATGFLFESLPQAVLSAIVIVNLKGMFMQFSDLPFFWRTSKIELTIWLTTFVSSLFLGLDYGLITAVIIALMTVIYRTQSPSYIVLGQLPDTDVYIDIDAYEEVKEVPGIKIFQINAPIYYANSDLYSSALKRKTGVNPAFILGARRKAMKKYAKEVGNANMANATVVK--VDAEVDAEDGTKPEEEEDEIKYPP-I--VTKSTLPEELQRFMPPGDNVHTIILDFTQVNFMDSVGVKTLAGIVKEYGDVGIYVYLAGCSAQVVSDLTQNQFFENPALLDLLFHSIHDAVLGSQVREALAEQEATAAPP- +VICUGNA020 ---------------------------------------------------CTPKKIRNIIYMFLPITKWLPAYKFKEYVLGDLVSGISTGVLQLPQ-XXXXXXXXXXXXXXXXXXXQKESMYCFLGTSRHISIGPFAVISLMIGGVAVRLVPDDIVIPGGVNATNGTEA-RDALRVKVAMSVTLLSGIIQFCLGVCRFGFVAIYLTEPLVRGFTTAAAVHVFTSMLKYLFGVKTKRYSGIFSVVYSTVAVLQNVKNLNVCSLGVGLMVFGLLLGGKEFNERFKEKLPAPIPLEFFAVVMGTGISAGFNLKESYNVDVVGTLPLGLLPPANPDTSLFHLVYVDAIAIAIVGFSVTISMAKTLANKHGYQVDGN-ELIALGLCNSIGSLFQTFSISCSLSRSLVQEGTGGKTQLAGCLASLMILLVILATGFLFESLPQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXVKEIPGIKIFQINAPIYYANSDLYSNALKRKTGVNPAFIMGARRKAMKKYAKEVGNANMANATVIK-VTDAEVDGTDGTKPEEEEDEIKYPP-V--VIKNTFPEELQRFMPPGDNVHTIILDFTQVNFIDSVGVKTVAGIVKEYGDVGIYVYLAGCSAQVVNDLSRNRFFENPALLELLFHSIHDAVLGSQVREALAEQEALAAPPP diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/CONTEXTVersion.java b/src/uk/ac/qmul/sbcs/evolution/convergence/CONTEXTVersion.java index 20078e1..ce9f5ce 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/CONTEXTVersion.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/CONTEXTVersion.java @@ -18,7 +18,7 @@ public class CONTEXTVersion extends Version { /** * Version string: assumed to be in format x.x.x */ - private static final String VERSION = "0.8.3"; + private static final String VERSION = "0.8.4"; private static final String DATE_STRING = "2011-2017"; diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/NewickTreeRepresentation.java b/src/uk/ac/qmul/sbcs/evolution/convergence/NewickTreeRepresentation.java index 8a39c5a..ddae4bf 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/NewickTreeRepresentation.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/NewickTreeRepresentation.java @@ -103,7 +103,7 @@ public NewickTreeRepresentation(File inputFile, TreeSet names){ } } } - } catch (UnsupportedTreefileTypeParseException e) { + } catch (Exception e) { // TODO Auto-generated catch block System.err.println("tree parsing failed."); e.printStackTrace(); @@ -183,7 +183,7 @@ public NewickTreeRepresentation(File inputFile){ } } } - } catch (UnsupportedTreefileTypeParseException e) { + } catch (Exception e) { // TODO Auto-generated catch block System.err.println("tree parsing failed."); e.printStackTrace(); diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/PhylogenyConvergenceType.java b/src/uk/ac/qmul/sbcs/evolution/convergence/PhylogenyConvergenceType.java index 17794b2..a60a30a 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/PhylogenyConvergenceType.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/PhylogenyConvergenceType.java @@ -5,5 +5,6 @@ public enum PhylogenyConvergenceType { TEST_ALTERNATIVE_PHYLOGENY, RANDOM_CONTROL_PHYLOGENY, RAXML_RESOLVED_PARTIALLY_CONSTRAINED_PHYLOGENY, - RAXML_FULLY_RESOLVED_UNCONSTRAINED_PHYLOGENY + RAXML_FULLY_RESOLVED_UNCONSTRAINED_PHYLOGENY, + UNDEFINED } diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/CONTEXTPhlogenomicDatasetBrowser.java b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/CONTEXTPhlogenomicDatasetBrowser.java index ef424b0..bb1e6dc 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/CONTEXTPhlogenomicDatasetBrowser.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/CONTEXTPhlogenomicDatasetBrowser.java @@ -146,8 +146,8 @@ private class PhylogenomicDatasetBrowserView extends JFrame{ JProgressBar taskbar; JFileChooser alignmentsFileChooser, alignmentsDirectoryChooser, phylogeniesFileChooser, phylogeniesDirectoryChooser; JMenuBar menuBar; - JMenu fileMenu, helpMenu, loadAlignments, loadTrees; - JMenuItem loadAlignmentsSingle, loadAlignmentsBatch, loadTreesSingle, loadTreesBatch, close, about, showPlots; // fileMenu sub-items + JMenu fileMenu, helpMenu, loadAlignments, loadTrees, exportData; + JMenuItem loadAlignmentsSingle, loadAlignmentsBatch, loadTreesSingle, loadTreesBatch, exportAlignments, exportTrees, close, about, showPlots; // fileMenu sub-items JMenuItem help, reportBugs, contributeCode; // helpMenu sub-items public PhylogenomicDatasetBrowserView(PhylogeniesView phy_view, AlignmentsView align_view){ @@ -213,6 +213,11 @@ void createMenuBar(){ loadTreesBatch = new JMenuItem("As directory of files (batch operation)"); loadTrees.add(loadTreesSingle); loadTrees.add(loadTreesBatch); + exportData = new JMenu("Export alignment/tree statistics data..."); + exportAlignments = new JMenuItem("Export alignment stats"); + exportTrees = new JMenuItem("Export tree stats"); + exportData.add(exportAlignments); + exportData.add(exportTrees); close = new JMenuItem("Quit CONTEXT/Phylogenomic Dataset Browser"); // Instantiate the Help menu items @@ -226,6 +231,7 @@ void createMenuBar(){ fileMenu.add(showPlots); fileMenu.add(loadAlignments); fileMenu.add(loadTrees); + fileMenu.add(exportData); fileMenu.addSeparator(); fileMenu.add(close); @@ -301,7 +307,8 @@ private class PhylogenomicDatasetBrowserController{ view.loadAlignmentsBatch.addActionListener(batchAddAlignmentsListener); view.loadTreesSingle.addActionListener(phylogeniesController.getAddSinglePhylogenyButtonListener()); view.loadTreesBatch.addActionListener(phylogeniesController.getAddBatchPhylogenyButtonListener()); - + view.exportAlignments.addActionListener(alignmentsController.getExportAlignmentDataButtonListener()); + view.exportTrees.addActionListener(phylogeniesController.getExportTreeDataButtonListener()); /* Add action listeners for other menu items */ view.about.addActionListener(new AboutMenuListener()); @@ -317,6 +324,8 @@ private class PhylogenomicDatasetBrowserController{ view.loadAlignmentsBatch.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()+1)); view.loadTreesSingle.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); view.loadTreesBatch.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()+1)); + view.exportAlignments.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); + view.exportTrees.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_E, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()+1)); view.close.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); view.help.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_H, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask())); } diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/DisplayPhylogeny.java b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/DisplayPhylogeny.java index 0ae5b73..2a01387 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/DisplayPhylogeny.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/DisplayPhylogeny.java @@ -167,6 +167,10 @@ public NewickTreeRepresentation getNewickTree() { return newickTree; } + public File getTreeFile() { + return treeFile; + } + public TreeNode getTreeNode() { return treeNode; } diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/AlignmentsController.java b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/AlignmentsController.java index d34feac..a0682a3 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/AlignmentsController.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/AlignmentsController.java @@ -39,7 +39,7 @@ public class AlignmentsController { AddSingleAlignmentsButtonListener addAlignmentsListenerSingle; AddBatchAlignmentsButtonListener addAlignmentsListenerBatch; RemoveSelectedAlignmentsButtonListener removeSelectedAlignmentSingle; - DumpTextFileButtonListener dumpTextFileButtonListener; + ExportAlignmentDataButtonListener exportAlignmentDataButtonListener; TableDefinitionButtonListener tableDefinitionButtonListener; ShowPlottingFrameButtonListener showPlottingFrameButtonListener; GlobalController globalController; @@ -66,12 +66,12 @@ public AlignmentsController(AlignmentsModel alignmentsModel, AlignmentsView alig addAlignmentsListenerSingle = new AddSingleAlignmentsButtonListener(); addAlignmentsListenerBatch = new AddBatchAlignmentsButtonListener(); removeSelectedAlignmentSingle = new RemoveSelectedAlignmentsButtonListener(); - dumpTextFileButtonListener = new DumpTextFileButtonListener(); + exportAlignmentDataButtonListener = new ExportAlignmentDataButtonListener(); tableDefinitionButtonListener = new TableDefinitionButtonListener(); showPlottingFrameButtonListener = new ShowPlottingFrameButtonListener(); view.addAddAlignmentsButtonListener(addAlignmentsListenerSingle); view.addRemoveAlignmentsButtonListener(removeSelectedAlignmentSingle); - view.addTextDumpButtonListener(dumpTextFileButtonListener); + view.addTextDumpButtonListener(exportAlignmentDataButtonListener); view.addTableDefinitionButtonListener(tableDefinitionButtonListener); view.addShowPlottingFrameButtonListener(showPlottingFrameButtonListener); view.addTable(model); @@ -149,7 +149,7 @@ public void actionPerformed(ActionEvent ev) { * @author Joe Parker, Kitson Consulting / RBG Kew * */ - public class DumpTextFileButtonListener implements ActionListener{ + public class ExportAlignmentDataButtonListener implements ActionListener{ @Override public void actionPerformed(ActionEvent ev) { // Get string representing table data @@ -583,5 +583,9 @@ public AddSingleAlignmentsButtonListener getAddSingleAlignmentsButtonListener(){ public AddBatchAlignmentsButtonListener getAddBatchAlignmentsButtonListener(){ return this.addAlignmentsListenerBatch; } + + public ExportAlignmentDataButtonListener getExportAlignmentDataButtonListener() { + return exportAlignmentDataButtonListener; + } } diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/PhylogeniesController.java b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/PhylogeniesController.java index 9d31cc2..14de1a8 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/PhylogeniesController.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/controllers/PhylogeniesController.java @@ -31,6 +31,7 @@ import uk.ac.qmul.sbcs.evolution.convergence.gui.controllers.AlignmentsController.EmptyAlignmentsListException; import uk.ac.qmul.sbcs.evolution.convergence.gui.models.PhylogeniesModel; import uk.ac.qmul.sbcs.evolution.convergence.gui.views.PhylogeniesView; +import uk.ac.qmul.sbcs.evolution.convergence.util.BasicFileWriter; import uk.ac.qmul.sbcs.evolution.convergence.util.TaxaLimitException; public class PhylogeniesController { @@ -38,6 +39,7 @@ public class PhylogeniesController { PhylogeniesView view; AddSinglePhylogeniesListener addSinglePhylogenyListener = new AddSinglePhylogeniesListener(); AddBatchPhylogeniesListener addBatchPhylogeniesListener = new AddBatchPhylogeniesListener(); + ExportTreeDataButtonListener exportTreeDataButtonListener = new ExportTreeDataButtonListener(); /** * No-arg constructor is deprecated @@ -61,6 +63,10 @@ public JComponent getView() { return view.getPanel(); } + public ExportTreeDataButtonListener getExportTreeDataButtonListener(){ + return this.exportTreeDataButtonListener; + } + /** * Forces the GUI view to show the last row of the model data table */ @@ -76,7 +82,13 @@ public void actionPerformed(ActionEvent ev) { view.getFileChooser().showOpenDialog(view); File phylogenyFile = view.getFileChooser().getSelectedFile(); // do nothing for now - model.addPhylogenyRow(phylogenyFile); + if(phylogenyFile.canRead()&&(!phylogenyFile.isDirectory())&&(!phylogenyFile.getName().equals(".DS_Store"))){ + try { + model.addPhylogenyRow(phylogenyFile); + } catch (Exception ex) { + ex.printStackTrace(); + } + } forceUpdateViewWithLastModelRow(); /* Object[][] modelData = model.getData(); @@ -179,10 +191,12 @@ public Void doInBackground() { int totalFiles = files.length; int filesTried = 0; for(File phylogenyFile:files){ - try { - model.addPhylogenyRow(phylogenyFile); - } catch (Exception ex) { - ex.printStackTrace(); + if(phylogenyFile.canRead()&&(!phylogenyFile.isDirectory()&&(!phylogenyFile.getName().equals(".DS_Store")))){ + try { + model.addPhylogenyRow(phylogenyFile); + } catch (Exception ex) { + ex.printStackTrace(); + } } filesTried++; progress = Math.round(((float)filesTried / (float)totalFiles)*100f); @@ -249,6 +263,27 @@ public void valueChanged(ListSelectionEvent event) { } + /** + * Open a file chooser, pick a directory and write 'tree_descriptive_stats.tdf' there; a dump of all the Alignment objects' stats. + * @author Joe Parker, Kitson Consulting / RBG Kew + * + */ + public class ExportTreeDataButtonListener implements ActionListener{ + @Override + public void actionPerformed(ActionEvent ev) { + // Get string representing table data + String output = model.toString(); + // System I/O - get a directory to write to. + view.getDirectoryChooser().showSaveDialog(null); + //view.getDirectoryChooser().showOpenDialog(view); + //File outputDirectory = view.getDirectoryChooser().getSelectedFile(); + //File outputTextFile = new File(outputDirectory,"alignment_descriptive_stats.tdf"); + new BasicFileWriter(view.getDirectoryChooser().getSelectedFile(),output); + System.out.println("Writing output to "+view.getDirectoryChooser().getSelectedFile().getPath()+"\n"+model.toString()); + } + } + + public TreeSet updateTaxonSet(TreeSet treeSet) throws Exception{ Object[][] data = model.getData(); if(data != null){ diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/models/PhylogeniesModel.java b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/models/PhylogeniesModel.java index c1314e3..601c8bd 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/models/PhylogeniesModel.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/models/PhylogeniesModel.java @@ -6,25 +6,46 @@ import javax.swing.table.AbstractTableModel; import uk.ac.qmul.sbcs.evolution.convergence.PhylogenyConvergenceContext; +import uk.ac.qmul.sbcs.evolution.convergence.PhylogenyConvergenceType; import uk.ac.qmul.sbcs.evolution.convergence.gui.DisplayPhylogeny; import uk.ac.qmul.sbcs.evolution.convergence.gui.DisplayPhylogenyFactory; public class PhylogeniesModel extends AbstractTableModel{ /* Object variables */ - + // Column indices of Integers + private final static Integer[] integerIndices = new Integer[]{1,2,5}; + // Column indices of Floats + private final static Integer[] floatIndices = new Integer[]{3,4,6,7}; + // Default values for (hopefully) sizing the table, etc + public final Object[] longValues = { + new Object(), // 0 + new String(), // 1 + new Integer(0), // 2 + new Integer(0), // 3 + new Double(0), // 4 + new Double(0), // 5 + new Double(0), // 6 + new Double(0), // 7 + new Double(0), // 8 + new String(), // 9 + new Object() + }; + // The column names public final String[] columnNames = new String[]{ - "File", // 0 - "NumberOfPhylogenies", // 1 - "NumberOfTips", // 2 - "TreeHeight", // 3 - "TreeLength", // 4 - "CherryCount", // 5 - "Treeness", // 6 - "ExternalInternalRatio",// 7 - "FirstPhylogeny", // 8 - "PhylogenyConvergenceType" //9 + "FilePath", // 0 + "File", // 1 + "NumberOfPhylogenies", // 2 + "NumberOfTips", // 3 + "TreeHeight", // 4 + "TreeLength", // 5 + "CherryCount", // 6 + "Treeness", // 7 + "ExternalInternalRatio",// 8 + "FirstPhylogeny", // 9 + "PhylogenyConvergenceType" // 10 }; + // The data itself private Object[][] data; /* Utility methods for TableModel type behaviour */ @@ -54,7 +75,18 @@ public int getRowCount() { @Override public Object getValueAt(int row, int col) { if(data != null){ - return data[row][col]; + if(col==6||col==7||col==8){ + Object returnData; + Double dataValue = (Double)data[row][col]; + if(dataValue.equals(Double.NaN)){ + returnData="NA"; + }else{ + returnData=data[row][col]; + } + return returnData; + }else{ + return data[row][col]; + } }else{ return null; } @@ -89,7 +121,7 @@ public boolean isCellEditable(int row, int col) { * Overridden method to set value of (last column), ie the convergenceContextType * TODO removed for now, causing problems * FIXME sort this - * + */ public void setValueAt(Object value, int row, int col) { if(col == getColumnCount()-1){ try { @@ -106,10 +138,10 @@ public void setValueAt(Object value, int row, int col) { // TODO Auto-generated catch block e.printStackTrace(); } + fireTableCellUpdated(row, col); } } - */ /** * Returns the internal Object[][] representing data. Remember: @@ -139,7 +171,13 @@ public PhylogeniesModel(){ */ public void addPhylogenyRow(File newTreeAsFile){ /* First, construct DisplayPhylogeny objects usind DisplayPhylogenyFactory methods */ - DisplayPhylogeny[] phylogenies = DisplayPhylogenyFactory.fromFile(newTreeAsFile); + DisplayPhylogeny[] phylogenies = null; + try { + phylogenies = DisplayPhylogenyFactory.fromFile(newTreeAsFile); + } catch (Exception e1) { + // TODO Auto-generated catch block + e1.printStackTrace(); + } if((phylogenies != null)&&(phylogenies.length>0)){ /* * The data[][] table will need to either be instantiated (if null) @@ -151,7 +189,7 @@ public void addPhylogenyRow(File newTreeAsFile){ /* * Column numberings: * - "File", // 0 + "Filename", // 0 "NumberOfPhylogenies", // 1 "NumberOfTips", // 2 "TreeHeight", // 3 @@ -160,7 +198,8 @@ public void addPhylogenyRow(File newTreeAsFile){ "Treeness", // 6 "ExternalInternalRatio",// 7 "FirstPhylogeny", // 8 - "PhylogenyConvergenceType" //9 + "PhylogenyConvergenceType" // 9 + "FilePath" // 10 */ System.out.println("the first row of the table is null"); // Create a new table @@ -171,49 +210,54 @@ public void addPhylogenyRow(File newTreeAsFile){ Object[] newRow = new Object[getColumnCount()]; newRow[0] = dp; try { - newRow[1] = dp.getNewickTree().getNumberOfTrees(); + newRow[1] = dp.getTreeFile().getName(); + } catch (Exception e) { + newRow[1] = null; + } + try { + newRow[2] = dp.getNewickTree().getNumberOfTrees(); } catch (Exception e) { - newRow[1] = 0; + newRow[2] = "NA"; } try { - newRow[2] = dp.getTreeNode().howManyTips(); + newRow[3] = dp.getTreeNode().howManyTips(); } catch (Exception e) { - newRow[2] = "0"; + newRow[3] ="NA"; } try { - newRow[3] = dp.getTreeNode().getTreeHeight(); + newRow[4] = dp.getTreeNode().getTreeHeight(); } catch (Exception e) { - newRow[3] = "0"; + newRow[4] ="NA"; } try { - newRow[4] = dp.getTreeNode().getTreeLength(); + newRow[5] = dp.getTreeNode().getTreeLength(); } catch (Exception e) { - newRow[4] = "0"; + newRow[5] ="NA"; } try { - newRow[5] = dp.getTreeNode().getTreeCherryCount(); + newRow[6] = dp.getTreeNode().getTreeCherryCount(); } catch (Exception e) { - newRow[5] = "0"; + newRow[6] ="NA"; } try { - newRow[6] = dp.getTreeNode().getTreeTreeness(); + newRow[7] = dp.getTreeNode().getTreeTreeness(); } catch (Exception e) { - newRow[6] = "0"; + newRow[7] ="NA"; } try { - newRow[7] = dp.getTreeNode().getTreeExternalInternalRatio(); + newRow[8] = dp.getTreeNode().getTreeExternalInternalRatio(); } catch (Exception e) { - newRow[7] = "0"; + newRow[8] ="NA"; } try { - newRow[8] = dp.getTextTreeRepresentation(); + newRow[9] = dp.getTextTreeRepresentation(); } catch (Exception e) { - newRow[8] = "();"; + newRow[9] = "NA"; } try { - newRow[9] = dp.getConvergenceContext(); + newRow[10] = dp.getConvergenceContext(); } catch (Exception e) { - newRow[9] = PhylogenyConvergenceContext.NULL_CONVERGENCE_CONTEXT_NOT_SET; + newRow[10] = PhylogenyConvergenceContext.NULL_CONVERGENCE_CONTEXT_NOT_SET; } // Add the new row to the table newData[rowCount] = newRow; @@ -231,27 +275,57 @@ public void addPhylogenyRow(File newTreeAsFile){ int rowCount = data.length; for(DisplayPhylogeny dp:phylogenies){ // Create a new row as an Object[] - Object[] newRow = new Object[getColumnCount()]; + Object[] newRow = new Object[data[0].length]; newRow[0] = dp; try { - newRow[1] = dp.getNewickTree().getNumberOfTrees(); + newRow[1] = dp.getTreeFile().getName(); + } catch (Exception e) { + newRow[1] = null; + } + try { + newRow[2] = dp.getNewickTree().getNumberOfTrees(); } catch (Exception e) { - newRow[1] = 0; + newRow[2] = "NA"; } try { - newRow[2] = dp.getTreeNode().howManyTips(); + newRow[3] = dp.getTreeNode().howManyTips(); } catch (Exception e) { - newRow[2] = "0"; + newRow[3] ="NA"; } try { - newRow[3] = dp.getTextTreeRepresentation(); + newRow[4] = dp.getTreeNode().getTreeHeight(); } catch (Exception e) { - newRow[3] = "();"; + newRow[4] ="NA"; } try { - newRow[4] = dp.getConvergenceContext(); + newRow[5] = dp.getTreeNode().getTreeLength(); } catch (Exception e) { - newRow[4] = PhylogenyConvergenceContext.NULL_CONVERGENCE_CONTEXT_NOT_SET; + newRow[5] ="NA"; + } + try { + newRow[6] = dp.getTreeNode().getTreeCherryCount(); + } catch (Exception e) { + newRow[6] ="NA"; + } + try { + newRow[7] = dp.getTreeNode().getTreeTreeness(); + } catch (Exception e) { + newRow[7] ="NA"; + } + try { + newRow[8] = dp.getTreeNode().getTreeExternalInternalRatio(); + } catch (Exception e) { + newRow[8] ="NA"; + } + try { + newRow[9] = dp.getTextTreeRepresentation(); + } catch (Exception e) { + newRow[9] = "NA"; + } + try { + newRow[10] = dp.getConvergenceContext(); + } catch (Exception e) { + newRow[10] = PhylogenyConvergenceContext.NULL_CONVERGENCE_CONTEXT_NOT_SET; } // Add the new row to the table newData[rowCount] = newRow; @@ -259,8 +333,14 @@ public void addPhylogenyRow(File newTreeAsFile){ rowCount++; } } + // Important! + // We need to check where the rows are going to be inserted - because one treefile may contain MANY trees + int lastRowInExistingTable = 0; + if(data != null){ + lastRowInExistingTable = data.length-1; + } data = newData; - this.fireTableRowsInserted(data.length-1, data.length-1); + this.fireTableRowsInserted(lastRowInExistingTable, lastRowInExistingTable); } } @@ -280,7 +360,7 @@ public DisplayPhylogeny[] getPhylogeniesByConvergenceContext(PhylogenyConvergenc // Iterate through data[][] array, adding DisplayPhylogenies to the arrayList if their contexts match for(Object[] aRow:data){ - if(context == ((PhylogenyConvergenceContext)aRow[aRow.length-1])){ + if(context == ((PhylogenyConvergenceContext)aRow[aRow.length-2])){ matchingPhylogenies.add((DisplayPhylogeny)aRow[0]); } } @@ -296,4 +376,22 @@ public DisplayPhylogeny[] getPhylogeniesByConvergenceContext(PhylogenyConvergenc return null; } } + + @Override + public String toString(){ + StringBuffer sb = new StringBuffer(); + if(data != null){ + for(String columnName:this.columnNames){ + sb.append(columnName+"\t"); + } + sb.append("\n"); + for(Object[] aRow:data){ + for(Object o:aRow){ + sb.append(o.toString()+"\t"); + } + sb.append("\n"); + } + } + return sb.toString(); + } } diff --git a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/views/PhylogeniesView.java b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/views/PhylogeniesView.java index 1956b6f..91c30a1 100644 --- a/src/uk/ac/qmul/sbcs/evolution/convergence/gui/views/PhylogeniesView.java +++ b/src/uk/ac/qmul/sbcs/evolution/convergence/gui/views/PhylogeniesView.java @@ -127,16 +127,16 @@ public JFileChooser getDirectoryChooser(){ public void addTable(PhylogeniesModel newTableModel){ selectionPanel.remove(phylogenyTableScrollPane); phylogeniesTable = new JTable(newTableModel); - /* - * table view fiddling ported from AlignmentsView.addTable() and not checked/implemented - * - phylogeniesTable.setPreferredScrollableViewportSize(new Dimension(700, 250)); + phylogeniesTable.setPreferredScrollableViewportSize(new Dimension(500, 500)); phylogeniesTable.setFillsViewportHeight(true); phylogeniesTable.setRowSelectionAllowed(true); phylogeniesTable.setColumnSelectionAllowed(true); phylogeniesTable.setCellSelectionEnabled(true); phylogeniesTable.setAutoCreateRowSorter(true); phylogeniesTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); + /* + * table view fiddling ported from AlignmentsView.addTable() and not checked/implemented + * * */ phylogenyTableScrollPane = new JScrollPane(phylogeniesTable);