cleanup
authorcmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 28 Jun 2012 03:52:29 +0000 (03:52 +0000)
committercmzmasek@gmail.com <cmzmasek@gmail.com@ca865154-3058-d1c3-3e42-d8f55a55bdbd>
Thu, 28 Jun 2012 03:52:29 +0000 (03:52 +0000)
forester/java/src/org/forester/application/gsdi.java
forester/java/src/org/forester/sdi/GSDI.java

index 4c17f0e..e63c23a 100644 (file)
@@ -62,23 +62,22 @@ public final class gsdi {
     private enum BASE_ALGORITHM {
         GSDI, SDI
     }
-    final static public boolean REPLACE_UNDERSCORES_IN_NH_SPECIES_TREE     = true;
-    final static private String ALLOW_STRIPPING_OF_GENE_TREE_OPTION        = "g";
-    final static private String SDI_OPTION                                 = "b";
-    final static private String MOST_PARSIMONIOUS_OPTION                   = "m";
-    final static private String GUESS_FORMAT_OF_SPECIES_TREE               = "q";
-    final static private String HELP_OPTION_1                              = "help";
-    final static private String HELP_OPTION_2                              = "h";
-    final static private String DEFAULT_OUTFILE_SUFFIX                     = "_gsdi_out.xml";
-    final static private String SUFFIX_FOR_LIST_OF_STIPPED_GENE_TREE_NODES = "_stripped_gene_tree_nodes.txt";
-    final static private String SUFFIX_FOR_SPECIES_TREE_USED               = "_species_tree_used.xml";
-    final static private String LOGFILE_SUFFIX                             = "_gsdi_log.txt";
-    final static private String PRG_NAME                                   = "gsdi";
-    final static private String PRG_VERSION                                = "0.901";
-    final static private String PRG_DATE                                   = "120608";
-    final static private String PRG_DESC                                   = "general speciation duplication inference";
-    final static private String E_MAIL                                     = "phylosoft@gmail.com";
-    final static private String WWW                                        = "www.phylosoft.org/forester";
+    final static public boolean REPLACE_UNDERSCORES_IN_NH_SPECIES_TREE = true;
+    final static private String ALLOW_STRIPPING_OF_GENE_TREE_OPTION    = "g";
+    final static private String SDISE_OPTION                           = "b";
+    final static private String MOST_PARSIMONIOUS_OPTION               = "m";
+    final static private String GUESS_FORMAT_OF_SPECIES_TREE           = "q";
+    final static private String HELP_OPTION_1                          = "help";
+    final static private String HELP_OPTION_2                          = "h";
+    final static private String DEFAULT_OUTFILE_SUFFIX                 = "_gsdi_out.xml";
+    final static private String SUFFIX_FOR_SPECIES_TREE_USED           = "_species_tree_used.xml";
+    final static private String LOGFILE_SUFFIX                         = "_gsdi_log.txt";
+    final static private String PRG_NAME                               = "gsdi";
+    final static private String PRG_VERSION                            = "1.000";
+    final static private String PRG_DATE                               = "120608";
+    final static private String PRG_DESC                               = "general speciation duplication inference";
+    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[] ) {
         try {
@@ -109,7 +108,7 @@ public final class gsdi {
                 System.exit( -1 );
             }
             final List<String> allowed_options = new ArrayList<String>();
-            allowed_options.add( gsdi.SDI_OPTION );
+            allowed_options.add( gsdi.SDISE_OPTION );
             allowed_options.add( gsdi.GUESS_FORMAT_OF_SPECIES_TREE );
             allowed_options.add( gsdi.MOST_PARSIMONIOUS_OPTION );
             allowed_options.add( gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION );
@@ -129,7 +128,7 @@ public final class gsdi {
         boolean most_parsimonous_duplication_model = false;
         boolean species_tree_in_phyloxml = true;
         boolean allow_stripping_of_gene_tree = false;
-        if ( cla.isOptionSet( gsdi.SDI_OPTION ) ) {
+        if ( cla.isOptionSet( gsdi.SDISE_OPTION ) ) {
             base_algorithm = BASE_ALGORITHM.SDI;
         }
         if ( cla.isOptionSet( gsdi.MOST_PARSIMONIOUS_OPTION ) ) {
@@ -459,31 +458,28 @@ public final class gsdi {
 
     private static void print_help() {
         System.out.println( "Usage: " + gsdi.PRG_NAME
-                + " [-options] <gene tree in phyloXML format> <species tree in phyloXML format> [outfile]" );
+                + " [-options] <gene tree in phyloXML format> <species tree> [outfile]" );
         System.out.println();
         System.out.println( "Options:" );
-        //    System.out.println( " -" + gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION + ": to allow stripping of gene tree nodes without a matching species in the species tree (writes list of stripped nodes to " + );
-        System.out.println( " -" + gsdi.SDI_OPTION + ": to use SDI algorithm instead of GSDI algorithm" );//TODO gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION not allowed
+        System.out.println( " -" + gsdi.ALLOW_STRIPPING_OF_GENE_TREE_OPTION
+                + ": to allow stripping of gene tree nodes without a matching species" );
         System.out.println( " -" + gsdi.MOST_PARSIMONIOUS_OPTION
                 + ": use most parimonious duplication model for GSDI: " );
         System.out.println( "     assign nodes as speciations which would otherwise be assiged" );
-        System.out.println( "     as unknown because of polytomies in the species tree" );
+        System.out.println( "     as potential duplications dueof polytomies in the species tree" );
         System.out.println( " -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE
                 + ": to allow species tree in other formats than phyloXML (i.e. Newick, NHX, Nexus)" );
-        System.out.println();
-        System.out.println( "Species tree:" );
-        System.out
-                .println( " In phyloXML format (unless option -"
-                        + gsdi.GUESS_FORMAT_OF_SPECIES_TREE
-                        + " is used, in which case the species matching between gene tree and species tree must be via scientific name), with taxonomy data in appropriate fields" );
+        System.out.println( " -" + gsdi.SDISE_OPTION
+                + ": to use SDIse algorithm instead of GSDI algorithm (for binary species trees)" );
         System.out.println();
         System.out.println( "Gene tree:" );
-        System.out.println( " In phyloXM format, with taxonomy and sequence data in appropriate fields" );
+        System.out.println( " in phyloXM format, with taxonomy and sequence data in appropriate fields" );
+        System.out.println();
+        System.out.println( "Species tree:" );
+        System.out.println( " in phyloXML format (unless option -" + gsdi.GUESS_FORMAT_OF_SPECIES_TREE + " is used)" );
         System.out.println();
-        System.out.println( "Example:" );
-        //  System.out.println( "gsdi 
-        //    System.out.println();
-        System.out.println( "Note -- GSDI algorithm is under development" );
+        System.out.println( "Example: gsdi -" + ALLOW_STRIPPING_OF_GENE_TREE_OPTION
+                + "  gene_tree.xml tree_of_life.xml out.xml" );
         System.out.println();
     }
 }
index d61f9d1..0e48d32 100644 (file)
@@ -224,7 +224,6 @@ public final class GSDI extends SDI {
         final Map<String, PhylogenyNode> species_to_node_map = new HashMap<String, PhylogenyNode>();
         final List<PhylogenyNode> species_tree_ext_nodes = new ArrayList<PhylogenyNode>();
         _tax_comp_base = determineTaxonomyComparisonBase( _gene_tree );
-        // System.out.println( "comp base is: " + tax_comp_base );
         // Stringyfied taxonomy is the key, node is the value.
         for( final PhylogenyNodeIterator iter = _species_tree.iteratorExternalForward(); iter.hasNext(); ) {
             final PhylogenyNode s = iter.next();
@@ -272,7 +271,6 @@ public final class GSDI extends SDI {
                     else {
                         g.setLink( s );
                         _mapped_species_tree_nodes.add( s );
-                        //  System.out.println( "setting link of " + g + " to " + s );
                     }
                 }
             }