X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=forester%2Fjava%2Fsrc%2Forg%2Fforester%2Fapplication%2Fcount_support.java;h=8e8526342c2d905d8376e1dcd9b32eed54fb19aa;hb=f7f0102d3e7eb2fd254f7d22d75a88495133449c;hp=e094f69ed4313b6948f5cd4fdfb8e8968a7243c5;hpb=eee996a6476a1e3d84c07f8f690dcde3ff4b2ef5;p=jalview.git diff --git a/forester/java/src/org/forester/application/count_support.java b/forester/java/src/org/forester/application/count_support.java index e094f69..8e85263 100644 --- a/forester/java/src/org/forester/application/count_support.java +++ b/forester/java/src/org/forester/application/count_support.java @@ -21,7 +21,7 @@ // 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; @@ -32,6 +32,7 @@ import java.util.Arrays; import java.util.List; import org.forester.io.parsers.PhylogenyParser; +import org.forester.io.parsers.util.ParserUtils; import org.forester.io.writers.PhylogenyWriter; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; @@ -49,20 +50,27 @@ public class count_support { final static private String PRG_NAME = "count_support"; final static private String PRG_VERSION = "1.0"; final static private String PRG_DATE = "2008.03.04"; + final static private String E_MAIL = "phylosoft@gmail.com"; + final static private String WWW = "www.phylosoft.org/forester/"; private final static boolean WRITE_EVALUATORS_AS_NHX = false; public static void main( final String args[] ) { - ForesterUtil - .printProgramInformation( count_support.PRG_NAME, count_support.PRG_VERSION, count_support.PRG_DATE ); + ForesterUtil.printProgramInformation( PRG_NAME, + null, + PRG_VERSION, + PRG_DATE, + E_MAIL, + WWW, + ForesterUtil.getForesterLibraryInformation() ); if ( ( args.length < 3 ) || ( args.length > 7 ) ) { System.out.println(); System.out.println( count_support.PRG_NAME + ": wrong number of arguments" ); System.out.println(); System.out - .println( "Usage: \"count_support [options] [outfile for evaluator phylogenies, " - + "always unstripped if -t= option is used, otherwise strippedness is dependent on -s option]\"\n" ); + .println( "Usage: \"count_support [options] [outfile for evaluator phylogenies, " + + "always unstripped if -t= option is used, otherwise strippedness is dependent on -s option]\"\n" ); System.out - .println( " Options: -s strip external nodes from evaluator phylogenies not found in phylogeny to be evaluated" ); + .println( " Options: -s strip external nodes from evaluator phylogenies not found in phylogeny to be evaluated" ); System.out.println( " : -t= threshold for similarity (0.0 to 1.0)" ); System.out.println( " : -n no branch lengths in outfile for evaluator phylogenies" ); System.out.println(); @@ -97,14 +105,14 @@ public class count_support { else { if ( !branch_lengths_in_ev_out ) { ForesterUtil.fatalError( count_support.PRG_NAME, - "Cannot use -n option if no outfile for evaluators specified" ); + "Cannot use -n option if no outfile for evaluators specified" ); } } Phylogeny p = null; Phylogeny[] ev = null; try { final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance(); - final PhylogenyParser pp = ForesterUtil.createParserDependingOnFileType( phylogeny_infile, true ); + final PhylogenyParser pp = ParserUtils.createParserDependingOnFileType( phylogeny_infile, true ); p = factory.create( phylogeny_infile, pp )[ 0 ]; } catch ( final Exception e ) { @@ -113,7 +121,7 @@ public class count_support { } try { final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance(); - final PhylogenyParser pp = ForesterUtil.createParserDependingOnFileType( evaluators_infile, true ); + final PhylogenyParser pp = ParserUtils.createParserDependingOnFileType( evaluators_infile, true ); ev = factory.create( evaluators_infile, pp ); } catch ( final Exception e ) { @@ -134,7 +142,7 @@ public class count_support { } if ( ( threshhold < 0 ) || ( threshhold > 1.0 ) ) { ForesterUtil.fatalError( count_support.PRG_NAME, - "support threshold has to be between 0.0 and 1.0 (inclusive)" ); + "support threshold has to be between 0.0 and 1.0 (inclusive)" ); } } List evaluator_phylogenies_above_threshold = null; @@ -155,7 +163,7 @@ public class count_support { if ( threshhold >= 0 ) { count_support.normalizeSupport( p, 100, evaluator_phylogenies_above_threshold.size() ); System.out.println( evaluator_phylogenies_above_threshold.size() + " out of " + ev.length - + " evaluator phylogenies are above threshold of " + threshhold ); + + " evaluator phylogenies are above threshold of " + threshhold ); } try { final PhylogenyWriter w = new PhylogenyWriter(); @@ -171,14 +179,13 @@ public class count_support { final PhylogenyWriter w = new PhylogenyWriter(); if ( evaluator_phylogenies_above_threshold != null ) { System.out.println( "Writing " + evaluator_phylogenies_above_threshold.size() - + " evaluator phylogenies above threshold of " + threshhold + " to: " + evaluators_outfile ); + + " evaluator phylogenies above threshold of " + threshhold + " to: " + evaluators_outfile ); if ( count_support.WRITE_EVALUATORS_AS_NHX ) { w.toNewHampshireX( evaluator_phylogenies_above_threshold, evaluators_outfile, ";" + ForesterUtil.getLineSeparator() ); } else { w.toNewHampshire( evaluator_phylogenies_above_threshold, - true, branch_lengths_in_ev_out, evaluators_outfile, ";" + ForesterUtil.getLineSeparator() ); @@ -192,7 +199,7 @@ public class count_support { ";" + ForesterUtil.getLineSeparator() ); } else { - w.toNewHampshire( Arrays.asList( ev ), true, branch_lengths_in_ev_out, evaluators_outfile, ";" + w.toNewHampshire( Arrays.asList( ev ), branch_lengths_in_ev_out, evaluators_outfile, ";" + ForesterUtil.getLineSeparator() ); } }