removed defunct items
authorcmzmasek <czmasek@jcvi.org>
Tue, 21 Jun 2016 23:51:47 +0000 (16:51 -0700)
committercmzmasek <czmasek@jcvi.org>
Tue, 21 Jun 2016 23:51:47 +0000 (16:51 -0700)
forester/java/src/org/forester/archaeopteryx/Constants.java
forester/java/src/org/forester/archaeopteryx/TreePanel.java
forester/java/src/org/forester/archaeopteryx/tools/Blast.java
forester/java/src/org/forester/test/Test.java
forester/java/src/org/forester/ws/wabi/RestUtil.java [deleted file]
forester/java/src/org/forester/ws/wabi/TxSearch.java [deleted file]
forester/java/src/org/forester/ws/wabi/WabiTools.java [deleted file]

index d1a2384..bf059cf 100644 (file)
@@ -40,7 +40,6 @@ public final class Constants {
     public final static boolean __RELEASE                                                     = false;                                                                             // TODO remove me
     public final static boolean __SNAPSHOT_RELEASE                                            = false;                                                                             // TODO remove me
     public final static boolean __SYNTH_LF                                                    = false;                                                                             // TODO remove me
-    public final static boolean ALLOW_DDBJ_BLAST                                              = false;
     public final static String  PRG_NAME                                                      = "Archaeopteryx";
     final static String         VERSION                                                       = "0.9909 experimental";
     final static String         PRG_DATE                                                      = "150513";
index cf4bb2e..ae19727 100644 (file)
@@ -701,16 +701,6 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee
                 catch ( final Exception e ) {
                     e.printStackTrace();
                 }
-                if ( Constants.ALLOW_DDBJ_BLAST ) {
-                    try {
-                        System.out.println( "trying: " + query );
-                        final Blast s = new Blast();
-                        s.ddbjBlast( query );
-                    }
-                    catch ( final Exception e ) {
-                        e.printStackTrace();
-                    }
-                }
             }
         }
     }
index cf34f4e..c9f0e83 100644 (file)
@@ -41,7 +41,6 @@ import org.forester.phylogeny.PhylogenyNode;
 import org.forester.phylogeny.data.Accession;
 import org.forester.util.ForesterUtil;
 import org.forester.util.SequenceAccessionTools;
