- public static void processInstructions( final PhylogeniesWebserviceClient client, final Phylogeny phylogeny )
- throws PhyloXmlDataFormatException {
- if ( client.getProcessingInstructions().equals( WebserviceUtil.TAX_CODE_TO_SCI_NAME ) ) {
- WebserviceUtil.transferTaxonomyCodeToScientificName( phylogeny );
- }
- else if ( client.getProcessingInstructions().equals( WebserviceUtil.TREE_FAM_INST ) ) {
- WebserviceUtil.transferInternalTaxonomyCodeToScientificName( phylogeny );
- WebserviceUtil.transferExternalScientificNameToTaxonomyCode( phylogeny );
- WebserviceUtil.transferSequenceNameToSequenceAccession( phylogeny, "ensembl" );
- WebserviceUtil.setTaxonomyIdentifierType( phylogeny, "ncbi" );
- }
- else if ( client.getProcessingInstructions().equals( WebserviceUtil.PFAM_INST ) ) {
- WebserviceUtil.extractSpTremblAccFromNodeName( phylogeny, "sptrembl" );
- }
- }
-
- static void setTaxonomyIdentifierType( final Phylogeny phy, final String type ) {
- final PhylogenyNodeIterator it = phy.iteratorPostorder();
- while ( it.hasNext() ) {
- final PhylogenyNode n = it.next();
- if ( n.getNodeData().isHasTaxonomy() && ( n.getNodeData().getTaxonomy().getIdentifier() != null ) ) {
- n.getNodeData()
- .getTaxonomy()
- .setIdentifier( new Identifier( n.getNodeData().getTaxonomy().getIdentifier().getValue(), type ) );
- }
- }
- }
-
- static void transferExternalScientificNameToTaxonomyCode( final Phylogeny phy ) throws PhyloXmlDataFormatException {
- final PhylogenyNodeIterator it = phy.iteratorPostorder();