import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
import org.forester.phylogeny.factories.PhylogenyFactory;
import org.forester.sdi.RIO;
+import org.forester.sdi.RIOException;
+import org.forester.sdi.SDIException;
import org.forester.util.CommandLineArguments;
import org.forester.util.EasyWriter;
import org.forester.util.ForesterUtil;
public class rio {
final static private String PRG_NAME = "rio";
- final static private String PRG_VERSION = "3.00 beta 2";
- final static private String PRG_DATE = "2012.11.30";
+ final static private String PRG_VERSION = "3.00 beta 3";
+ final static private String PRG_DATE = "2012.12.05";
final static private String E_MAIL = "czmasek@burnham.org";
final static private String WWW = "www.phylosoft.org/forester/";
final static private String HELP_OPTION_1 = "help";
ForesterUtil.fatalError( PRG_NAME, "species tree is not completely binary" );
}
try {
- RIO rio;
+ final RIO rio;
if ( ForesterUtil.isEmpty( query ) ) {
rio = new RIO( gene_trees_file, species_tree );
}
tableOutput( table_outfile, rio );
}
}
- catch ( final IllegalArgumentException e ) {
+ catch ( final RIOException e ) {
+ ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
+ }
+ catch ( final SDIException e ) {
+ ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
+ }
+ catch ( final IOException e ) {
ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
}
catch ( final Exception e ) {
- ForesterUtil.printErrorMessage( PRG_NAME, e.getLocalizedMessage() );
- e.printStackTrace();
- System.exit( -1 );
+ ForesterUtil.unexpectedFatalError( PRG_NAME, e );
}
if ( outfile != null ) {
ForesterUtil.programMessage( PRG_NAME, "wrote results to \"" + outfile + "\"" );
System.exit( 0 );
}
- private static void tableOutput( final File table_outfile, final RIO rio ) throws IOException {
+ private static void tableOutput( final File table_outfile, final RIO rio ) throws IOException, RIOException {
final IntMatrix m = RIO.calculateOrthologTable( rio.getAnalyzedGeneTrees() );
writeTable( table_outfile, rio, m );
}
final EasyWriter w = ForesterUtil.createEasyWriter( table_outfile );
final java.text.DecimalFormat df = new java.text.DecimalFormat( "0.###" );
df.setDecimalSeparatorAlwaysShown( false );
- w.print( "\t" );
for( int i = 0; i < m.size(); ++i ) {
w.print( "\t" );
w.print( m.getLabel( i ) );
w.println();
for( int x = 0; x < m.size(); ++x ) {
w.print( m.getLabel( x ) );
- w.print( "\t" );
for( int y = 0; y < m.size(); ++y ) {
w.print( "\t" );
if ( x == y ) {