+ private void readSpeciesTree( final Configuration configuration, final String species_tree_url_str )
+ throws MalformedURLException, FileNotFoundException, IOException {
+ final URL species_tree_url = new URL( species_tree_url_str );
+ final Phylogeny[] species_trees = AptxUtil.readPhylogeniesFromUrl( species_tree_url,
+ configuration
+ .isValidatePhyloXmlAgainstSchema(),
+ configuration
+ .isReplaceUnderscoresInNhParsing(),
+ false,
+ TAXONOMY_EXTRACTION.NO,
+ false );
+ if ( ( species_trees != null ) && ( species_trees.length > 0 ) ) {
+ AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "successfully read species tree" );
+ if ( species_trees[ 0 ].isEmpty() ) {
+ ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "species tree is empty" );
+ }
+ else if ( !species_trees[ 0 ].isRooted() ) {
+ ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "species tree is not rooted" );
+ }
+ else {
+ setSpeciesTree( species_trees[ 0 ] );
+ AptxUtil.printAppletMessage( ArchaeopteryxA.NAME, "species tree OK" );
+ }
+ }
+ else {
+ ForesterUtil.printErrorMessage( ArchaeopteryxA.NAME, "failed to read species tree from "
+ + species_tree_url_str );
+ }
+ }
+