+
+ public final static void extractTaxonomyDataFromNodeName( final PhylogenyNode node,
+ final NHXParser.TAXONOMY_EXTRACTION taxonomy_extraction )
+ throws PhyloXmlDataFormatException {
+ final String id = extractUniprotTaxonomyIdFromNodeName( node.getName(), taxonomy_extraction );
+ if ( !ForesterUtil.isEmpty( id ) ) {
+ if ( !node.getNodeData().isHasTaxonomy() ) {
+ node.getNodeData().setTaxonomy( new Taxonomy() );
+ }
+ node.getNodeData().getTaxonomy().setIdentifier( new Identifier( id, "uniprot" ) );
+ }
+ else {
+ final String code = extractTaxonomyCodeFromNodeName( node.getName(), taxonomy_extraction );
+ if ( !ForesterUtil.isEmpty( code ) ) {
+ if ( !node.getNodeData().isHasTaxonomy() ) {
+ node.getNodeData().setTaxonomy( new Taxonomy() );
+ }
+ node.getNodeData().getTaxonomy().setTaxonomyCode( code );
+ }
+ }
+ }