From: cmzmasek@gmail.com Date: Wed, 27 Jun 2012 16:53:13 +0000 (+0000) Subject: cleanup X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=ecfa899d355303acc65e93601e00922aad822883;p=jalview.git cleanup --- diff --git a/forester/java/src/org/forester/application/gsdi.java b/forester/java/src/org/forester/application/gsdi.java index 4c5d0cd..daf269d 100644 --- a/forester/java/src/org/forester/application/gsdi.java +++ b/forester/java/src/org/forester/application/gsdi.java @@ -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() ); diff --git a/forester/java/src/org/forester/application/rio.java b/forester/java/src/org/forester/application/rio.java index 0ec8855..789a412 100644 --- a/forester/java/src/org/forester/application/rio.java +++ b/forester/java/src/org/forester/application/rio.java @@ -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. diff --git a/forester/java/src/org/forester/application/sdi_dir.java b/forester/java/src/org/forester/application/sdi_dir.java index b76d080..f23a683 100644 --- a/forester/java/src/org/forester/application/sdi_dir.java +++ b/forester/java/src/org/forester/application/sdi_dir.java @@ -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] diff --git a/forester/java/src/org/forester/application/sdix.java b/forester/java/src/org/forester/application/sdix.java index 88ee713..9375b2d 100644 --- a/forester/java/src/org/forester/application/sdix.java +++ b/forester/java/src/org/forester/application/sdix.java @@ -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; diff --git a/forester/java/src/org/forester/phylogeny/PhylogenyNode.java b/forester/java/src/org/forester/phylogeny/PhylogenyNode.java index ba357c7..45c1ada 100644 --- a/forester/java/src/org/forester/phylogeny/PhylogenyNode.java +++ b/forester/java/src/org/forester/phylogeny/PhylogenyNode.java @@ -501,11 +501,9 @@ public final class PhylogenyNode implements PhylogenyNodeI, Comparable getAllDescendants() { - return _descendants; } - - + final public int getNumberOfDescendants() { if ( _descendants == null ) { return 0; diff --git a/forester/java/src/org/forester/sdi/GSDI.java b/forester/java/src/org/forester/sdi/GSDI.java index a10a085..9223f22 100644 --- a/forester/java/src/org/forester/sdi/GSDI.java +++ b/forester/java/src/org/forester/sdi/GSDI.java @@ -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 species_to_node_map = new HashMap(); final List species_tree_ext_nodes = new ArrayList(); 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" ); } } diff --git a/forester/java/src/org/forester/sdi/RIO.java b/forester/java/src/org/forester/sdi/RIO.java index 4db4648..028881c 100644 --- a/forester/java/src/org/forester/sdi/RIO.java +++ b/forester/java/src/org/forester/sdi/RIO.java @@ -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 nodes = null; final SDIR sdiunrooted = new SDIR(); diff --git a/forester/java/src/org/forester/sdi/RIOn.java b/forester/java/src/org/forester/sdi/RIOn.java index 679c2d6..932030a 100644 --- a/forester/java/src/org/forester/sdi/RIOn.java +++ b/forester/java/src/org/forester/sdi/RIOn.java @@ -45,7 +45,7 @@ public class RIOn { GeneralTable _super_orthologs = null; GeneralTable _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, diff --git a/forester/java/src/org/forester/sdi/SDI.java b/forester/java/src/org/forester/sdi/SDI.java index dec3c0f..d7bf01b 100644 --- a/forester/java/src/org/forester/sdi/SDI.java +++ b/forester/java/src/org/forester/sdi/SDI.java @@ -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 speciestree_ext_nodes = new HashMap(); final TaxonomyComparisonBase tax_comp_base = determineTaxonomyComparisonBase(); // Put references to all external nodes of the species tree into a map. diff --git a/forester/java/src/org/forester/sdi/SdiException.java b/forester/java/src/org/forester/sdi/SDIException.java similarity index 59% rename from forester/java/src/org/forester/sdi/SdiException.java rename to forester/java/src/org/forester/sdi/SDIException.java index 31daef4..a5b38f8 100644 --- a/forester/java/src/org/forester/sdi/SdiException.java +++ b/forester/java/src/org/forester/sdi/SDIException.java @@ -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 ); } } diff --git a/forester/java/src/org/forester/sdi/SDIR.java b/forester/java/src/org/forester/sdi/SDIR.java index 2b72221..c9224da 100644 --- a/forester/java/src/org/forester/sdi/SDIR.java +++ b/forester/java/src/org/forester/sdi/SDIR.java @@ -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 trees = new ArrayList(); diff --git a/forester/java/src/org/forester/sdi/SDIse.java b/forester/java/src/org/forester/sdi/SDIse.java index 094916e..7efd6a7 100644 --- a/forester/java/src/org/forester/sdi/SDIse.java +++ b/forester/java/src/org/forester/sdi/SDIse.java @@ -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(); diff --git a/forester/java/src/org/forester/sdi/SDIx.java b/forester/java/src/org/forester/sdi/SDIx.java index 087c032..4667f72 100644 --- a/forester/java/src/org/forester/sdi/SDIx.java +++ b/forester/java/src/org/forester/sdi/SDIx.java @@ -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 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 ) { diff --git a/forester/java/src/org/forester/sdi/TestGSDI.java b/forester/java/src/org/forester/sdi/TestGSDI.java index b26e800..32a725b 100644 --- a/forester/java/src/org/forester/sdi/TestGSDI.java +++ b/forester/java/src/org/forester/sdi/TestGSDI.java @@ -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 { diff --git a/forester/java/src/org/forester/test/Test.java b/forester/java/src/org/forester/test/Test.java index 1be0143..db5e28d 100644 --- a/forester/java/src/org/forester/test/Test.java +++ b/forester/java/src/org/forester/test/Test.java @@ -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 results = SequenceDbWsTools.getTaxonomiesFromCommonNameStrict( "starlet sea anemone", diff --git a/forester/java/src/org/forester/ws/seqdb/SequenceDbWsTools.java b/forester/java/src/org/forester/ws/seqdb/SequenceDbWsTools.java index 7ebf256..b56a633 100644 --- a/forester/java/src/org/forester/ws/seqdb/SequenceDbWsTools.java +++ b/forester/java/src/org/forester/ws/seqdb/SequenceDbWsTools.java @@ -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;