- log_writer.write( "Number of duplications : " + sdi.getDuplicationsSum() );
- log_writer.write( ForesterUtil.LINE_SEPARATOR );
- if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) && !most_parsimonous_duplication_model ) {
- final int duplications = ( ( GSDI ) sdi ).getSpeciationOrDuplicationEventsSum();
- System.out.println( "Number of potential duplications: " + duplications );
- log_writer.write( "Number of potential duplications: " + duplications );
- log_writer.write( ForesterUtil.LINE_SEPARATOR );
- }
- if ( base_algorithm == BASE_ALGORITHM.GSDI ) {
- final int spec = ( ( GSDI ) sdi ).getSpeciationsSum();
+ log_writer.println( "Number of duplications : " + sdi.getDuplicationsSum() );
+ if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
+ final GSDI gsdi = ( GSDI ) sdi;
+ final File species_tree_used_file = new File( out_file + SUFFIX_FOR_SPECIES_TREE_USED );
+ try {
+ final PhylogenyWriter writer = new PhylogenyWriter();
+ writer.toPhyloXML( species_tree_used_file, gsdi.getSpeciesTree(), 0 );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( PRG_NAME,
+ "Failed to write to [" + species_tree_used_file + "]: " + e.getMessage() );
+ }
+ System.out.println();
+ System.out.println( "Wrote used species tree to: " + species_tree_used_file );
+ System.out.println();
+ log_writer.println( "Wrote used species tree to: " + species_tree_used_file );
+ if ( !most_parsimonous_duplication_model ) {
+ final int duplications = gsdi.getSpeciationOrDuplicationEventsSum();
+ System.out.println( "Number of potential duplications: " + duplications );
+ log_writer.println( "Number of potential duplications: " + duplications );
+ }
+ final int spec = gsdi.getSpeciationsSum();