- System.out.println( "Mapping cost : " + sdi.computeMappingCostL() );
- log_writer.write( "Mapping cost : " + sdi.computeMappingCostL() );
- log_writer.write( ForesterUtil.LINE_SEPARATOR );
- }
- System.out.println( "Number of duplications : " + sdi.getDuplicationsSum() );
- 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();
- System.out.println( "Number of speciations : " + spec );
- log_writer.write( "Number of speciations : " + spec );
- log_writer.write( ForesterUtil.LINE_SEPARATOR );
+ System.out.println( "Mapping cost : " + sdi.computeMappingCostL() );
+ log_writer.println( "Mapping cost : " + sdi.computeMappingCostL() );
+ }
+ else if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
+ final GSDI gsdi = ( GSDI ) sdi;
+ final File species_tree_used_file = new File( ForesterUtil.removeSuffix( out_file.toString() )
+ + 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.getCanonicalPath()
+ + "]: " + e.getMessage() );
+ }
+ System.out.println( "Wrote (stripped) species tree to : "
+ + species_tree_used_file.getCanonicalPath() );
+ log_writer.println( "Wrote (stripped) species tree to : "
+ + species_tree_used_file.getCanonicalPath() );
+ }
+ System.out.println( "Number of external nodes in gene tree : " + gene_tree.getNumberOfExternalNodes() );
+ log_writer.println( "Number of external nodes in gene tree : " + gene_tree.getNumberOfExternalNodes() );
+ System.out.println( "Number of external nodes in species tree : "
+ + sdi.getSpeciesTree().getNumberOfExternalNodes() );
+ log_writer.println( "Number of external nodes in species tree : "
+ + sdi.getSpeciesTree().getNumberOfExternalNodes() );
+ if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
+ final GSDI gsdi = ( GSDI ) sdi;
+ final int poly = PhylogenyMethods.countNumberOfPolytomies( gsdi.getSpeciesTree() );
+ System.out.println( "Number of polytomies in species tree : " + poly );
+ log_writer.println( "Number of polytomies in species tree : " + poly );
+ System.out.println( "External nodes stripped from gene tree : "
+ + gsdi.getStrippedExternalGeneTreeNodes().size() );
+ log_writer.println( "External nodes stripped from gene tree : "
+ + gsdi.getStrippedExternalGeneTreeNodes().size() );
+ System.out.println( "External nodes stripped from species tree: "
+ + gsdi.getStrippedSpeciesTreeNodes().size() );
+ log_writer.println( "External nodes stripped from species tree: "
+ + gsdi.getStrippedSpeciesTreeNodes().size() );
+ }
+ System.out.println();
+ System.out.println( "Number of duplications : " + sdi.getDuplicationsSum() );
+ log_writer.println( "Number of duplications : " + sdi.getDuplicationsSum() );
+ if ( ( base_algorithm == BASE_ALGORITHM.GSDI ) ) {
+ final GSDI gsdi = ( GSDI ) sdi;
+ if ( !most_parsimonous_duplication_model ) {
+ final int u = gsdi.getSpeciationOrDuplicationEventsSum();
+ System.out.println( "Number of potential duplications : " + u );
+ log_writer.println( "Number of potential duplications : " + u );
+ }
+ System.out.println( "Number of speciations : " + gsdi.getSpeciationsSum() );
+ log_writer.println( "Number of speciations : " + gsdi.getSpeciationsSum() );
+ log_writer.println();
+ printMappedNodesToLog( log_writer, gsdi );
+ log_writer.println();
+ printStrippedGeneTreeNodesToLog( log_writer, gsdi );
+ log_writer.println();
+ printStrippedSpeciesTreeNodesToLog( log_writer, gsdi );