X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fapplication%2Fconfadd.java;h=768489900dd37be652c3c54f9dfa78c02a0c0478;hb=876ced97014fafe54ff51dcc17da8bf25913fec7;hp=efccace737751e88eb483439acf14a08e5812928;hpb=493e40b0c936b65da342134da37e8b856b9b80af;p=jalview.git diff --git a/forester/java/src/org/forester/application/confadd.java b/forester/java/src/org/forester/application/confadd.java index efccace..7684899 100644 --- a/forester/java/src/org/forester/application/confadd.java +++ b/forester/java/src/org/forester/application/confadd.java @@ -6,7 +6,7 @@ // Copyright (C) 2008-2009 Christian M. Zmasek // Copyright (C) 2008-2009 Burnham Institute for Medical Research // 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 @@ -16,13 +16,13 @@ // 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: www.phylosoft.org/forester +// WWW: https://sites.google.com/site/cmzmasek/home/software/forester package org.forester.application; @@ -33,6 +33,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; +import org.forester.io.parsers.util.ParserUtils; import org.forester.io.writers.PhylogenyWriter; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyNode; @@ -54,11 +55,17 @@ public class confadd { final static private String PRG_NAME = "confadd"; final static private String PRG_VERSION = "1.01"; final static private String PRG_DATE = "2010.10.26"; - final static private String E_MAIL = "czmasek@burnham.org"; + final static private String E_MAIL = "phylosoft@gmail.com"; final static private String WWW = "www.phylosoft.org/forester/"; public static void main( final String args[] ) { - ForesterUtil.printProgramInformation( PRG_NAME, PRG_VERSION, PRG_DATE, E_MAIL, WWW ); + ForesterUtil.printProgramInformation( PRG_NAME, + null, + PRG_VERSION, + PRG_DATE, + E_MAIL, + WWW, + ForesterUtil.getForesterLibraryInformation() ); CommandLineArguments cla = null; try { cla = new CommandLineArguments( args ); @@ -135,8 +142,8 @@ public class confadd { } if ( ( first < 0 ) || ( last < 0 ) ) { ForesterUtil - .fatalError( PRG_NAME, - "attempt to set first or last evaluator topology to use to a number less than zero" ); + .fatalError( PRG_NAME, + "attempt to set first or last evaluator topology to use to a number less than zero" ); } if ( norm < 0 ) { ForesterUtil.fatalError( PRG_NAME, "illegal value for normalizer [" + norm + "]" ); @@ -145,11 +152,12 @@ public class confadd { Phylogeny[] evaluators = null; final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance(); try { - targets = factory.create( target_file, ForesterUtil.createParserDependingOnFileType( target_file, true ) ); + targets = factory.create( target_file, ParserUtils.createParserDependingOnFileType( target_file, true ) ); } catch ( final IOException e ) { - ForesterUtil.fatalError( PRG_NAME, "failed to read target phylogenies from [" + target_file + "]: " - + e.getLocalizedMessage() ); + ForesterUtil.fatalError( PRG_NAME, + "failed to read target phylogenies from [" + target_file + "]: " + + e.getLocalizedMessage() ); } int counter = 0; for( final Phylogeny target : targets ) { @@ -168,8 +176,8 @@ public class confadd { ForesterUtil.programMessage( PRG_NAME, "read in a total of " + targets.length + " targets" ); } try { - evaluators = factory.create( evaluators_file, ForesterUtil - .createParserDependingOnFileType( evaluators_file, true ) ); + evaluators = factory.create( evaluators_file, + ParserUtils.createParserDependingOnFileType( evaluators_file, true ) ); } catch ( final IOException e ) { ForesterUtil.fatalError( PRG_NAME, "failed to read evaluator topologies from [" + evaluators_file + "]: " @@ -192,11 +200,11 @@ public class confadd { } if ( ( last >= evaluators.length ) || ( last <= first ) ) { ForesterUtil.fatalError( PRG_NAME, "illegal value for first or last evaluator topology to use [" + first - + ", " + last + "]" ); + + ", " + last + "]" ); } double value = 1; if ( norm > 0 ) { - value = norm / ( 1 + last - first ); + value = norm / ( ( 1 + last ) - first ); } ForesterUtil.programMessage( PRG_NAME, "first topology to use: " + first ); String is_last = ""; @@ -204,7 +212,7 @@ public class confadd { is_last = " (corresponds to last topology in file)"; } ForesterUtil.programMessage( PRG_NAME, "last topology to use : " + last + is_last ); - ForesterUtil.programMessage( PRG_NAME, "sum of topologies used as evaluators: " + ( last - first + 1 ) ); + ForesterUtil.programMessage( PRG_NAME, "sum of topologies used as evaluators: " + ( ( last - first ) + 1 ) ); if ( norm > 0 ) { ForesterUtil.programMessage( PRG_NAME, "normalizer: " + norm + " (" + ForesterUtil.round( value, 6 ) + ")" ); } @@ -236,17 +244,17 @@ public class confadd { System.out.println( "Usage:" ); System.out.println(); System.out.println( PRG_NAME - + " [options] " ); + + " [options] " ); System.out.println(); System.out.println( "options:" ); System.out.println(); System.out.println( " -" + STRICT_OPTION - + " : strict [default: non-strict]: all nodes between 'target' and 'evaluators' must match" ); + + " : strict [default: non-strict]: all nodes between 'target' and 'evaluators' must match" ); System.out.println( " -" + NORMALIZE_OPTION - + "=: normalize to this value (e.g. 100 for most bootstrap analyses) [default: no normalization]" ); + + "=: normalize to this value (e.g. 100 for most bootstrap analyses) [default: no normalization]" ); System.out.println( " -" + FIRST_OPTION + "=: first evaluator topology to use (0-based) [default: 0]" ); System.out.println( " -" + LAST_OPTION - + "=: last evaluator topology to use (0-based) [default: use all until final topology]" ); + + "=: last evaluator topology to use (0-based) [default: use all until final topology]" ); System.out.println(); } @@ -257,7 +265,7 @@ public class confadd { final PhylogenyNode node = it.next(); if ( ext_nodes.contains( node ) ) { throw new IllegalArgumentException( "external node [" + node.toString() + "] of " + msg - + " is not unique" ); + + " is not unique" ); } ext_nodes.add( node ); }