-import org.forester.ws.wabi.RestUtil;
 
 public final class Blast {
 
@@ -122,108 +121,4 @@ public final class Blast {
     final public static boolean isContainsQueryForBlast( final PhylogenyNode node ) {
         return !ForesterUtil.isEmpty( obtainQueryForBlast( node ) );
     }
-
-    final public void ddbjBlast( final String geneName ) {
-        // Retrieve accession number list which has specified gene name from searchByXMLPath of ARSA. Please click here for details of ARSA.
-        /*target: Sequence length is between 300bp and 1000bp.
-        Feature key is CDS.
-        Gene qualifire is same as specified gene name.*/
-        String queryPath = "/ENTRY/DDBJ/division=='HUM' AND (/ENTRY/DDBJ/length>=300 AND "
-                + "/ENTRY/DDBJ/length<=1000) ";
-        queryPath += "AND (/ENTRY/DDBJ/feature-table/feature{/f_key = 'CDS' AND ";
-        queryPath += "/f_quals/qualifier{/q_name = 'gene' AND /q_value=='" + geneName + "'}})";
-        String query = "service=ARSA&method=searchByXMLPath&queryPath=" + queryPath
-                + "&returnPath=/ENTRY/DDBJ/primary-accession&offset=1&count=100";
-        //Execute ARSA
-        String arsaResult = null;
-        try {
-            arsaResult = RestUtil.getResult( query );
-        }
-        catch ( final IOException e ) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        final String[] arsaResultLines = arsaResult.split( "\n" );
-        //Get hit count
-        final int arsaResultNum = Integer.parseInt( arsaResultLines[ 0 ].replaceAll( "hitscount       =", "" ).trim() );
-        //If there is no hit, print a message and exit
-        if ( arsaResultNum == 0 ) {
-            System.out.println( "There is no entry for gene:" + geneName );
-            return;
-        }
-        //Retrieve DNA sequence of top hit entry by using getFASTA_DDBJEntry of GetEntry.
-        //Retrieve DNA sequence of first fit.
-        final String repAccession = arsaResultLines[ 2 ];
-        query = "service=GetEntry&method=getFASTA_DDBJEntry&accession=" + repAccession;
-        String dnaSeq = null;
-        try {
-            dnaSeq = RestUtil.getResult( query );
-        }
-        catch ( final IOException e ) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        System.out.println( "Retrieved DNA sequence is: " + dnaSeq );
-        //Execute blastn by using searchParam of Blast with step2's sequence. Specified option is -e 0.0001 -m 8 -b 50 -v 50. It means "Extract top 50 hit which E-value is more than 0.0001.". The reference databases are specified as follows. ddbjpri(primates) ddbjrod(rodents) ddbjmam(mammals) ddbjvrt(vertebrates ) ddbjinv(invertebrates).
-        //Execute blastn with step3's sequence
-        query = "service=Blast&method=searchParam&program=blastn&database=ddbjpri ddbjrod ddbjmam ddbjvrt "
-                + "ddbjinv&query=" + dnaSeq + "&param=-m 8 -b 50 -v 50 -e 0.0001";
-        String blastResult = null;
-        try {
-            blastResult = RestUtil.getResult( query );
-        }
-        catch ( final IOException e ) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        // Extract both accession number and similarity score from BLAST result.
-        // This step does not use Web API and extract the part of result or edit the result. Please click here to see the details of each column in the BLAST tab delimited format which is generated by -m 8 option.
-        final String blastResultLines[] = blastResult.split( "\n" );
-        final Vector<String[]> parsedBlastResult = new Vector<String[]>();
-        for( final String blastResultLine : blastResultLines ) {
-            final String cols[] = blastResultLine.split( "\t" );
-            final String accession = cols[ 1 ].substring( 0, cols[ 1 ].indexOf( "|" ) );
-            final String[] result = { accession, cols[ 2 ] };
-            parsedBlastResult.add( result );
-        }
-        // Retrieve species name by using searchByXMLPath of ARSA. If the plural subjects whose species
-        // name are same are in the result, the highest similarity score is used.
-        //Retrieve species from accession number.
-        final Hashtable<String, String> organismAccession = new Hashtable<String, String>();
-        for( int i = 0; i < parsedBlastResult.size(); i++ ) {
-            final String[] parsed = parsedBlastResult.elementAt( i );
-            query = "service=ARSA&method=searchByXMLPath&queryPath=/ENTRY/DDBJ/primary-accession=='" + parsed[ 0 ]
-                    + "'&returnPath=/ENTRY/DDBJ/organism&offset=1&count=100";
-            String organism = null;
-            try {
-                organism = RestUtil.getResult( query );
-            }
-            catch ( final IOException e ) {
-                // TODO Auto-generated catch block
-                e.printStackTrace();
-            }
-            final String[] organismLines = organism.split( "\n" );
-            organism = organismLines[ 2 ];
-            //If same organism name hits, use first hit.
-            if ( !organismAccession.containsKey( organism ) ) {
-                organismAccession.put( organism, parsed[ 0 ] + "\t" + parsed[ 1 ] );
-            }
-        }
-        // Print result.
-        // Print Result
-        System.out.println( "DDBJ entries: " + arsaResultNum );
-        System.out.println( "Representative accession: " + repAccession );
-        System.out.println( "Organism name\tDDBJ accession number\tSequence similarity" );
-        final String[] keys = new String[ organismAccession.size() ];
-        final Enumeration<String> enu = organismAccession.keys();
-        int count = 0;
-        while ( enu.hasMoreElements() ) {
-            keys[ count ] = enu.nextElement();
-            ++count;
-        }
-        Arrays.sort( keys );
-        for( final String key : keys ) {
-            System.out.println( key + "\t" + organismAccession.get( key ) );
-        }
-    }
 }
index 997e52a..dba82fd 100644 (file)
@@ -125,10 +125,7 @@ import org.forester.util.SequenceAccessionTools;
 import org.forester.ws.seqdb.SequenceDatabaseEntry;
 import org.forester.ws.seqdb.SequenceDbWsTools;
 import org.forester.ws.seqdb.UniProtTaxonomy;
-import org.forester.ws.wabi.TxSearch;
-import org.forester.ws.wabi.TxSearch.RANKS;
-import org.forester.ws.wabi.TxSearch.TAX_NAME_CLASS;
-import org.forester.ws.wabi.TxSearch.TAX_RANK;
+
 
 @SuppressWarnings( "unused")
 public final class Test {
@@ -12917,60 +12914,4 @@ public final class Test {
         }
         return true;
     }
-
-    private static boolean testWabiTxSearch() {
-        try {
-            String result = "";
-            result = TxSearch.searchSimple( "nematostella" );
-            result = TxSearch.getTxId( "nematostella" );
-            if ( !result.equals( "45350" ) ) {
-                return false;
-            }
-            result = TxSearch.getTxName( "45350" );
-            if ( !result.equals( "Nematostella" ) ) {
-                return false;
-            }
-            result = TxSearch.getTxId( "nematostella vectensis" );
-            if ( !result.equals( "45351" ) ) {
-                return false;
-            }
-            result = TxSearch.getTxName( "45351" );
-            if ( !result.equals( "Nematostella vectensis" ) ) {
-                return false;
-            }
-            result = TxSearch.getTxId( "Bacillus subtilis subsp. subtilis str. N170" );
-            if ( !result.equals( "536089" ) ) {
-                return false;
-            }
-            result = TxSearch.getTxName( "536089" );
-            if ( !result.equals( "Bacillus subtilis subsp. subtilis str. N170" ) ) {
-                return false;
-            }
-            final List<String> queries = new ArrayList<String>();
-            queries.add( "Campylobacter coli" );
-            queries.add( "Escherichia coli" );
-            queries.add( "Arabidopsis" );
-            queries.add( "Trichoplax" );
-            queries.add( "Samanea saman" );
-            queries.add( "Kluyveromyces marxianus" );
-            queries.add( "Bacillus subtilis subsp. subtilis str. N170" );
-            queries.add( "Bornavirus parrot/PDD/2008" );
-            final List<RANKS> ranks = new ArrayList<RANKS>();
-            ranks.add( RANKS.SUPERKINGDOM );
-            ranks.add( RANKS.KINGDOM );
-            ranks.add( RANKS.FAMILY );
-            ranks.add( RANKS.GENUS );
-            ranks.add( RANKS.TRIBE );
-            result = TxSearch.searchLineage( queries, ranks );
-            result = TxSearch.searchParam( "Homo sapiens", TAX_NAME_CLASS.ALL, TAX_RANK.SPECIES, 10, true );
-            result = TxSearch.searchParam( "Samanea saman", TAX_NAME_CLASS.SCIENTIFIC_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final Exception e ) {
-            System.out.println();
-            System.out.println( "the following might be due to absence internet connection:" );
-            e.printStackTrace( System.out );
-            return false;
-        }
-        return true;
-    }
 }
diff --git a/forester/java/src/org/forester/ws/wabi/RestUtil.java b/forester/java/src/org/forester/ws/wabi/RestUtil.java
deleted file mode 100644 (file)
index 2050c0e..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-// $Id:
-// forester -- software libraries and applications
-// for genomics and evolutionary biology research.
-//
-// Copyright (C) 2010 Christian M Zmasek
-// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
-// All rights reserved
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-//
-// Contact: phylosoft @ gmail . com
-// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
-
-package org.forester.ws.wabi;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.PrintStream;
-import java.io.UnsupportedEncodingException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLEncoder;
-import java.util.List;
-
-/**
- *
- * This is to access the Web API for Biology (WABI) at DDBJ.
- * See: http://xml.nig.ac.jp/
- *
- */
-public final class RestUtil {
-
-    final static String         LIST_SEPARATOR = "%0A";
-    final static String         LINE_SEPARATOR = "\n";
-    private final static String BASE_URL       = "http://xml.nig.ac.jp/rest/Invoke";
-    private final static String SERVICE        = "service";
-    private final static String METHOD         = "method";
-    private final static String URL_ENC        = "UTF-8";
-
-    static String encode( final String str ) throws UnsupportedEncodingException {
-        return URLEncoder.encode( str.trim(), URL_ENC );
-    }
-
-    /**
-     * Method for access REST
-     * @param query
-     * service name method name and parameter for executing rest
-     * @return execution result
-     * @throws IOException
-     */
-    public static String getResult( final String query ) throws IOException {
-        final URL url = new URL( BASE_URL );
-        final URLConnection urlc = url.openConnection();
-        urlc.setDoOutput( true );
-        urlc.setAllowUserInteraction( false );
-        final PrintStream ps = new PrintStream( urlc.getOutputStream() );
-        //System.out.println( "query: " + query );
-        ps.print( query.trim() );
-        ps.close();
-        final BufferedReader br = new BufferedReader( new InputStreamReader( urlc.getInputStream() ) );
-        final StringBuffer sb = new StringBuffer();
-        String line = null;
-        while ( ( line = br.readLine() ) != null ) {
-            sb.append( line + LINE_SEPARATOR );
-        }
-        br.close();
-        return sb.toString().trim();
-    }
-
-    public static String getResult( final String service_name, final String method_name, final String parameters )
-            throws IOException {
-        final String service = SERVICE + '=' + encode( service_name );
-        final String method = METHOD + '=' + encode( method_name );
-        return getResult( service + '&' + method + '&' + parameters.trim() );
-    }
-
-    static String listAsString( final List<String> l ) throws UnsupportedEncodingException {
-        final StringBuffer sb = new StringBuffer();
-        for( final String s : l ) {
-            if ( sb.length() > 0 ) {
-                sb.append( LIST_SEPARATOR );
-            }
-            sb.append( encode( s ) );
-        }
-        return sb.toString();
-    }
-}
diff --git a/forester/java/src/org/forester/ws/wabi/TxSearch.java b/forester/java/src/org/forester/ws/wabi/TxSearch.java
deleted file mode 100644 (file)
index e96e592..0000000
+++ /dev/null
@@ -1,369 +0,0 @@
-// $Id:
-// forester -- software libraries and applications
-// for genomics and evolutionary biology research.
-//
-// Copyright (C) 2010 Christian M Zmasek
-// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
-// All rights reserved
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-//
-// Contact: phylosoft @ gmail . com
-// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
-
-package org.forester.ws.wabi;
-
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
- *
- * This is to access the Web API for Biology (WABI) at DDBJ.
- * See: http://xml.nig.ac.jp/
- *
- * Service Description:
- * TXSearch is a retrieval system for a Taxonomy Database which
- * was unified by DDBJ, GenBank and EMBL, which is developed by DDBJ.
- * See: http://xml.nig.ac.jp/wabi/Method?serviceName=TxSearch&mode=methodList
- *
- */
-public final class TxSearch {
-
-    private static final String TAXONOMIC_RANK                         = "Taxonomic rank: ";
-    private static final String FULL_LINEAGE                           = "Full lineage: ";
-    private static final String SEARCH_LINEAGE_QUERY_PARAM_NAME        = "query";
-    private static final String SEARCH_LINEAGE_RANKS_PARAM_NAME        = "ranks";
-    private static final String SEARCH_LINEAGE_SUPERKINGDOM_PARAM_NAME = "superkingdom";
-    private final static String GET_TX_ID_METHOD_NAME                  = "getTxId";
-    private final static String GET_TX_NAME_METHOD_NAME                = "getTxName";
-    private final static String SEARCH_SIMPLE_METHOD_NAME              = "searchSimple";
-    private final static String TX_SEARCH_SERVICE_NAME                 = "TxSearch";
-    private final static String TX_NAME_PARAM_NAME                     = "tx_Name";
-    private final static String TX_ID_PARAM_NAME                       = "tx_Id";
-    private final static String SEARCH_LINEAGE_NAME_METHOD_NAME        = "searchLineage";
-    private final static String SEARCH_PARAM_METHOD_NAME               = "searchParam";
-
-    public static String[] getLineage( final String result ) throws IOException {
-        String[] lineage = null;
-        for( String line : result.split( RestUtil.LINE_SEPARATOR ) ) {
-            line = line.trim();
-            if ( line.startsWith( FULL_LINEAGE ) ) {
-                if ( lineage != null ) {
-                    throw new IOException( "search result is not unique" );
-                }
-                lineage = line.substring( FULL_LINEAGE.length() ).split( ";" );
-            }
-        }
-        return lineage;
-    }
-
-    public static String getTaxonomicRank( final String result ) throws IOException {
-        String rank = null;
-        for( String line : result.split( RestUtil.LINE_SEPARATOR ) ) {
-            line = line.trim();
-            if ( line.startsWith( TAXONOMIC_RANK ) ) {
-                if ( rank != null ) {
-                    throw new IOException( "search result is not unique" );
-                }
-                rank = line.substring( TAXONOMIC_RANK.length() ).trim();
-            }
-        }
-        return rank;
-    }
-
-    public static String getTxId( final String tx_name ) throws IOException {
-        return RestUtil.getResult( TX_SEARCH_SERVICE_NAME,
-                                   GET_TX_ID_METHOD_NAME,
-                                   TX_NAME_PARAM_NAME + "=" + RestUtil.encode( tx_name ) ).trim();
-    }
-
-    public static String getTxName( final String tx_id ) throws IOException {
-        return RestUtil.getResult( TX_SEARCH_SERVICE_NAME,
-                                   GET_TX_NAME_METHOD_NAME,
-                                   TX_ID_PARAM_NAME + "=" + RestUtil.encode( tx_id ) ).trim();
-    }
-
-    public static void main( final String[] args ) throws IOException {
-        String result = "";
-        try {
-            result = searchSimple( "SAMSA" );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchSimple( "nematostella" );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        final String[] lineage = getLineage( result );
-        for( final String element : lineage ) {
-            System.out.println( element );
-        }
-        System.out.println( getTaxonomicRank( result ) );
-        System.out.println( "---------------" );
-        try {
-            result = getTxId( "nematostella" );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = getTxName( "45350" );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        final List<String> queries = new ArrayList<String>();
-        queries.add( "Campylobacter coli" );
-        queries.add( "Escherichia coli" );
-        queries.add( "Arabidopsis" );
-        queries.add( "Trichoplax" );
-        queries.add( "Samanea saman" );
-        queries.add( "Kluyveromyces marxianus" );
-        queries.add( "Bacillus subtilis subsp. subtilis str. N170" );
-        queries.add( "Bornavirus parrot/PDD/2008" );
-        final List<RANKS> ranks = new ArrayList<RANKS>();
-        //        ranks.add( RANKS.SUPERKINGDOM );
-        //        ranks.add( RANKS.KINGDOM );
-        //        ranks.add( RANKS.FAMILY );
-        //        ranks.add( RANKS.GENUS );
-        ranks.add( RANKS.ALL );
-        try {
-            result = searchLineage( queries, ranks );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "Homo sapiens", TAX_NAME_CLASS.ALL, TAX_RANK.SPECIES, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "Samanea saman", TAX_NAME_CLASS.SCIENTIFIC_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "cow", TAX_NAME_CLASS.COMMON_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "Helicogloea lagerheimii", TAX_NAME_CLASS.SCIENTIFIC_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "Cronartium ribicola", TAX_NAME_CLASS.SCIENTIFIC_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "Peridermium harknessii", TAX_NAME_CLASS.SCIENTIFIC_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-        System.out.println( "---------------" );
-        try {
-            result = searchParam( "Eukaryota", TAX_NAME_CLASS.SCIENTIFIC_NAME, TAX_RANK.ALL, 10, true );
-        }
-        catch ( final IOException e ) {
-            e.printStackTrace();
-        }
-        System.out.println( result );
-    }
-
-    private static String ranksAsString( final List<RANKS> l ) throws UnsupportedEncodingException {
-        final StringBuffer sb = new StringBuffer();
-        for( final RANKS r : l ) {
-            if ( sb.length() > 0 ) {
-                sb.append( RestUtil.LIST_SEPARATOR );
-            }
-            sb.append( RestUtil.encode( r.toString() ) );
-        }
-        return sb.toString();
-    }
-
-    public static String searchLineage( final List<String> queries, final List<RANKS> ranks ) throws IOException {
-        return searchLineage( queries, ranks, "" );
-    }
-
-    public static String searchLineage( final List<String> queries, final List<RANKS> ranks, final String superkingdom )
-            throws IOException {
-        return RestUtil.getResult( TX_SEARCH_SERVICE_NAME,
-                                   SEARCH_LINEAGE_NAME_METHOD_NAME,
-                                   SEARCH_LINEAGE_QUERY_PARAM_NAME + "=" + RestUtil.listAsString( queries ) + "&"
-                                           + SEARCH_LINEAGE_RANKS_PARAM_NAME + "=" + ranksAsString( ranks ) + "&"
-                                           + SEARCH_LINEAGE_SUPERKINGDOM_PARAM_NAME + "="
-                                           + RestUtil.encode( superkingdom ) ).trim();
-    }
-
-    public static String searchParam( final String tx_name,
-                                      final TAX_NAME_CLASS tx_name_class,
-                                      final TAX_RANK tx_rank,
-                                      int tx_rmax,
-                                      final boolean as_scientific_name ) throws IOException {
-        String as_scientific_name_str = "no";
-        if ( as_scientific_name ) {
-            as_scientific_name_str = "yes";
-        }
-        if ( tx_rmax < 1 ) {
-            tx_rmax = 1;
-        }
-        return RestUtil.getResult( TX_SEARCH_SERVICE_NAME,
-                                   SEARCH_PARAM_METHOD_NAME,
-                                   TX_NAME_PARAM_NAME + "=" + RestUtil.encode( tx_name ) + "&tx_Clas="
-                                           + RestUtil.encode( tx_name_class.toString() ) + "&tx_Rank="
-                                           + RestUtil.encode( tx_rank.toString() ) + "&tx_Rmax=" + tx_rmax
-                                           + "&tx_Dcls=" + as_scientific_name_str ).trim();
-    }
-
-    public static String searchSimple( final String tx_name ) throws IOException {
-        return RestUtil.getResult( TX_SEARCH_SERVICE_NAME,
-                                   SEARCH_SIMPLE_METHOD_NAME,
-                                   TX_NAME_PARAM_NAME + "=" + RestUtil.encode( tx_name ) ).trim();
-    }
-
-    public enum RANKS {
-        ALL( "all" ),
-        SUPERKINGDOM( "superkingdom" ),
-        KINGDOM( "kingdom" ),
-        SUBKINGDOM( "subkingdom" ),
-        SUPERPHYLUM( "superphylum" ),
-        PHYLUM( "phylum" ),
-        SUBPHYLUM( "subphylum" ),
-        SUPERCLASS( "superclass" ),
-        CLASS( "class" ),
-        SUBCLASS( "subclass" ),
-        INFRACLASS( "infraclass" ),
-        SUPERORDER( "superorder" ),
-        ORDER( "order" ),
-        SUBORDER( "suborder" ),
-        INFRAORDER( "infraorder" ),
-        PARVORDER( "parvorder" ),
-        SUPERFAMILY( "superfamily" ),
-        FAMILY( "family" ),
-        SUBFAMILY( "subfamily" ),
-        TRIBE( "tribe" ),
-        SUBTRIBE( "subtribe" ),
-        GENUS( "genus" ),
-        SPECIES( "species" );
-
-        private final String _str;
-
-        private RANKS( final String name ) {
-            _str = name;
-        }
-
-        @Override
-        public String toString() {
-            return _str;
-        }
-    }
-
-    public enum TAX_NAME_CLASS {
-        ALL( "all" ),
-        SCIENTIFIC_NAME( "scientific name" ),
-        PREFFERED_COMMON_NAME( "preferred common name" ),
-        COMMON_NAME( "common name" ),
-        SYNONYM( "synonym" );
-
-        private final String _str;
-
-        private TAX_NAME_CLASS( final String name ) {
-            _str = name;
-        }
-
-        @Override
-        public String toString() {
-            return _str;
-        }
-    }
-
-    public enum TAX_RANK {
-        ALL( "All" ),
-        NO_RANK( "no rank" ),
-        SUPERKINGDOM( "superkingdom" ),
-        KINGDOM( "kingdom" ),
-        SUBKINGDOM( "subkingdom" ),
-        SUPERPHYLUM( "superphylum" ),
-        PHYLUM( "phylum" ),
-        SUBPHYLUM( "subphylum" ),
-        SUPERCLASS( "superclass" ),
-        CLASS( "class" ),
-        SUBCLASS( "subclass" ),
-        INFRACLASS( "infraclass" ),
-        SUPERORDER( "superorder" ),
-        ORDER( "order" ),
-        SUBORDER( "suborder" ),
-        INFRAORDER( "infraorder" ),
-        PARVORDER( "parvorder" ),
-        SUPERFAMILY( "superfamily" ),
-        FAMILY( "family" ),
-        SUBFAMILY( "subfamily" ),
-        TRIBE( "tribe" ),
-        SUBTRIBE( "subtribe" ),
-        GENUS( "genus" ),
-        SUBGENUS( "subgenus" ),
-        SPECIES_GROUP( "species group" ),
-        SPECIES_SUBGROUP( "species subgroup" ),
-        SPECIES( "species" ),
-        SUBSPECIES( "subspecies" ),
-        VARIETAS( "varietas" ),
-        FORMA( "forma" );
-
-        private final String _str;
-
-        private TAX_RANK( final String name ) {
-            _str = name;
-        }
-
-        @Override
-        public String toString() {
-            return _str;
-        }
-    }
-}
diff --git a/forester/java/src/org/forester/ws/wabi/WabiTools.java b/forester/java/src/org/forester/ws/wabi/WabiTools.java
deleted file mode 100644 (file)
index b5a94dc..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-// $Id:
-// forester -- software libraries and applications
-// for genomics and evolutionary biology research.
-//
-// Copyright (C) 2010 Christian M Zmasek
-// Copyright (C) 2010 Sanford-Burnham Medical Research Institute
-// All rights reserved
-//
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
-//
-// Contact: phylosoft @ gmail . com
-// WWW: https://sites.google.com/site/cmzmasek/home/software/forester
-
-package org.forester.ws.wabi;
-
-import java.io.IOException;
-
-import org.forester.phylogeny.PhylogenyMethods;
-import org.forester.phylogeny.data.Taxonomy;
-import org.forester.util.ForesterUtil;
-import org.forester.ws.wabi.TxSearch.TAX_NAME_CLASS;
-import org.forester.ws.wabi.TxSearch.TAX_RANK;
-
-public final class WabiTools {
-
-    private static String getATxName( final Taxonomy tax ) throws IOException {
-        String name = null;
-        if ( !ForesterUtil.isEmpty( tax.getScientificName() ) ) {
-            name = tax.getScientificName();
-        }
-        else if ( !ForesterUtil.isEmpty( tax.getCommonName() ) ) {
-            name = tax.getCommonName();
-        }
-        if ( ForesterUtil.isEmpty( name ) ) {
-            String id_value = null;
-            if ( PhylogenyMethods.isTaxonomyHasIdentifierOfGivenProvider( tax, new String[] { "uniprot", "ncbi" } ) ) {
-                id_value = tax.getIdentifier().getValue();
-            }
-            if ( !ForesterUtil.isEmpty( id_value ) ) {
-                name = TxSearch.getTxName( id_value );
-            }
-        }
-        return name;
-    }
-
-    public static String[] obtainLineage( final Taxonomy tax ) throws IOException {
-        final String name = getATxName( tax );
-        String result = null;
-        if ( !ForesterUtil.isEmpty( name ) ) {
-            result = TxSearch.searchParam( name, TAX_NAME_CLASS.ALL, TAX_RANK.ALL, 2, true );
-        }
-        if ( !ForesterUtil.isEmpty( result ) ) {
-            final String[] lin = TxSearch.getLineage( result );
-            if ( lin != null ) {
-                final String[] lin_plus_self = new String[ lin.length + 1 ];
-                for( int i = 0; i < lin.length; ++i ) {
-                    lin_plus_self[ i ] = lin[ i ];
-                }
-                lin_plus_self[ lin.length ] = name;
-                return lin_plus_self;
-            }
-        }
-        return null;
-    }
-
-    public static String obtainRank( final Taxonomy tax ) throws IOException {
-        final String result = searchParam( tax );
-        if ( !ForesterUtil.isEmpty( result ) ) {
-            return TxSearch.getTaxonomicRank( result );
-        }
-        return null;
-    }
-
-    private static String searchParam( final Taxonomy tax ) throws IOException {
-        final String name = getATxName( tax );
-        String result = null;
-        if ( !ForesterUtil.isEmpty( name ) ) {
-            result = TxSearch.searchParam( name, TAX_NAME_CLASS.ALL, TAX_RANK.ALL, 2, true );
-        }
-        return result;
-    }
-}