cleanup
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 27 Jun 2012 16:53:13 +0000 (16:53 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Wed, 27 Jun 2012 16:53:13 +0000 (16:53 +0000)
16 files changed:
forester/java/src/org/forester/application/gsdi.java
forester/java/src/org/forester/application/rio.java
forester/java/src/org/forester/application/sdi_dir.java
forester/java/src/org/forester/application/sdix.java
forester/java/src/org/forester/phylogeny/PhylogenyNode.java
forester/java/src/org/forester/sdi/GSDI.java
forester/java/src/org/forester/sdi/RIO.java
forester/java/src/org/forester/sdi/RIOn.java
forester/java/src/org/forester/sdi/SDI.java
forester/java/src/org/forester/sdi/SDIException.java [moved from forester/java/src/org/forester/sdi/SdiException.java with 59% similarity]
forester/java/src/org/forester/sdi/SDIR.java
forester/java/src/org/forester/sdi/SDIse.java
forester/java/src/org/forester/sdi/SDIx.java
forester/java/src/org/forester/sdi/TestGSDI.java
forester/java/src/org/forester/test/Test.java
forester/java/src/org/forester/ws/seqdb/SequenceDbWsTools.java

index 4c5d0cd..daf269d 100644 (file)
@@ -46,8 +46,8 @@ import org.forester.phylogeny.factories.PhylogenyFactory;
 import org.forester.sdi.GSDI;
 import org.forester.sdi.SDI;
 import org.forester.sdi.SDI.TaxonomyComparisonBase;
+import org.forester.sdi.SDIException;
 import org.forester.sdi.SDIse;
-import org.forester.sdi.SdiException;
 import org.forester.util.CommandLineArguments;
 import org.forester.util.EasyWriter;
 import org.forester.util.ForesterConstants;
@@ -312,7 +312,7 @@ public final class gsdi {
                 sdi = new SDIse( gene_tree, species_tree );
             }
         }
