+ else {
+ Phylogeny phy = null;
+ try {
+ final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
+ final Phylogeny[] phylogenies = factory.create( infile,
+ PhyloXmlParser.createPhyloXmlParserXsdValidating() );
+ phy = phylogenies[ 0 ];
+ }
+ catch ( final Exception e ) {
+ ForesterUtil
+ .fatalError( PRG_NAME, "failed to read phylgenies from [" + infile + "] [" + e.getMessage()
+ + "]" );
+ }
+ try {
+ obtainSeqInformation( phy );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( PRG_NAME, e.getMessage() );
+ }
+ try {
+ inferTaxonomyFromDescendents( phy );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( PRG_NAME, e.getMessage() );
+ }
+ catch ( final AncestralTaxonomyInferenceException e ) {
+ ForesterUtil.fatalError( PRG_NAME, e.getMessage() );
+ }
+ try {
+ final PhylogenyWriter w = new PhylogenyWriter();
+ w.toPhyloXML( phy, 0, outfile );
+ }
+ catch ( final IOException e ) {
+ ForesterUtil.fatalError( PRG_NAME, "failed to write output [" + e.getMessage() + "]" );
+ }