- void executeSDI() {
- if ( !isOKforSDI( true, true ) ) {
- return;
- }
- if ( !_mainpanel.getCurrentPhylogeny().isRooted() ) {
- JOptionPane.showMessageDialog( this,
- "Gene tree is not rooted",
- "Cannot execute SDI",
- JOptionPane.ERROR_MESSAGE );
- return;
- }
- final Phylogeny gene_tree = _mainpanel.getCurrentPhylogeny().copy();
- gene_tree.setAllNodesToNotCollapse();
- gene_tree.recalculateNumberOfExternalDescendants( false );
- SDI sdi = null;
- int duplications = -1;
- try {
- sdi = new SDIse( gene_tree, _species_tree.copy() );
- duplications = sdi.getDuplicationsSum();
- }
- catch ( final Exception e ) {
- JOptionPane.showMessageDialog( this, e.toString(), "Error during SDI", JOptionPane.ERROR_MESSAGE );
- }
- gene_tree.setRerootable( false );
- _mainpanel.getCurrentTreePanel().setTree( gene_tree );
- getControlPanel().setShowEvents( true );
- showWhole();
- _mainpanel.getCurrentTreePanel().setEdited( true );
- JOptionPane.showMessageDialog( this,
- "Number of duplications: " + duplications,
- "SDI successfully completed",
- JOptionPane.INFORMATION_MESSAGE );
- }
-