-        catch ( final SdiException e ) {
+        catch ( final SDIException e ) {
             log_writer.println( "User Error: " + e.getLocalizedMessage() );
             log_writer.close();
             ForesterUtil.fatalError( PRG_NAME, e.getLocalizedMessage() );
index 0ec8855..789a412 100644 (file)
@@ -44,8 +44,8 @@ import org.forester.phylogeny.factories.PhylogenyFactory;
 import org.forester.phylogeny.iterators.PreorderTreeIterator;
 import org.forester.sdi.DistanceCalculator;
 import org.forester.sdi.RIO;
+import org.forester.sdi.SDIException;
 import org.forester.sdi.SDIR;
-import org.forester.sdi.SdiException;
 import org.forester.util.ForesterUtil;
 
 public class rio {
@@ -146,7 +146,7 @@ public class rio {
                                                     final int warn_no_orthos,
                                                     final double warn_one_ortho,
                                                     final int bootstraps,
-                                                    final double t_orthologs_dc ) throws IOException, SdiException {
+                                                    final double t_orthologs_dc ) throws IOException, SDIException {
         Phylogeny consensus_tree = null;
         Phylogeny
         // to be a consensus tree.
index b76d080..f23a683 100644 (file)
@@ -39,9 +39,9 @@ import org.forester.phylogeny.Phylogeny;
 import org.forester.phylogeny.PhylogenyMethods;
 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
 import org.forester.phylogeny.factories.PhylogenyFactory;
+import org.forester.sdi.SDIException;
 import org.forester.sdi.SDIR;
 import org.forester.sdi.SDIse;
-import org.forester.sdi.SdiException;
 import org.forester.util.ForesterUtil;
 
 /*
@@ -145,7 +145,7 @@ public class sdi_dir {
      *            set to true, then out of the resulting trees with minimal
      *            mapping cost or minimal number of duplications the tree with
      *            the minimal height is chosen
-     * @throws SdiException 
+     * @throws SDIException 
      */
     public static void infer( final File indir,
                               final File species_tree_file,
@@ -155,7 +155,7 @@ public class sdi_dir {
                               final boolean write_trees,
                               final boolean minimize_mapping_cost,
                               boolean minimize_sum_of_dup,
-                              final boolean minimize_height ) throws IOException, SdiException {
+                              final boolean minimize_height ) throws IOException, SDIException {
         final int MIN_EXT_NODES = 4; // Minimal size of trees [in ext nodes]
         // to be analyzed.
         final int MAX_EXT_NODES = 5000; // Maximal size of trees [in ext nodes]
index 88ee713..9375b2d 100644 (file)
@@ -36,8 +36,8 @@ import org.forester.io.parsers.phyloxml.PhyloXmlParser;
 import org.forester.phylogeny.Phylogeny;
 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
 import org.forester.phylogeny.factories.PhylogenyFactory;
+import org.forester.sdi.SDIException;
 import org.forester.sdi.SDIx;
-import org.forester.sdi.SdiException;
 import org.forester.util.CommandLineArguments;
 import org.forester.util.ForesterUtil;
 
@@ -49,7 +49,7 @@ public class sdix {
     final static private String PRG_VERSION   = "0.001 alpha";
     final static private String PRG_DATE      = "2009.10.14";
 
-    public static void main( final String args[] ) throws SdiException {
+    public static void main( final String args[] ) throws SDIException {
         ForesterUtil.printProgramInformation( PRG_NAME, PRG_VERSION, PRG_DATE );
         System.out.println();
         CommandLineArguments cla = null;
index ba357c7..45c1ada 100644 (file)
@@ -501,11 +501,9 @@ public final class PhylogenyNode implements PhylogenyNodeI, Comparable<Phylogeny
     }
 
     final public List<PhylogenyNode> getAllDescendants() {
-       
         return _descendants;
     }
-    
-    
+
     final public int getNumberOfDescendants() {
         if ( _descendants == null ) {
             return 0;
index a10a085..9223f22 100644 (file)
@@ -76,7 +76,7 @@ public final class GSDI extends SDI {
                  final Phylogeny species_tree,
                  final boolean most_parsimonious_duplication_model,
                  final boolean strip_gene_tree,
-                 final boolean strip_species_tree ) throws SdiException {
+                 final boolean strip_species_tree ) throws SDIException {
         super( gene_tree, species_tree );
         _speciation_or_duplication_events_sum = 0;
         _speciations_sum = 0;
@@ -93,7 +93,7 @@ public final class GSDI extends SDI {
     }
 
     GSDI( final Phylogeny gene_tree, final Phylogeny species_tree, final boolean most_parsimonious_duplication_model )
-            throws SdiException {
+            throws SDIException {
         this( gene_tree, species_tree, most_parsimonious_duplication_model, false, false );
     }
 
@@ -210,11 +210,11 @@ public final class GSDI extends SDI {
     /**
      * This allows for linking of internal nodes of the species tree (as opposed
      * to just external nodes, as in the method it overrides.
-     * @throws SdiException 
+     * @throws SDIException 
      * 
      */
     @Override
-    final void linkNodesOfG() throws SdiException {
+    final void linkNodesOfG() throws SDIException {
         final Map<String, PhylogenyNode> species_to_node_map = new HashMap<String, PhylogenyNode>();
         final List<PhylogenyNode> species_tree_ext_nodes = new ArrayList<PhylogenyNode>();
         final TaxonomyComparisonBase tax_comp_base = determineTaxonomyComparisonBase( _gene_tree );
@@ -226,7 +226,7 @@ public final class GSDI extends SDI {
             final String tax_str = taxonomyToString( s, tax_comp_base );
             if ( !ForesterUtil.isEmpty( tax_str ) ) {
                 if ( species_to_node_map.containsKey( tax_str ) ) {
-                    throw new SdiException( "taxonomy \"" + s + "\" is not unique in species tree" );
+                    throw new SDIException( "taxonomy \"" + s + "\" is not unique in species tree" );
                 }
                 species_to_node_map.put( tax_str, s );
             }
@@ -239,7 +239,7 @@ public final class GSDI extends SDI {
                     _stripped_gene_tree_nodes.add( g );
                 }
                 else {
-                    throw new SdiException( "gene tree node \"" + g + "\" has no taxonomic data" );
+                    throw new SDIException( "gene tree node \"" + g + "\" has no taxonomic data" );
                 }
             }
             else {
@@ -249,7 +249,7 @@ public final class GSDI extends SDI {
                         _stripped_gene_tree_nodes.add( g );
                     }
                     else {
-                        throw new SdiException( "gene tree node \"" + g + "\" has no appropriate taxonomic data" );
+                        throw new SDIException( "gene tree node \"" + g + "\" has no appropriate taxonomic data" );
                     }
                 }
                 else {
@@ -259,7 +259,7 @@ public final class GSDI extends SDI {
                             _stripped_gene_tree_nodes.add( g );
                         }
                         else {
-                            throw new SdiException( "taxonomy \"" + g.getNodeData().getTaxonomy()
+                            throw new SDIException( "taxonomy \"" + g.getNodeData().getTaxonomy()
                                     + "\" not present in species tree" );
                         }
                     }
index 4db4648..028881c 100644 (file)
@@ -231,10 +231,10 @@ public final class RIO {
      * @param query
      *            the sequence name of the squence whose orthologs are to be
      *            inferred
-     * @throws SdiException 
+     * @throws SDIException 
      */
     public void inferOrthologs( final File gene_trees_file, final Phylogeny species_tree, final String query )
-            throws IOException, SdiException {
+            throws IOException, SDIException {
         int bs = 0;
         if ( RIO.TIME ) {
             _time = System.currentTimeMillis();
@@ -283,7 +283,7 @@ public final class RIO {
     // Helper method which performs the actual ortholog inference for
     // the external node with seqname query.
     private void inferOrthologsHelper( final Phylogeny gene_tree, final Phylogeny species_tree, final String query )
-            throws SdiException {
+            throws SDIException {
         Phylogeny assigned_tree = null;
         List<PhylogenyNode> nodes = null;
         final SDIR sdiunrooted = new SDIR();
index 679c2d6..932030a 100644 (file)
@@ -45,7 +45,7 @@ public class RIOn {
     GeneralTable<String, Integer> _super_orthologs                = null;
     GeneralTable<String, Integer> _ultra_paralogs                 = null;
 
-    private void doInferOrthologs( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SdiException {
+    private void doInferOrthologs( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SDIException {
         final SDIR sdiunrooted = new SDIR();
         final Phylogeny assigned_tree = sdiunrooted.infer( gene_tree,
                                                            species_tree,
index dec3c0f..d7bf01b 100644 (file)
@@ -214,9 +214,9 @@ public abstract class SDI {
      * links (sets the field "link" of PhylogenyNode) each external
      * PhylogenyNode of gene_tree to the external PhylogenyNode of species_tree
      * which has the same species name.
-     * @throws SdiException 
+     * @throws SDIException 
      */
-    void linkNodesOfG() throws SdiException {
+    void linkNodesOfG() throws SDIException {
         final Map<String, PhylogenyNode> speciestree_ext_nodes = new HashMap<String, PhylogenyNode>();
         final TaxonomyComparisonBase tax_comp_base = determineTaxonomyComparisonBase();
         // Put references to all external nodes of the species tree into a map.
@@ -1,18 +1,18 @@
 
 package org.forester.sdi;
 
-public class SdiException extends Exception {
+public class SDIException extends Exception {
 
     /**
      * 
      */
     private static final long serialVersionUID = 5154733429066500435L;
 
-    public SdiException() {
+    public SDIException() {
         super();
     }
 
-    public SdiException( final String message ) {
+    public SDIException( final String message ) {
         super( message );
     }
 }
index 2b72221..c9224da 100644 (file)
@@ -212,7 +212,7 @@ public class SDIR {
      *            Array) must be no lower than 1
      * @return array of rooted Trees with duplication vs. speciation assigned if
      *         return_trees is set to true, null otherwise
-     * @throws SdiException 
+     * @throws SDIException 
      */
     public Phylogeny[] infer( final Phylogeny gene_tree,
                               final Phylogeny species_tree,
@@ -220,7 +220,7 @@ public class SDIR {
                               boolean minimize_sum_of_dup,
                               final boolean minimize_height,
                               final boolean return_trees,
-                              int max_trees_to_return ) throws SdiException {
+                              int max_trees_to_return ) throws SDIException {
         init();
         SDIse sdise = null;
         final ArrayList<Phylogeny> trees = new ArrayList<Phylogeny>();
index 094916e..7efd6a7 100644 (file)
@@ -79,9 +79,9 @@ public class SDIse extends SDI {
      *            reference to a rooted binary species Phylogeny which might get
      *            stripped in the process, must have species names in the
      *            species name fields for all external nodes
-     * @throws SdiException 
+     * @throws SDIException 
      */
-    public SDIse( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SdiException {
+    public SDIse( final Phylogeny gene_tree, final Phylogeny species_tree ) throws SDIException {
         super( gene_tree, species_tree );
         _duplications_sum = 0;
         getSpeciesTree().preOrderReId();
index 087c032..4667f72 100644 (file)
@@ -51,7 +51,7 @@ public class SDIx {
     private void analyze( final Phylogeny gene_tree,
                           final String gene_tree_file_name,
                           final Phylogeny[] species_trees,
-                          final File out_dir ) throws IOException, SdiException {
+                          final File out_dir ) throws IOException, SDIException {
         final boolean minimize_cost = true;
         final boolean minimize_sum_of_dup = true;
         final boolean minimize_height = true;
@@ -101,7 +101,7 @@ public class SDIx {
     }
 
     public void method1( final List<File> gene_tree_files, final Phylogeny[] species_trees, final File out_dir )
-            throws IOException, SdiException {
+            throws IOException, SDIException {
         checkSpeciesTreesForEqualNumberOfExtNodes( species_trees );
         final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
         for( final File gene_tree_file : gene_tree_files ) {
index b26e800..32a725b 100644 (file)
@@ -36,8 +36,6 @@ import org.forester.phylogeny.data.Event;
 import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;
 import org.forester.phylogeny.factories.PhylogenyFactory;
 
-import com.itextpdf.text.pdf.ArabicLigaturizer;
-
 public final class TestGSDI {
 
     private final static Phylogeny createPhylogeny( final String nhx ) throws IOException {
index 1be0143..db5e28d 100644 (file)
@@ -495,7 +495,6 @@ public final class Test {
             System.out.println( "failed." );
             failed++;
         }
-       
         System.out.print( "SDIunrooted: " );
         if ( Test.testSDIunrooted() ) {
             System.out.println( "OK." );
@@ -7488,8 +7487,6 @@ public final class Test {
         return true;
     }
 
-   
-
     private static boolean testUniprotTaxonomySearch() {
         try {
             List<UniProtTaxonomy> results = SequenceDbWsTools.getTaxonomiesFromCommonNameStrict( "starlet sea anemone",
index 7ebf256..b56a633 100644 (file)
@@ -380,7 +380,7 @@ public final class SequenceDbWsTools {
             // To prevent accessing online dbs in too quick succession. 
             Thread.sleep( 20 );
         }
-        catch ( InterruptedException e ) {
+        catch ( final InterruptedException e ) {
             e.printStackTrace();
         }
         return result;