in progress
[jalview.git] / forester / java / src / org / forester / analysis / TaxonomyDataManager.java
index 4e88a61..d78720c 100644 (file)
@@ -199,7 +199,10 @@ public final class TaxonomyDataManager extends RunnableProcess {
     }
 
     private final static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode( final String query ) throws IOException {
-        if ( ( query.indexOf( "XX" ) == 3 ) && TaxonomyUtil.isHasTaxIdFromFakeTaxCode( query ) ) {
+        //FIXME fix "SPHAR" issue
+        if ( ( ( query.indexOf( "XX" ) == 3 ) && TaxonomyUtil.isHasTaxIdFromFakeTaxCode( query ) )
+                || query.equals( "SPHAR" ) /* TODO remove me, is same as Sphingomonas aromaticivorans */
+        ) {
             final int id = TaxonomyUtil.getTaxIdFromFakeTaxCode( query );
             return SequenceDbWsTools.getTaxonomiesFromId( String.valueOf( id ), MAX_TAXONOMIES_TO_RETURN );
         }
@@ -251,7 +254,7 @@ public final class TaxonomyDataManager extends RunnableProcess {
                 if ( ( ( tax != null ) && ( isHasAppropriateId( tax )
                         || !ForesterUtil.isEmpty( tax.getScientificName() )
                         || !ForesterUtil.isEmpty( tax.getTaxonomyCode() ) || !ForesterUtil
-                        .isEmpty( tax.getCommonName() ) ) ) ) {
+                            .isEmpty( tax.getCommonName() ) ) ) ) {
                     uniprot_tax = obtainUniProtTaxonomy( tax, null, qt );
                 }
                 else {
@@ -352,7 +355,7 @@ public final class TaxonomyDataManager extends RunnableProcess {
         }
         if ( ut == null ) {
             String sn = "";
-            final Matcher m = ParserUtils.TAXOMONY_SN_PATTERN_I.matcher( simple_name );
+            final Matcher m = ParserUtils.TAXOMONY_SN_PATTERN_GENUS.matcher( simple_name );
             if ( m.matches() ) {
                 sn = m.group( 1 );
             }