in progress
[jalview.git] / forester / java / src / org / forester / application / decorator.java
index d96d868..88296e9 100644 (file)
@@ -47,33 +47,32 @@ import org.forester.util.ForesterUtil;
 
 public final class decorator {
 
-    private static final String  SEQUENCE_NAME_FIELD                    = "s";
-    private static final String  TAXONOMY_CODE_FIELD                    = "c";
-    private static final String  TAXONOMY_SCIENTIFIC_NAME_FIELD         = "sn";
-    private static final String  DS_FILED                               = "d";
-    private static final String  SEQUENCE_ANNOTATION_DESC               = "a";
-    private static final String  NODE_NAME_FIELD                        = "n";
-    final static private String  PICKY_OPTION                           = "p";
-    final static private String  FIELD_OPTION                           = "f";
-    final static private String  TRIM_AFTER_TILDE_OPTION                = "t";
-    final static private String  MOVE_DOMAIN_NUMBER_OPTION              = "mdn";       // Hidden expert option.
-    final static private String  TREE_NAME_OPTION                       = "pn";
-    final static private String  TREE_ID_OPTION                         = "pi";
-    final static private String  TREE_DESC_OPTION                       = "pd";
-    final static private String  EXTRACT_BRACKETED_SCIENTIC_NAME_OPTION = "sn";
-    final static private String  PROCESS_NAME_INTELLIGENTLY_OPTION      = "x";
-    final static private String  PROCESS_SIMILAR_TO_OPTION              = "xs";
-    final static private String  CUT_NAME_AFTER_FIRST_SPACE_OPTION      = "c";
-    final static private String  ALLOW_REMOVAL_OF_CHARS_OPTION          = "r";
-    final static private String  ADVANCED_TABLE_OPTION                  = "table";
-    final static private String  KEY_COLUMN                             = "k";
-    final static private String  VALUE_COLUMN                           = "v";
-    final static private String  MAPPING_FILE_SEPARATOR_OPTION          = "s";
-    final static private String  MAPPING_FILE_SEPARATOR_DEFAULT         = ":";
-    final static private boolean USE_FIRST_SEPARATOR_ONLY               = true;
-    final static private String  PRG_NAME                               = "decorator";
-    final static private String  PRG_VERSION                            = "1.11";
-    final static private String  PRG_DATE                               = "2012.08.08";
+    private static final String SEQUENCE_NAME_FIELD                    = "s";
+    private static final String TAXONOMY_CODE_FIELD                    = "c";
+    private static final String TAXONOMY_SCIENTIFIC_NAME_FIELD         = "sn";
+    private static final String DS_FILED                               = "d";
+    private static final String SEQUENCE_ANNOTATION_DESC               = "a";
+    private static final String NODE_NAME_FIELD                        = "n";
+    final static private String PICKY_OPTION                           = "p";
+    final static private String FIELD_OPTION                           = "f";
+    final static private String TRIM_AFTER_TILDE_OPTION                = "t";
+    final static private String MOVE_DOMAIN_NUMBER_OPTION              = "mdn";       // Hidden expert option.
+    final static private String TREE_NAME_OPTION                       = "pn";
+    final static private String TREE_ID_OPTION                         = "pi";
+    final static private String TREE_DESC_OPTION                       = "pd";
+    final static private String EXTRACT_BRACKETED_SCIENTIC_NAME_OPTION = "sn";
+    final static private String PROCESS_NAME_INTELLIGENTLY_OPTION      = "x";
+    final static private String PROCESS_SIMILAR_TO_OPTION              = "xs";
+    final static private String CUT_NAME_AFTER_FIRST_SPACE_OPTION      = "c";
+    final static private String ALLOW_REMOVAL_OF_CHARS_OPTION          = "r";
+    final static private String ADVANCED_TABLE_OPTION                  = "table";
+    final static private String KEY_COLUMN                             = "k";
+    final static private String VALUE_COLUMN                           = "v";
+    final static private String MAPPING_FILE_SEPARATOR_OPTION          = "s";
+    final static private String MAPPING_FILE_SEPARATOR_DEFAULT         = ": ";
+    final static private String PRG_NAME                               = "decorator";
+    final static private String PRG_VERSION                            = "1.11";
+    final static private String PRG_DATE                               = "2012.09.15";
 
     private static void argumentsError() {
         System.out.println();
@@ -85,7 +84,7 @@ public final class decorator {
         System.out.println( " -" + ADVANCED_TABLE_OPTION + " : table instead of one to one map (-f=<c>)" );
         System.out.println( " -r=<n> : allow to remove up to n characters from the end of the names" );
         System.out.println( "          in phylogenies infile if not found (in map) otherwise" );
-        System.out.println( " -p     : for picky, fails if node name not found in mapping table, default is off" );
+        System.out.println( " -p     : picky, fails if node name not found in mapping table" );
         System.out.println( " -" + TREE_NAME_OPTION + "=<s>: name for the phylogeny" );
         System.out.println( " -" + TREE_ID_OPTION + "=<s>: identifier for the phylogeny (in the form provider:value)" );
         System.out.println( " -" + TREE_DESC_OPTION + "=<s>: description for phylogenies" );
@@ -113,7 +112,8 @@ public final class decorator {
         System.out.println( " -" + decorator.PROCESS_SIMILAR_TO_OPTION
                 + "    : process name \"intelligently\" and process information after \"similar to\" (only for -f=n)" );
         System.out.println( " -c     : cut name after first space (only for -f=n)" );
-        System.out.println( " -" + decorator.TRIM_AFTER_TILDE_OPTION + "    : trim after tilde" );
+        System.out.println( " -" + decorator.TRIM_AFTER_TILDE_OPTION
+                + "     : trim node name to be replaced after tilde" );
         System.out.println();
         System.exit( -1 );
     }
@@ -313,7 +313,7 @@ public final class decorator {
         if ( !advanced_table ) {
             BasicTable<String> mapping_table = null;
             try {
-                mapping_table = BasicTableParser.parse( mapping_infile, separator, decorator.USE_FIRST_SEPARATOR_ONLY );
+                mapping_table = BasicTableParser.parse( mapping_infile, separator, false, true );
             }
             catch ( final Exception e ) {
                 ForesterUtil.fatalError( decorator.PRG_NAME,