+ _mainpanel.getCurrentPhylogeny().clearHashIdToNodeMap();
+ _mainpanel.getCurrentPhylogeny().recalculateNumberOfExternalDescendants( true );
+ _mainpanel.getCurrentTreePanel().resetNodeIdToDistToLeafMap();
+ _mainpanel.getCurrentTreePanel().setEdited( true );
+ getControlPanel().setShowEvents( true );
+ showWhole();
+ final int selected = _mainpanel.getTabbedPane().getSelectedIndex();
+ _mainpanel.addPhylogenyInNewTab( species_tree, getConfiguration(), "species tree", null );
+ showWhole();
+ _mainpanel.getTabbedPane().setSelectedIndex( selected );
+ showWhole();
+ _mainpanel.getCurrentTreePanel().setEdited( true );
+ JOptionPane.showMessageDialog( this, "Duplications: " + gsdi.getDuplicationsSum() + "\n"
+ + "Potential duplications: " + gsdi.getSpeciationOrDuplicationEventsSum() + "\n" + "Speciations: "
+ + gsdi.getSpeciationsSum(), "GSDI successfully completed", JOptionPane.INFORMATION_MESSAGE );
+ }
+
+ void executeGSDIR() {
+ if ( !isOKforSDI( false, true ) ) {
+ return;
+ }
+ final Phylogeny gene_tree = _mainpanel.getCurrentPhylogeny().copy();
+ gene_tree.setAllNodesToNotCollapse();
+ gene_tree.recalculateNumberOfExternalDescendants( false );
+ GSDIR gsdir = null;
+ Phylogeny species_tree = _species_tree.copy();
+ try {
+ gsdir = new GSDIR( gene_tree, species_tree, true, true );
+ }
+ catch ( final Exception e ) {
+ JOptionPane.showMessageDialog( this, e.toString(), "Error during GSDIR", JOptionPane.ERROR_MESSAGE );
+ return;
+ }
+ final Phylogeny result_gene_tree = gsdir.getMinDuplicationsSumGeneTrees().get( 0 );
+ result_gene_tree.setRerootable( false );
+ result_gene_tree.clearHashIdToNodeMap();
+ result_gene_tree.recalculateNumberOfExternalDescendants( true );
+ _mainpanel.addPhylogenyInNewTab( result_gene_tree, getConfiguration(), "gene tree", null );
+ //_mainpanel.getCurrentTreePanel().setTree( gene_tree );
+ // _mainpanel.getCurrentTreePanel().setEdited( true );