allow confidence values of 0.0 for domains
authorcmzmasek <cmzmasek@yahoo.com>
Thu, 14 May 2015 02:46:52 +0000 (19:46 -0700)
committercmzmasek <cmzmasek@yahoo.com>
Thu, 14 May 2015 02:46:52 +0000 (19:46 -0700)
minor bug fixes
clean up

19 files changed:
forester/.classpath
forester/.gitignore [new file with mode: 0644]
forester/.settings/org.eclipse.jdt.core.prefs
forester/.settings/org.eclipse.jdt.ui.prefs
forester/java/forester.jar
forester/java/src/org/forester/archaeopteryx/AptxUtil.java
forester/java/src/org/forester/archaeopteryx/Archaeopteryx.java
forester/java/src/org/forester/archaeopteryx/Constants.java
forester/java/src/org/forester/archaeopteryx/MainFrame.java
forester/java/src/org/forester/evoinference/TestPhylogenyReconstruction.java
forester/java/src/org/forester/io/parsers/phyloxml/data/ProteinDomainParser.java
forester/java/src/org/forester/phylogeny/data/ProteinDomain.java
forester/java/src/org/forester/test/Test.java
forester/java/src/org/forester/util/ForesterConstants.java
forester/java/src/org/forester/util/SequenceAccessionTools.java
forester/java/src/org/forester/ws/seqdb/EbiDbEntry.java
forester/java/src/org/forester/ws/seqdb/SequenceDbWsTools.java
forester/java/src/org/forester/ws/seqdb/UniProtEntry.java
forester/test_data/phyloxml_test_t1.xml

index 8f3eef3..4437209 100644 (file)
@@ -4,5 +4,6 @@
        <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
        <classpathentry kind="lib" path="java/resources/itextpdf-5.1.0.jar"/>
        <classpathentry kind="lib" path="java/resources/commons-codec-1.5.jar"/>
+       <classpathentry kind="lib" path="java/resources/openchart.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/forester/.gitignore b/forester/.gitignore
new file mode 100644 (file)
index 0000000..ae3c172
--- /dev/null
@@ -0,0 +1 @@
+/bin/
index 7d5bc6d..e21b65f 100644 (file)
@@ -1,4 +1,3 @@
-#Mon Feb 09 15:19:35 PST 2009
 eclipse.preferences.version=1
 org.eclipse.jdt.core.codeComplete.argumentPrefixes=
 org.eclipse.jdt.core.codeComplete.argumentSuffixes=
@@ -10,6 +9,7 @@ org.eclipse.jdt.core.codeComplete.staticFieldPrefixes=
 org.eclipse.jdt.core.codeComplete.staticFieldSuffixes=
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=true
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=82
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=82
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=82
 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=82
@@ -20,15 +20,18 @@ org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=50
 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=82
 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=82
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=48
 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
 org.eclipse.jdt.core.formatter.blank_lines_after_package=1
 org.eclipse.jdt.core.formatter.blank_lines_before_field=0
@@ -48,6 +51,7 @@ org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
 org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
@@ -64,10 +68,16 @@ org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
 org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
 org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
 org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
 org.eclipse.jdt.core.formatter.compact_else_if=true
 org.eclipse.jdt.core.formatter.continuation_indentation=2
 org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
 org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
 org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
 org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
 org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
@@ -79,10 +89,16 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
 org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
 org.eclipse.jdt.core.formatter.indentation.size=4
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_member=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
 org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert
 org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
@@ -130,6 +146,7 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=inser
 org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
 org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
 org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
@@ -148,12 +165,14 @@ org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invoca
 org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=insert
 org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
 org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
 org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
 org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
 org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
@@ -177,6 +196,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invoc
 org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=insert
 org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=insert
 org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=insert
 org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
 org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
@@ -204,6 +224,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do n
 org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
@@ -232,6 +253,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invoc
 org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
 org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
 org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
 org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
@@ -241,6 +263,7 @@ org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=inser
 org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
 org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
 org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
 org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
@@ -250,6 +273,8 @@ org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_
 org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
 org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
 org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
 org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
 org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
 org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
@@ -262,5 +287,8 @@ org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0
 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
 org.eclipse.jdt.core.formatter.tabulation.char=space
 org.eclipse.jdt.core.formatter.tabulation.size=4
+org.eclipse.jdt.core.formatter.use_on_off_tags=false
 org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
 org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
index eb40584..c6da1f8 100644 (file)
@@ -1,4 +1,3 @@
-#Thu Mar 03 10:19:18 PST 2011
 cleanup.add_default_serial_version_id=false
 cleanup.add_generated_serial_version_id=true
 cleanup.add_missing_annotations=true
@@ -12,10 +11,12 @@ cleanup.always_use_blocks=true
 cleanup.always_use_parentheses_in_expressions=true
 cleanup.always_use_this_for_non_static_field_access=false
 cleanup.always_use_this_for_non_static_method_access=false
+cleanup.convert_functional_interfaces=false
 cleanup.convert_to_enhanced_for_loop=true
 cleanup.correct_indentation=true
 cleanup.format_source_code=true
 cleanup.format_source_code_changes_only=false
+cleanup.insert_inferred_type_arguments=false
 cleanup.make_local_variable_final=true
 cleanup.make_parameters_final=true
 cleanup.make_private_fields_final=true
@@ -30,6 +31,7 @@ cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=tru
 cleanup.qualify_static_member_accesses_with_declaring_class=true
 cleanup.qualify_static_method_accesses_with_declaring_class=false
 cleanup.remove_private_constructors=true
+cleanup.remove_redundant_type_arguments=true
 cleanup.remove_trailing_whitespaces=true
 cleanup.remove_trailing_whitespaces_all=true
 cleanup.remove_trailing_whitespaces_ignore_empty=false
@@ -43,18 +45,21 @@ cleanup.remove_unused_private_methods=true
 cleanup.remove_unused_private_types=true
 cleanup.sort_members=false
 cleanup.sort_members_all=false
+cleanup.use_anonymous_class_creation=false
 cleanup.use_blocks=true
 cleanup.use_blocks_only_for_return_and_throw=false
+cleanup.use_lambda=true
 cleanup.use_parentheses_in_expressions=true
 cleanup.use_this_for_non_static_field_access=true
 cleanup.use_this_for_non_static_field_access_only_if_necessary=true
 cleanup.use_this_for_non_static_method_access=true
 cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+cleanup.use_type_arguments=false
 cleanup_profile=_forester_java_profile
 cleanup_settings_version=2
 eclipse.preferences.version=1
 formatter_profile=_forester
-formatter_settings_version=11
+formatter_settings_version=12
 org.eclipse.jdt.ui.exception.name=e
 org.eclipse.jdt.ui.gettersetter.use.is=true
 org.eclipse.jdt.ui.keywordthis=false
index c402d55..e545e0f 100644 (file)
Binary files a/forester/java/forester.jar and b/forester/java/forester.jar differ
index f06965b..14bcc07 100644 (file)
@@ -98,7 +98,7 @@ public final class AptxUtil {
         }
     }
     private final static String[] AVAILABLE_FONT_FAMILIES_SORTED = GraphicsEnvironment.getLocalGraphicsEnvironment()
-                                                                         .getAvailableFontFamilyNames();
+            .getAvailableFontFamilyNames();
     static {
         Arrays.sort( AVAILABLE_FONT_FAMILIES_SORTED );
     }
@@ -290,7 +290,7 @@ public final class AptxUtil {
                                                             final boolean internal_numbers_are_confidences,
                                                             final TAXONOMY_EXTRACTION taxonomy_extraction,
                                                             final boolean midpoint_reroot )
-            throws FileNotFoundException, IOException {
+                                                                    throws FileNotFoundException, IOException {
         final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
         final PhylogenyParser parser;
         boolean nhx_or_nexus = false;
@@ -338,7 +338,7 @@ public final class AptxUtil {
     final public static void showErrorMessage( final Component parent, final String error_msg ) {
         printAppletMessage( Constants.PRG_NAME, error_msg );
         JOptionPane.showMessageDialog( parent, error_msg, "[" + Constants.PRG_NAME + " " + Constants.VERSION
-                + "] Error", JOptionPane.ERROR_MESSAGE );
+                                       + "] Error", JOptionPane.ERROR_MESSAGE );
     }
 
     public static void writePhylogenyToGraphicsFile( final File intree,
@@ -363,7 +363,7 @@ public final class AptxUtil {
         phys[ 0 ] = phy;
         final MainFrameApplication mf = MainFrameApplication.createInstance( phys, config );
         AptxUtil.writePhylogenyToGraphicsFileNonInteractive( outfile, width, height, mf.getMainPanel()
-                .getCurrentTreePanel(), mf.getMainPanel().getControlPanel(), type, mf.getOptions() );
+                                                             .getCurrentTreePanel(), mf.getMainPanel().getControlPanel(), type, mf.getOptions() );
         mf.end();
     }
 
@@ -417,8 +417,8 @@ public final class AptxUtil {
     }
 
     final private static void openUrlInWebBrowser( final String url ) throws IOException, ClassNotFoundException,
-            SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException,
-            InvocationTargetException, InterruptedException {
+    SecurityException, NoSuchMethodException, IllegalArgumentException, IllegalAccessException,
+    InvocationTargetException, InterruptedException {
         final String os = System.getProperty( "os.name" );
         final Runtime runtime = Runtime.getRuntime();
         if ( os.toLowerCase().startsWith( "win" ) ) {
@@ -453,8 +453,8 @@ public final class AptxUtil {
                                             final MainPanel main_panel ) {
         if ( phys.length > Constants.MAX_TREES_TO_LOAD ) {
             JOptionPane.showMessageDialog( main_panel, "Attempt to load " + phys.length
-                    + " phylogenies,\ngoing to load only the first " + Constants.MAX_TREES_TO_LOAD, Constants.PRG_NAME
-                    + " more than " + Constants.MAX_TREES_TO_LOAD + " phylogenies", JOptionPane.WARNING_MESSAGE );
+                                           + " phylogenies,\ngoing to load only the first " + Constants.MAX_TREES_TO_LOAD, Constants.PRG_NAME
+                                           + " more than " + Constants.MAX_TREES_TO_LOAD + " phylogenies", JOptionPane.WARNING_MESSAGE );
         }
         int i = 1;
         for( final Phylogeny phy : phys ) {
@@ -825,8 +825,8 @@ public final class AptxUtil {
         JOptionPane.showMessageDialog( null,
                                        "Java memory allocation might be too small, try \"-Xmx2048m\" java command line option"
                                                + "\n\nError: " + e.getLocalizedMessage(),
-                                       "Out of Memory Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
-                                       JOptionPane.ERROR_MESSAGE );
+                                               "Out of Memory Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
+                                               JOptionPane.ERROR_MESSAGE );
         System.exit( -1 );
     }
 
@@ -855,10 +855,10 @@ public final class AptxUtil {
             sb.append( s + "\n" );
         }
         JOptionPane
-                .showMessageDialog( null,
-                                    "An unexpected (possibly severe) error has occured - terminating. \nPlease contact: "
-                                            + Constants.AUTHOR_EMAIL + " \nError: " + e.getLocalizedMessage() + "\n"
-                                            + sb,
+        .showMessageDialog( null,
+                            "An unexpected (possibly severe) error has occured - terminating. \nPlease contact: "
+                                    + Constants.AUTHOR_EMAIL + " \nError: " + e.getLocalizedMessage() + "\n"
+                                    + sb,
                                     "Unexpected Severe Error [" + Constants.PRG_NAME + " " + Constants.VERSION + "]",
                                     JOptionPane.ERROR_MESSAGE );
         System.exit( -1 );
@@ -876,8 +876,8 @@ public final class AptxUtil {
                                        "An unexpected exception has occured. \nPlease contact: "
                                                + Constants.AUTHOR_EMAIL + " \nException: " + e.getLocalizedMessage()
                                                + "\n" + sb,
-                                       "Unexpected Exception [" + Constants.PRG_NAME + Constants.VERSION + "]",
-                                       JOptionPane.ERROR_MESSAGE );
+                                               "Unexpected Exception [" + Constants.PRG_NAME + Constants.VERSION + "]",
+                                               JOptionPane.ERROR_MESSAGE );
     }
 
     final static String writePhylogenyToGraphicsByteArrayOutputStream( final ByteArrayOutputStream baos,
index f88a8f0..e1a8a47 100644 (file)
@@ -88,7 +88,7 @@ public final class Archaeopteryx {
                     }
                     boolean nhx_or_nexus = false;
                     final PhylogenyParser p = ParserUtils.createParserDependingOnFileType( f, conf
-                            .isValidatePhyloXmlAgainstSchema() );
+                                                                                           .isValidatePhyloXmlAgainstSchema() );
                     if ( p instanceof NHXParser ) {
                         nhx_or_nexus = true;
                         final NHXParser nhx = ( NHXParser ) p;
index f5772f3..d1a2384 100644 (file)
@@ -42,11 +42,11 @@ public final class Constants {
     public final static boolean __SYNTH_LF                                                    = false;                                                                             // TODO remove me
     public final static boolean ALLOW_DDBJ_BLAST                                              = false;
     public final static String  PRG_NAME                                                      = "Archaeopteryx";
-    final static String         VERSION                                                       = "0.9908 experimental";
-    final static String         PRG_DATE                                                      = "150312";
+    final static String         VERSION                                                       = "0.9909 experimental";
+    final static String         PRG_DATE                                                      = "150513";
     final static String         DEFAULT_CONFIGURATION_FILE_NAME                               = "_aptx_configuration_file";
     final static String[]       DEFAULT_FONT_CHOICES                                          = { "Arial", "Helvetica",
-        "Verdana", "Tahoma", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans"  };
+            "Verdana", "Tahoma", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans"  };
     final static boolean        VERBOSE_DEFAULT                                               = false;
     final static int            DOMAIN_STRUCTURE_DEFAULT_WIDTH                                = 100;
     final static String         AUTHOR_EMAIL                                                  = "phyloxml@gmail.com";
index a9bdd9f..0f4ae3e 100644 (file)
@@ -825,10 +825,10 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             }\r
             if ( ( nodes == null ) || nodes.isEmpty() ) {\r
                 JOptionPane\r
-                .showMessageDialog( this,\r
-                                    "Need to select nodes, either via direct selection or via the \"Search\" function",\r
-                                    "No nodes selected for annotation",\r
-                                    JOptionPane.ERROR_MESSAGE );\r
+                        .showMessageDialog( this,\r
+                                            "Need to select nodes, either via direct selection or via the \"Search\" function",\r
+                                            "No nodes selected for annotation",\r
+                                            JOptionPane.ERROR_MESSAGE );\r
                 return;\r
             }\r
             final Phylogeny phy = getMainPanel().getCurrentPhylogeny();\r
@@ -847,7 +847,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                                   my_panel,\r
                                                                   "Enter the sequence annotation(s) for the "\r
                                                                           + nodes.size() + " selected nodes",\r
-                                                                          JOptionPane.OK_CANCEL_OPTION );\r
+                                                                  JOptionPane.OK_CANCEL_OPTION );\r
                 if ( result == JOptionPane.OK_OPTION ) {\r
                     String ref = ref_field.getText();\r
                     String desc = desc_filed.getText();\r
@@ -874,7 +874,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                         for( final PhylogenyNode n : nodes ) {\r
                             ForesterUtil.ensurePresenceOfSequence( n );\r
                             final Annotation ann = ForesterUtil.isEmpty( ref ) ? new Annotation()\r
-                            : new Annotation( ref );\r
+                                    : new Annotation( ref );\r
                             if ( !ForesterUtil.isEmpty( desc ) ) {\r
                                 ann.setDesc( desc );\r
                             }\r
@@ -899,11 +899,11 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                 .showInputDialog( this,\r
                                   "Please enter the minimum for confidence values to be displayed.\n"\r
                                           + "[current value: " + getOptions().getMinConfidenceValue() + "]\n",\r
-                                          "Minimal Confidence Value",\r
-                                          JOptionPane.QUESTION_MESSAGE,\r
-                                          null,\r
-                                          null,\r
-                                          getOptions().getMinConfidenceValue() );\r
+                                  "Minimal Confidence Value",\r
+                                  JOptionPane.QUESTION_MESSAGE,\r
+                                  null,\r
+                                  null,\r
+                                  getOptions().getMinConfidenceValue() );\r
         if ( !ForesterUtil.isEmpty( s ) ) {\r
             boolean success = true;\r
             double m = 0.0;\r
@@ -945,10 +945,10 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }\r
         if ( ( nodes == null ) || nodes.isEmpty() ) {\r
             JOptionPane\r
-            .showMessageDialog( this,\r
-                                "Need to select external nodes, either via direct selection or via the \"Search\" function",\r
-                                "No external nodes selected to " + function.toLowerCase(),\r
-                                JOptionPane.ERROR_MESSAGE );\r
+                    .showMessageDialog( this,\r
+                                        "Need to select external nodes, either via direct selection or via the \"Search\" function",\r
+                                        "No external nodes selected to " + function.toLowerCase(),\r
+                                        JOptionPane.ERROR_MESSAGE );\r
             return;\r
         }\r
         final int todo = nodes.size();\r
@@ -965,8 +965,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             return;\r
         }\r
         final int result = JOptionPane.showConfirmDialog( null, function + " " + todo\r
-                                                          + " external node(s), from a total of " + ext + " external nodes," + "\nresulting in tree with " + res\r
-                                                          + " nodes?", function + " external nodes", JOptionPane.OK_CANCEL_OPTION );\r
+                + " external node(s), from a total of " + ext + " external nodes," + "\nresulting in tree with " + res\r
+                + " nodes?", function + " external nodes", JOptionPane.OK_CANCEL_OPTION );\r
         if ( result == JOptionPane.OK_OPTION ) {\r
             if ( !delete ) {\r
                 final List<PhylogenyNode> to_delete = new ArrayList<PhylogenyNode>();\r
@@ -1236,11 +1236,11 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                                  "Please enter the default line width for PDF export.\n"\r
                                                                          + "[current value: "\r
                                                                          + getOptions().getPrintLineWidth() + "]\n",\r
-                                                                         "Line Width for PDF Export",\r
-                                                                         JOptionPane.QUESTION_MESSAGE,\r
-                                                                         null,\r
-                                                                         null,\r
-                                                                         getOptions().getPrintLineWidth() );\r
+                                                                 "Line Width for PDF Export",\r
+                                                                 JOptionPane.QUESTION_MESSAGE,\r
+                                                                 null,\r
+                                                                 null,\r
+                                                                 getOptions().getPrintLineWidth() );\r
         if ( !ForesterUtil.isEmpty( s ) ) {\r
             boolean success = true;\r
             float f = 0.0f;\r
@@ -1272,12 +1272,12 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                                          + Constants.A4_SIZE_Y + "]\n" + "[US Letter: "\r
                                                                          + Constants.US_LETTER_SIZE_X + ", "\r
                                                                          + Constants.US_LETTER_SIZE_Y + "]",\r
-                                                                         "Default Size for Graphics Export",\r
-                                                                         JOptionPane.QUESTION_MESSAGE,\r
-                                                                         null,\r
-                                                                         null,\r
-                                                                         getOptions().getPrintSizeX() + ", "\r
-                                                                                 + getOptions().getPrintSizeY() );\r
+                                                                 "Default Size for Graphics Export",\r
+                                                                 JOptionPane.QUESTION_MESSAGE,\r
+                                                                 null,\r
+                                                                 null,\r
+                                                                 getOptions().getPrintSizeX() + ", "\r
+                                                                         + getOptions().getPrintSizeY() );\r
         if ( !ForesterUtil.isEmpty( s ) && ( s.indexOf( ',' ) > 0 ) ) {\r
             boolean success = true;\r
             int x = 0;\r
@@ -1456,8 +1456,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                    + gsdi.getStrippedExternalGeneTreeNodes().size() + "\n"\r
                                                    + "Taxonomy linkage based on: " + gsdi.getTaxCompBase() + "\n"\r
                                                    + "Number of polytomies in species tree used: " + poly + "\n",\r
-                                                   "GSDI successfully completed",\r
-                                                   JOptionPane.WARNING_MESSAGE );\r
+                                           "GSDI successfully completed",\r
+                                           JOptionPane.WARNING_MESSAGE );\r
         }\r
         else {\r
             JOptionPane.showMessageDialog( this,\r
@@ -1469,8 +1469,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                    + gsdi.getStrippedExternalGeneTreeNodes().size() + "\n"\r
                                                    + "Taxonomy linkage based on: " + gsdi.getTaxCompBase() + "\n"\r
                                                    + "Number of polytomies in species tree used: " + poly + "\n",\r
-                                                   "GSDI successfully completed",\r
-                                                   JOptionPane.INFORMATION_MESSAGE );\r
+                                           "GSDI successfully completed",\r
+                                           JOptionPane.INFORMATION_MESSAGE );\r
         }\r
     }\r
 \r
@@ -1529,8 +1529,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                    + gsdir.getStrippedExternalGeneTreeNodes().size() + "\n"\r
                                                    + "Taxonomy linkage based on: " + gsdir.getTaxCompBase() + "\n"\r
                                                    + "Number of polytomies in species tree used: " + poly + "\n",\r
-                                                   "GSDIR successfully completed",\r
-                                                   JOptionPane.WARNING_MESSAGE );\r
+                                           "GSDIR successfully completed",\r
+                                           JOptionPane.WARNING_MESSAGE );\r
         }\r
         else {\r
             JOptionPane.showMessageDialog( this,\r
@@ -1540,8 +1540,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                    + gsdir.getStrippedExternalGeneTreeNodes().size() + "\n"\r
                                                    + "Taxonomy linkage based on: " + gsdir.getTaxCompBase() + "\n"\r
                                                    + "Number of polytomies in species tree used: " + poly + "\n",\r
-                                                   "GSDIR successfully completed",\r
-                                                   JOptionPane.INFORMATION_MESSAGE );\r
+                                           "GSDIR successfully completed",\r
+                                           JOptionPane.INFORMATION_MESSAGE );\r
         }\r
     }\r
 \r
@@ -1559,7 +1559,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         final AncestralTaxonomyInferrer inferrer = new AncestralTaxonomyInferrer( this,\r
                                                                                   _mainpanel.getCurrentTreePanel(),\r
                                                                                   _mainpanel.getCurrentPhylogeny()\r
-                                                                                  .copy() );\r
+                                                                                          .copy() );\r
         new Thread( inferrer ).start();\r
     }\r
 \r
@@ -1693,10 +1693,10 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         if ( getCurrentTreePanel() != null ) {\r
             if ( getCurrentTreePanel().isCurrentTreeIsSubtree() ) {\r
                 JOptionPane\r
-                .showMessageDialog( this,\r
-                                    "This operation can only be performed on a complete tree, not on the currently displayed sub-tree only.",\r
-                                    "Operation can not be exectuted on a sub-tree",\r
-                                    JOptionPane.WARNING_MESSAGE );\r
+                        .showMessageDialog( this,\r
+                                            "This operation can only be performed on a complete tree, not on the currently displayed sub-tree only.",\r
+                                            "Operation can not be exectuted on a sub-tree",\r
+                                            JOptionPane.WARNING_MESSAGE );\r
                 return true;\r
             }\r
         }\r
@@ -1847,20 +1847,20 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     void updateOptions( final Options options ) {\r
         options.setAntialiasScreen( ( _screen_antialias_cbmi != null ) && _screen_antialias_cbmi.isSelected() );\r
         options.setBackgroundColorGradient( ( _background_gradient_cbmi != null )\r
-                                            && _background_gradient_cbmi.isSelected() );\r
+                && _background_gradient_cbmi.isSelected() );\r
         options.setShowDomainLabels( ( _show_domain_labels != null ) && _show_domain_labels.isSelected() );\r
         options.setShowAnnotationRefSource( ( _show_annotation_ref_source != null )\r
-                                            && _show_annotation_ref_source.isSelected() );\r
+                && _show_annotation_ref_source.isSelected() );\r
         options.setAbbreviateScientificTaxonNames( ( _abbreviate_scientific_names != null )\r
-                                                   && _abbreviate_scientific_names.isSelected() );\r
+                && _abbreviate_scientific_names.isSelected() );\r
         options.setColorLabelsSameAsParentBranch( ( _color_labels_same_as_parent_branch != null )\r
-                                                  && _color_labels_same_as_parent_branch.isSelected() );\r
+                && _color_labels_same_as_parent_branch.isSelected() );\r
         options.setShowDefaultNodeShapesInternal( ( _show_default_node_shapes_internal_cbmi != null )\r
-                                                  && _show_default_node_shapes_internal_cbmi.isSelected() );\r
+                && _show_default_node_shapes_internal_cbmi.isSelected() );\r
         options.setShowDefaultNodeShapesExternal( ( _show_default_node_shapes_external_cbmi != null )\r
-                                                  && _show_default_node_shapes_external_cbmi.isSelected() );\r
+                && _show_default_node_shapes_external_cbmi.isSelected() );\r
         options.setShowDefaultNodeShapesForMarkedNodes( ( _show_default_node_shapes_for_marked_cbmi != null )\r
-                                                        && _show_default_node_shapes_for_marked_cbmi.isSelected() );\r
+                && _show_default_node_shapes_for_marked_cbmi.isSelected() );\r
         if ( ( _non_lined_up_cladograms_rbmi != null ) && ( _non_lined_up_cladograms_rbmi.isSelected() ) ) {\r
             options.setCladogramType( CLADOGRAM_TYPE.NON_LINED_UP );\r
         }\r
@@ -1871,7 +1871,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             options.setCladogramType( CLADOGRAM_TYPE.EXT_NODE_SUM_DEP );\r
         }\r
         options.setSearchCaseSensitive( ( _search_case_senstive_cbmi != null )\r
-                                        && _search_case_senstive_cbmi.isSelected() );\r
+                && _search_case_senstive_cbmi.isSelected() );\r
         if ( ( _show_scale_cbmi != null ) && _show_scale_cbmi.isEnabled() ) {\r
             options.setShowScale( _show_scale_cbmi.isSelected() );\r
         }\r
@@ -1885,14 +1885,14 @@ public abstract class MainFrame extends JFrame implements ActionListener {
         }\r
         options.setShowOverview( ( _show_overview_cbmi != null ) && _show_overview_cbmi.isSelected() );\r
         options.setShowConfidenceStddev( ( _show_confidence_stddev_cbmi != null )\r
-                                         && _show_confidence_stddev_cbmi.isSelected() );\r
+                && _show_confidence_stddev_cbmi.isSelected() );\r
         if ( ( _color_by_taxonomic_group_cbmi != null ) && _color_by_taxonomic_group_cbmi.isEnabled() ) {\r
             options.setColorByTaxonomicGroup( _color_by_taxonomic_group_cbmi.isSelected() );\r
         }\r
         options.setPrintUsingActualSize( ( _print_using_actual_size_cbmi != null )\r
-                                         && ( _print_using_actual_size_cbmi.isSelected() ) );\r
+                && ( _print_using_actual_size_cbmi.isSelected() ) );\r
         options.setGraphicsExportUsingActualSize( ( _graphics_export_using_actual_size_cbmi != null )\r
-                                                  && ( _graphics_export_using_actual_size_cbmi.isSelected() ) );\r
+                && ( _graphics_export_using_actual_size_cbmi.isSelected() ) );\r
         options.setAntialiasPrint( ( _antialias_print_cbmi != null ) && _antialias_print_cbmi.isSelected() );\r
         if ( ( _use_brackets_for_conf_in_nh_export_cbmi != null )\r
                 && _use_brackets_for_conf_in_nh_export_cbmi.isSelected() ) {\r
@@ -1906,9 +1906,9 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             options.setNhConversionSupportValueStyle( NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE );\r
         }\r
         options.setPrintBlackAndWhite( ( _print_black_and_white_cbmi != null )\r
-                                       && _print_black_and_white_cbmi.isSelected() );\r
+                && _print_black_and_white_cbmi.isSelected() );\r
         options.setInternalNumberAreConfidenceForNhParsing( ( _internal_number_are_confidence_for_nh_parsing_cbmi != null )\r
-                                                            && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() );\r
+                && _internal_number_are_confidence_for_nh_parsing_cbmi.isSelected() );\r
         if ( ( _extract_taxonomy_pfam_strict_rbmi != null ) && _extract_taxonomy_pfam_strict_rbmi.isSelected() ) {\r
             options.setTaxonomyExtraction( TAXONOMY_EXTRACTION.PFAM_STYLE_STRICT );\r
         }\r
@@ -1922,14 +1922,14 @@ public abstract class MainFrame extends JFrame implements ActionListener {
             options.setTaxonomyExtraction( TAXONOMY_EXTRACTION.NO );\r
         }\r
         options.setReplaceUnderscoresInNhParsing( ( _replace_underscores_cbmi != null )\r
-                                                  && _replace_underscores_cbmi.isSelected() );\r
+                && _replace_underscores_cbmi.isSelected() );\r
         options.setAllowErrorsInDistanceToParent( ( _allow_errors_in_distance_to_parent_cbmi != null )\r
-                                                  && _allow_errors_in_distance_to_parent_cbmi.isSelected() );\r
+                && _allow_errors_in_distance_to_parent_cbmi.isSelected() );\r
         options.setMatchWholeTermsOnly( ( _search_whole_words_only_cbmi != null )\r
-                                        && _search_whole_words_only_cbmi.isSelected() );\r
+                && _search_whole_words_only_cbmi.isSelected() );\r
         options.setSearchWithRegex( ( _search_with_regex_cbmi != null ) && _search_with_regex_cbmi.isSelected() );\r
         options.setInverseSearchResult( ( _inverse_search_result_cbmi != null )\r
-                                        && _inverse_search_result_cbmi.isSelected() );\r
+                && _inverse_search_result_cbmi.isSelected() );\r
         if ( _graphics_export_visible_only_cbmi != null ) {\r
             options.setGraphicsExportVisibleOnly( _graphics_export_visible_only_cbmi.isSelected() );\r
             if ( _graphics_export_visible_only_cbmi.isSelected() && ( _graphics_export_using_actual_size_cbmi != null ) ) {\r
@@ -1995,8 +1995,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                 title = "\"" + getMainPanel().getCurrentPhylogeny().getName() + "\" in " + title;\r
             }\r
             showTextFrame( _mainpanel.getCurrentPhylogeny().toNewHampshire( getOptions()\r
-                                                                            .getNhConversionSupportValueStyle() ),\r
-                                                                            title );\r
+                                   .getNhConversionSupportValueStyle() ),\r
+                           title );\r
         }\r
     }\r
 \r
@@ -2050,7 +2050,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
      */\r
     static void about() {\r
         final StringBuffer about = new StringBuffer( "Archaeopteryx\nVersion " + Constants.VERSION + "\n" );\r
-        about.append( "Copyright (C) 2014 Christian M Zmasek\n" );\r
+        about.append( "Copyright (C) 2015 Christian M Zmasek\n" );\r
         about.append( "All Rights Reserved\n" );\r
         about.append( "License: GNU Lesser General Public License (LGPL)\n" );\r
         about.append( "Last modified: " + Constants.PRG_DATE + "\n" );\r
@@ -2085,11 +2085,11 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                                                                  "Please enter the default size for node shapes.\n"\r
                                                                          + "[current value: "\r
                                                                          + options.getDefaultNodeShapeSize() + "]\n",\r
-                                                                         "Node Shape Size",\r
-                                                                         JOptionPane.QUESTION_MESSAGE,\r
-                                                                         null,\r
-                                                                         null,\r
-                                                                         options.getDefaultNodeShapeSize() );\r
+                                                                 "Node Shape Size",\r
+                                                                 JOptionPane.QUESTION_MESSAGE,\r
+                                                                 null,\r
+                                                                 null,\r
+                                                                 options.getDefaultNodeShapeSize() );\r
         if ( !ForesterUtil.isEmpty( s ) ) {\r
             boolean success = true;\r
             double m = 0.0;\r
@@ -2269,8 +2269,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                 JOptionPane.showMessageDialog( comp,\r
                                                "There was an unknown problem when attempting to write to PDF file: \""\r
                                                        + file_name + "\"",\r
-                                                       "Error",\r
-                                                       JOptionPane.ERROR_MESSAGE );\r
+                                               "Error",\r
+                                               JOptionPane.ERROR_MESSAGE );\r
             }\r
         }\r
         if ( !opts.isPrintUsingActualSize() ) {\r
@@ -2319,7 +2319,7 @@ public abstract class MainFrame extends JFrame implements ActionListener {
     static void setTextColorChooseMenuItem( final JMenuItem mi, final TreePanel tree_panel ) {\r
         if ( ( tree_panel != null ) && ( tree_panel.getTreeColorSet() != null ) ) {\r
             mi.setText( "Select Color Scheme... (current: " + tree_panel.getTreeColorSet().getCurrentColorSchemeName()\r
-                        + ")" );\r
+                    + ")" );\r
         }\r
         else {\r
             mi.setText( "Select Color Scheme..." );\r
@@ -2431,8 +2431,8 @@ public abstract class MainFrame extends JFrame implements ActionListener {
                 JOptionPane.showMessageDialog( comp,\r
                                                "There was an unknown problem when attempting to write to an image file: \""\r
                                                        + file_name + "\"",\r
-                                                       "Error",\r
-                                                       JOptionPane.ERROR_MESSAGE );\r
+                                               "Error",\r
+                                               JOptionPane.ERROR_MESSAGE );\r
             }\r
         }\r
         contentpane.repaint();\r
index 0e554f8..f1074f4 100644 (file)
@@ -59,7 +59,8 @@ import org.forester.util.ForesterUtil;
 
 public class TestPhylogenyReconstruction {
 
-    private final static double ZERO_DIFF = 1.0E-9;
+    private final static double  ZERO_DIFF = 1.0E-9;
+    private final static boolean VERBOSE   = false;
 
     public static boolean isEqual( final double a, final double b ) {
         return ( ( Math.abs( a - b ) ) < ZERO_DIFF );
@@ -71,7 +72,7 @@ public class TestPhylogenyReconstruction {
 
     public static void main( final String[] args ) {
         System.out.println( "NJ" );
-        if ( testNeighborJoining() ) {
+        if ( testNeighborJoining( VERBOSE ) ) {
             System.out.println( "  OK." );
         }
         else {
@@ -133,7 +134,7 @@ public class TestPhylogenyReconstruction {
         }
         System.out.println( "OK." );
         System.out.print( "  Neighbor Joining: " );
-        if ( !testNeighborJoining() ) {
+        if ( !testNeighborJoining( VERBOSE ) ) {
             System.out.println( "failed." );
             return false;
         }
@@ -437,7 +438,7 @@ public class TestPhylogenyReconstruction {
     private static boolean testDistanceCalculationMethods( final File test_dir ) {
         try {
             final Msa msa0 = GeneralMsaParser.parse( new FileInputStream( test_dir + ForesterUtil.FILE_SEPARATOR
-                                                                          + "bcl.aln" ) );
+                    + "bcl.aln" ) );
             final BasicSymmetricalDistanceMatrix pwd0 = PairwiseDistanceCalculator.calcKimuraDistances( msa0 );
             if ( pwd0.getSize() != 120 ) {
                 return false;
@@ -465,7 +466,7 @@ public class TestPhylogenyReconstruction {
             final String p1_str = "((((((a,b)ab,c)ac,d)ad,(e,f)ef)af,(g,h)gh)ah,i)r";
             final Phylogeny p1 = factory1.create( p1_str, new NHXParser() )[ 0 ];
             CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m1 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 9,
-                    1 );
+                                                                                                                                           1 );
             m1.setIdentifier( 0, "a" );
             m1.setIdentifier( 1, "b" );
             m1.setIdentifier( 2, "c" );
@@ -538,7 +539,7 @@ public class TestPhylogenyReconstruction {
             final String p2_str = "((((((a,b)ab,c)ac,d)ad,(e,f)ef)af,(g,h,i)gi)ai,((j,k,l)jl,(m,n,o)mo,(p,q,r)pr)jr)root";
             final Phylogeny p2 = factory2.create( p2_str, new NHXParser() )[ 0 ];
             final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m2 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 18,
-                    4 );
+                                                                                                                                                 4 );
             m2.setIdentifier( 0, "a" );
             m2.setIdentifier( 1, "b" );
             m2.setIdentifier( 2, "c" );
@@ -847,7 +848,7 @@ public class TestPhylogenyReconstruction {
             final String p10_str = "((((((a,b)ab,c)ac,d)ad,(e,f)ef)af,(g,h)gh)ah,i)r";
             final Phylogeny p10 = factory10.create( p10_str, new NHXParser() )[ 0 ];
             final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m10 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 9,
-                    1 );
+                                                                                                                                                  1 );
             m10.setIdentifier( 0, "a" );
             m10.setIdentifier( 1, "b" );
             m10.setIdentifier( 2, "c" );
@@ -890,7 +891,7 @@ public class TestPhylogenyReconstruction {
             final String p1_str = "((((((a,b,y)aby,c)ac,d)ad,(e,f)ef)af,(g,h)gh)ah,i)r";
             final Phylogeny p1 = factory1.create( p1_str, new NHXParser() )[ 0 ];
             final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m1 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 10,
-                    1 );
+                                                                                                                                                 1 );
             m1.setIdentifier( 0, "a" );
             m1.setIdentifier( 1, "b" );
             m1.setIdentifier( 2, "y" );
@@ -961,7 +962,7 @@ public class TestPhylogenyReconstruction {
             final String p2_str = "((((((a,b,y)aby,c,d)cad,e,f)af,(g,h)gh)ah,i))r";
             final Phylogeny p2 = factory2.create( p2_str, new NHXParser() )[ 0 ];
             final CharacterStateMatrix<CharacterStateMatrix.BinaryStates> m2 = new BasicCharacterStateMatrix<CharacterStateMatrix.BinaryStates>( 10,
-                    1 );
+                                                                                                                                                 1 );
             m2.setIdentifier( 0, "a" );
             m2.setIdentifier( 1, "b" );
             m2.setIdentifier( 2, "y" );
@@ -1952,7 +1953,7 @@ public class TestPhylogenyReconstruction {
         return true;
     }
 
-    private static boolean testNeighborJoining() {
+    private static boolean testNeighborJoining( final boolean verbose ) {
         try {
             NeighborJoining nj = NeighborJoining.createInstance();
             final BasicSymmetricalDistanceMatrix m0 = new BasicSymmetricalDistanceMatrix( 4 );
@@ -2079,7 +2080,7 @@ public class TestPhylogenyReconstruction {
             m.setRow( "1.60430 1.43890 0.61790 0.50610 0.34840 0.00000 0.26920", 5 );
             m.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
             //NeighborJoiningR njr = NeighborJoiningR.createInstance( true, 6 );
-            nj = NeighborJoining.createInstance( true, 6 );
+            nj = NeighborJoining.createInstance( verbose, 6 );
             final Phylogeny p2 = nj.execute( m );
             //Archaeopteryx.createApplication( p2 );
             p2.reRoot( p2.getNode( "Bovine" ) );
@@ -2121,7 +2122,7 @@ public class TestPhylogenyReconstruction {
                 return false;
             }
             if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
-                            .getDistanceToParent(), 0.458845 ) ) {
+                    .getDistanceToParent(), 0.458845 ) ) {
                 return false;
             }
             m = new BasicSymmetricalDistanceMatrix( 4 );
@@ -2199,7 +2200,7 @@ public class TestPhylogenyReconstruction {
             m.setRow( "1.52430 1.44650 0.59580 0.46310 0.00000 0.34840 0.30830", 4 );
             m.setRow( "1.60430 1.43890 0.61790 0.50610 0.34840 0.00000 0.26920", 5 );
             m.setRow( "1.59050 1.46290 0.55830 0.47100 0.30830 0.26920 0.00000", 6 );
-            njf = NeighborJoiningF.createInstance( true, 5 );
+            njf = NeighborJoiningF.createInstance( verbose, 5 );
             final Phylogeny p2f = njf.execute( m );
             p2f.reRoot( p2f.getNode( "Bovine" ) );
             if ( isUnequal( p2f.getNode( "Chimp" ).getDistanceToParent(), 0.15168 ) ) {
@@ -2236,11 +2237,11 @@ public class TestPhylogenyReconstruction {
                 return false;
             }
             if ( isUnequal( p2f.getNode( "Chimp" ).getParent().getParent().getParent().getParent()
-                            .getDistanceToParent(), 0.42027 ) ) {
+                    .getDistanceToParent(), 0.42027 ) ) {
                 return false;
             }
             if ( isUnequal( p2f.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
-                            .getDistanceToParent(), 0.458845 ) ) {
+                    .getDistanceToParent(), 0.458845 ) ) {
                 return false;
             }
         }
@@ -2669,7 +2670,7 @@ public class TestPhylogenyReconstruction {
                 return false;
             }
             if ( isUnequal( p2.getNode( "Chimp" ).getParent().getParent().getParent().getParent().getParent()
-                            .getDistanceToParent(), 0.458845 ) ) {
+                    .getDistanceToParent(), 0.458845 ) ) {
                 return false;
             }
             //
index 1985f77..b5d2794 100644 (file)
@@ -66,8 +66,18 @@ public class ProteinDomainParser implements PhylogenyDataPhyloXmlParser {
             throw new PhyloXmlDataFormatException( "failed to parse element [" + element + "]: " + e.getMessage() );
         }
         name = element.getValueAsString();
-        if ( ( f == -1 ) || ( t == -1 ) || ( conf == ProteinDomain.CONFIDENCE_DEFAULT ) ) {
-            throw new PhyloXmlDataFormatException( "from, to, or confidence attribute not set in: " + element );
+        if ( f == -1 ) {
+            throw new PhyloXmlDataFormatException( "\"" + PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_FROM
+                    + "\" attribute not set in: " + element );
+        }
+        if ( t == -1 ) {
+            throw new PhyloXmlDataFormatException( "\"" + PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_TO
+                    + "\" attribute not set in: " + element );
+        }
+        if ( conf < 0 ) {
+            throw new PhyloXmlDataFormatException( "\""
+                    + PhyloXmlMapping.SEQUENCE_DOMAIN_ARCHITECTURE_PROT_DOMAIN_CONFIDENCE
+                    + "\" attribute either negative or not set in: " + element );
         }
         return new ProteinDomain( name, f, t, id, conf );
     }
index 3adcdfd..921ff25 100644 (file)
@@ -33,7 +33,7 @@ import org.forester.util.ForesterUtil;
 
 public class ProteinDomain implements PhylogenyData {
 
-    final public static double CONFIDENCE_DEFAULT = 0.0;
+    final public static double CONFIDENCE_DEFAULT = -1;
     final public static String IDENTIFIER_DEFAULT = "";
     final private String       _name;
     final private int          _from;
@@ -78,7 +78,7 @@ public class ProteinDomain implements PhylogenyData {
             sb.append( " " );
             sb.append( getId() );
         }
-        if ( getConfidence() != CONFIDENCE_DEFAULT ) {
+        if ( getConfidence() >= 0 ) {
             sb.append( " " );
             sb.append( getConfidence() );
         }
index 94798ae..47e445b 100644 (file)
@@ -134,19 +134,19 @@ import org.forester.ws.wabi.TxSearch.TAX_RANK;
 public final class Test {
 
     private final static String  PATH_TO_RESOURCES         = System.getProperty( "user.dir" )
-            + ForesterUtil.getFileSeparator() + "resources"
-            + ForesterUtil.getFileSeparator();
+                                                                   + ForesterUtil.getFileSeparator() + "resources"
+                                                                   + ForesterUtil.getFileSeparator();
     private final static String  PATH_TO_TEST_DATA         = System.getProperty( "user.dir" )
-            + ForesterUtil.getFileSeparator() + "test_data"
-            + ForesterUtil.getFileSeparator();
+                                                                   + ForesterUtil.getFileSeparator() + "test_data"
+                                                                   + ForesterUtil.getFileSeparator();
     private final static boolean PERFORM_DB_TESTS          = true;
     private static final boolean PERFORM_WEB_TREE_ACCESS   = true;
     private static final String  PHYLOXML_LOCAL_XSD        = PATH_TO_RESOURCES + "phyloxml_schema/"
-            + ForesterConstants.PHYLO_XML_VERSION + "/"
-            + ForesterConstants.PHYLO_XML_XSD;
+                                                                   + ForesterConstants.PHYLO_XML_VERSION + "/"
+                                                                   + ForesterConstants.PHYLO_XML_XSD;
     private static final String  PHYLOXML_REMOTE_XSD       = ForesterConstants.PHYLO_XML_LOCATION + "/"
-            + ForesterConstants.PHYLO_XML_VERSION + "/"
-            + ForesterConstants.PHYLO_XML_XSD;
+                                                                   + ForesterConstants.PHYLO_XML_VERSION + "/"
+                                                                   + ForesterConstants.PHYLO_XML_XSD;
     private final static boolean USE_LOCAL_PHYLOXML_SCHEMA = true;
     private final static double  ZERO_DIFF                 = 1.0E-9;
 
@@ -157,7 +157,7 @@ public final class Test {
     public static void main( final String[] args ) {
         System.out.println( "[Java version: " + ForesterUtil.JAVA_VERSION + " " + ForesterUtil.JAVA_VENDOR + "]" );
         System.out.println( "[OS: " + ForesterUtil.OS_NAME + " " + ForesterUtil.OS_ARCH + " " + ForesterUtil.OS_VERSION
-                            + "]" );
+                + "]" );
         Locale.setDefault( Locale.US );
         System.out.println( "[Locale: " + Locale.getDefault() + "]" );
         int failed = 0;
@@ -181,15 +181,6 @@ public final class Test {
             System.exit( -1 );
         }
         final long start_time = new Date().getTime();
-        System.out.print( "MSA entropy: " );
-        if ( Test.testMsaEntropy() ) {
-            System.out.println( "OK." );
-            succeeded++;
-        }
-        else {
-            System.out.println( "failed." );
-            failed++;
-        }
         System.out.print( "Basic node methods: " );
         if ( Test.testBasicNodeMethods() ) {
             System.out.println( "OK." );
@@ -931,6 +922,15 @@ public final class Test {
             System.out.println( "failed." );
             failed++;
         }
+        System.out.print( "MSA entropy: " );
+        if ( Test.testMsaEntropy() ) {
+            System.out.println( "OK." );
+            succeeded++;
+        }
+        else {
+            System.out.println( "failed." );
+            failed++;
+        }
         if ( PERFORM_DB_TESTS ) {
             System.out.print( "Uniprot Entry Retrieval: " );
             if ( Test.testUniprotEntryRetrieval() ) {
@@ -2103,7 +2103,7 @@ public final class Test {
                 return false;
             }
             if ( t3_rt.getNode( "node bc" ).getNodeData().getSequence().getDomainArchitecture().getDomain( 0 )
-                    .getConfidence() != 2144 ) {
+                    .getConfidence() != 0 ) {
                 return false;
             }
             if ( !t3_rt.getNode( "node bc" ).getNodeData().getSequence().getDomainArchitecture().getDomain( 0 ).getId()
@@ -4625,17 +4625,17 @@ public final class Test {
             }
             if ( !ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSE function = 23445",
                                                                TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED )
-                                                               .equals( "MOUSE" ) ) {
+                    .equals( "MOUSE" ) ) {
                 return false;
             }
             if ( !ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSE+function = 23445",
                                                                TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED )
-                                                               .equals( "MOUSE" ) ) {
+                    .equals( "MOUSE" ) ) {
                 return false;
             }
             if ( !ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSE|function = 23445",
                                                                TAXONOMY_EXTRACTION.PFAM_STYLE_RELAXED )
-                                                               .equals( "MOUSE" ) ) {
+                    .equals( "MOUSE" ) ) {
                 return false;
             }
             if ( ParserUtils.extractTaxonomyCodeFromNodeName( "BCL2_MOUSEfunction = 23445",
@@ -5806,10 +5806,10 @@ public final class Test {
         final String test_dir = Test.PATH_TO_TEST_DATA;
         try {
             final HmmscanPerDomainTableParser parser1 = new HmmscanPerDomainTableParser( new File( test_dir
-                                                                                                   + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_1" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
+                    + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_1" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
             parser1.parse();
             final HmmscanPerDomainTableParser parser2 = new HmmscanPerDomainTableParser( new File( test_dir
-                                                                                                   + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_2" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
+                    + ForesterUtil.getFileSeparator() + "hmmscan30b3_output_2" ), "MONBR", INDIVIDUAL_SCORE_CUTOFF.NONE );
             final List<Protein> proteins = parser2.parse();
             if ( parser2.getProteinsEncountered() != 4 ) {
                 return false;
@@ -6225,21 +6225,23 @@ public final class Test {
             l.add( s2 );
             l.add( s3 );
             final Msa msa = BasicMsa.createInstance( l );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 0 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 1 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 2 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 3 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 4 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 5 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 6 ) );
-            System.out.println();
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 0 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 1 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 2 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 3 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 4 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 5 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 6 ) );
+            //TODO need to DO the tests!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
+            //FIXME
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 0 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 1 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 2 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 3 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 4 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 5 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa, 6 ) );
+            //            System.out.println();
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 0 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 1 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 2 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 3 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 4 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 5 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 6, msa, 6 ) );
             final List<MolecularSequence> l2 = new ArrayList<MolecularSequence>();
             l2.add( BasicSequence.createAaSequence( "1", "AAAAAAA" ) );
             l2.add( BasicSequence.createAaSequence( "2", "AAAIACC" ) );
@@ -6264,10 +6266,10 @@ public final class Test {
             l2.add( BasicSequence.createAaSequence( "21", "AAIIIIF" ) );
             l2.add( BasicSequence.createAaSequence( "22", "AIIIVVW" ) );
             final Msa msa2 = BasicMsa.createInstance( l2 );
-            System.out.println();
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa2, 0 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa2, 1 ) );
-            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa2, 2 ) );
+            //            System.out.println();
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa2, 0 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa2, 1 ) );
+            //            System.out.println( MsaMethods.calcNormalizedShannonsEntropy( 20, msa2, 2 ) );
         }
         catch ( final Exception e ) {
             e.printStackTrace( System.out );
@@ -7295,11 +7297,11 @@ public final class Test {
                 return false;
             }
             if ( !isEqual( 0.48039661496919533, phylogenies[ 0 ].getNode( "Diadocidia_spinosula" )
-                           .getDistanceToParent() ) ) {
+                    .getDistanceToParent() ) ) {
                 return false;
             }
             if ( !isEqual( 0.3959796191512233, phylogenies[ 0 ].getNode( "Diadocidia_stanfordensis" )
-                           .getDistanceToParent() ) ) {
+                    .getDistanceToParent() ) ) {
                 return false;
             }
             if ( !phylogenies[ 0 ].getName().equals( "Family Diadocidiidae MLT (Imported_tree_0)" ) ) {
@@ -8160,9 +8162,9 @@ public final class Test {
             final Phylogeny[] p11 = factory.create( "(A,B11);(C,D11) (E,F11)\t(G,H11)", new NHXParser() );
             final Phylogeny[] p12 = factory.create( "(A,B12) (C,D12) (E,F12) (G,H12)", new NHXParser() );
             final Phylogeny[] p13 = factory.create( " ; (;A; , ; B ; 1  3 ; \n)\t ( \n ;"
-                    + " C ; ,; D;13;);;;;;;(;E;,;F;13 ;) ; "
-                    + "; ; ( \t\n\r\b; G ;, ;H ;1 3; )  ;  ;   ;",
-                    new NHXParser() );
+                                                            + " C ; ,; D;13;);;;;;;(;E;,;F;13 ;) ; "
+                                                            + "; ; ( \t\n\r\b; G ;, ;H ;1 3; )  ;  ;   ;",
+                                                    new NHXParser() );
             if ( !p13[ 0 ].toNewHampshireX().equals( "(';A;',';B;13;')" ) ) {
                 return false;
             }
@@ -9005,7 +9007,7 @@ public final class Test {
             if ( !n7.toNewHampshire( true, PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS )
                     .equals( "'gks:dr-m4 \" ` `@:[]sadq04'" ) ) {
                 System.out.println( n7
-                                    .toNewHampshire( true, PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS ) );
+                        .toNewHampshire( true, PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS ) );
                 return false;
             }
         }
@@ -9450,14 +9452,11 @@ public final class Test {
             if ( !p11.toNewHampshireX().equals( "(('A: \"':0.2,B:0.3):0.5[&&NHX:B=91],C:0.1)root:0.1[&&NHX:B=100]" ) ) {
                 return false;
             }
-            final Phylogeny p12 = factory
-                    .create( "((A:0.2,B:0.3):0.5[&&NHX:B=91],C:0.1)root:0.1[&&NHX:B=100]",
-                             new NHXParser() )[ 0 ];
+            final Phylogeny p12 = factory.create( "((A:0.2,B:0.3):0.5[&&NHX:B=91],C:0.1)root:0.1[&&NHX:B=100]",
+                                                  new NHXParser() )[ 0 ];
             if ( !p12.toNewHampshireX().equals( "((A:0.2,B:0.3):0.5[&&NHX:B=91],C:0.1)root:0.1[&&NHX:B=100]" ) ) {
                 return false;
             }
-            
-            
         }
         catch ( final Exception e ) {
             e.printStackTrace( System.out );
@@ -9496,15 +9495,15 @@ public final class Test {
             }
             final Phylogeny p2 = factory
                     .create( "(1[something_else(?)s,prob=0.9500000000000000e+00{}(((,p)rob_stddev=0.110000000000e+00,"
-                            + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
-                            + "prob+-sd=\"100+-0\"]:4.129000000000000e-02[&length_mean=4.153987461671767e-02,"
-                            + "length_median=4.129000000000000e-02,length_95%HPD={3.217800000000000e-02,"
-                            + "5.026800000000000e-02}],2[&prob=0.810000000000000e+00,prob_stddev=0.000000000000000e+00,"
-                            + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
-                            + "prob+-sd=\"100+-0\"]:6.375699999999999e-02[&length_mean=6.395210411945065e-02,"
-                            + "length_median=6.375699999999999e-02,length_95%HPD={5.388600000000000e-02,"
-                            + "7.369400000000000e-02}])",
-                            new NHXParser() )[ 0 ];
+                                     + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
+                                     + "prob+-sd=\"100+-0\"]:4.129000000000000e-02[&length_mean=4.153987461671767e-02,"
+                                     + "length_median=4.129000000000000e-02,length_95%HPD={3.217800000000000e-02,"
+                                     + "5.026800000000000e-02}],2[&prob=0.810000000000000e+00,prob_stddev=0.000000000000000e+00,"
+                                     + "prob_range={1.000000000000000e+00,1.000000000000000e+00},prob(percent)=\"100\","
+                                     + "prob+-sd=\"100+-0\"]:6.375699999999999e-02[&length_mean=6.395210411945065e-02,"
+                                     + "length_median=6.375699999999999e-02,length_95%HPD={5.388600000000000e-02,"
+                                     + "7.369400000000000e-02}])",
+                             new NHXParser() )[ 0 ];
             if ( p2.getNode( "1" ) == null ) {
                 return false;
             }
@@ -10635,13 +10634,13 @@ public final class Test {
             // J. of Comput Bio. Vol. 4, No 2, pp.177-187
             final Phylogeny species6 = factory
                     .create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
-                            + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
-                            new NHXParser() )[ 0 ];
+                                     + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+                             new NHXParser() )[ 0 ];
             final Phylogeny gene6 = factory
                     .create( "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1,3:0.1[&&NHX:S=3])1-2-3:0.1,"
-                            + "((4:0.1[&&NHX:S=4],(5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.1)4-5-6:0.1,"
-                            + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],9:0.1[&&NHX:S=9])8-9:0.1)7-8-9:0.1)4-5-6-7-8-9:0.1)r;",
-                            new NHXParser() )[ 0 ];
+                                     + "((4:0.1[&&NHX:S=4],(5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.1)4-5-6:0.1,"
+                                     + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],9:0.1[&&NHX:S=9])8-9:0.1)7-8-9:0.1)4-5-6-7-8-9:0.1)r;",
+                             new NHXParser() )[ 0 ];
             species6.setRooted( true );
             gene6.setRooted( true );
             final SDI sdi6 = new SDI( gene6, species6 );
@@ -10975,15 +10974,15 @@ public final class Test {
             }
             final Phylogeny species6 = factory
                     .create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
-                            + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
-                            new NHXParser() )[ 0 ];
+                                     + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+                             new NHXParser() )[ 0 ];
             final Phylogeny gene6 = factory
                     .create( "((5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.05[&&NHX:S=6],(4:0.1[&&NHX:S=4],"
-                            + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
-                            + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
-                            + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
-                            + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
-                            new NHXParser() )[ 0 ];
+                                     + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
+                                     + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
+                                     + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
+                                     + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
+                             new NHXParser() )[ 0 ];
             species6.setRooted( true );
             gene6.setRooted( true );
             Phylogeny[] p6 = sdi_unrooted.infer( gene6, species6, false, true, true, true, 10 );
@@ -11029,15 +11028,15 @@ public final class Test {
             p6 = null;
             final Phylogeny species7 = factory
                     .create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
-                            + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
-                            new NHXParser() )[ 0 ];
+                                     + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+                             new NHXParser() )[ 0 ];
             final Phylogeny gene7 = factory
                     .create( "((5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.05[&&NHX:S=6],(4:0.1[&&NHX:S=4],"
-                            + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
-                            + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
-                            + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
-                            + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
-                            new NHXParser() )[ 0 ];
+                                     + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
+                                     + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
+                                     + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
+                                     + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
+                             new NHXParser() )[ 0 ];
             species7.setRooted( true );
             gene7.setRooted( true );
             Phylogeny[] p7 = sdi_unrooted.infer( gene7, species7, true, true, true, true, 10 );
@@ -11083,15 +11082,15 @@ public final class Test {
             p7 = null;
             final Phylogeny species8 = factory
                     .create( "(((1:[&&NHX:S=1],5:[&&NHX:S=5])1-5,((4:[&&NHX:S=4],6:[&&NHX:S=6])4-6,2:[&&NHX:S=2])4-6-2)1-5-4-6-2,"
-                            + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
-                            new NHXParser() )[ 0 ];
+                                     + "((9:[&&NHX:S=9],3:[&&NHX:S=3])9-3,(8:[&&NHX:S=8],7:[&&NHX:S=7])8-7)9-3-8-7)",
+                             new NHXParser() )[ 0 ];
             final Phylogeny gene8 = factory
                     .create( "((5:0.1[&&NHX:S=5],6:0.1[&&NHX:S=6])5-6:0.05[&&NHX:S=6],(4:0.1[&&NHX:S=4],"
-                            + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
-                            + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
-                            + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
-                            + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
-                            new NHXParser() )[ 0 ];
+                                     + "(((1:0.1[&&NHX:S=1],2:0.1[&&NHX:S=2])1-2:0.1[&&NHX:S=2],3:0.25[&&NHX:S=3])1-2-3:0.2[&&NHX:S=2],"
+                                     + "(7:0.1[&&NHX:S=7],(8:0.1[&&NHX:S=8],"
+                                     + "9:0.1[&&NHX:S=9])8-9:0.1[&&NHX:S=9])7-8-9:0.1[&&NHX:S=8])"
+                                     + "4-5-6-7-8-9:0.1[&&NHX:S=5])4-5-6:0.05[&&NHX:S=5])",
+                             new NHXParser() )[ 0 ];
             species8.setRooted( true );
             gene8.setRooted( true );
             Phylogeny[] p8 = sdi_unrooted.infer( gene8, species8, false, false, true, true, 10 );
@@ -12234,24 +12233,24 @@ public final class Test {
             final PhylogenyFactory factory = ParserBasedPhylogenyFactory.getInstance();
             final Phylogeny t0_1 = factory.create( "(((A,B),C),(D,E))", new NHXParser() )[ 0 ];
             final Phylogeny[] phylogenies_1 = factory.create( "(((A,B),C),(D,E)) " + "(((C,B),A),(D,E))"
-                    + "(((A,B),C),(D,E)) " + "(((A,B),C),(D,E))"
-                    + "(((A,B),C),(D,E))" + "(((C,B),A),(D,E))"
-                    + "(((E,B),D),(C,A))" + "(((C,B),A),(D,E))"
-                    + "(((A,B),C),(D,E))" + "(((A,B),C),(D,E))",
-                    new NHXParser() );
+                                                                      + "(((A,B),C),(D,E)) " + "(((A,B),C),(D,E))"
+                                                                      + "(((A,B),C),(D,E))" + "(((C,B),A),(D,E))"
+                                                                      + "(((E,B),D),(C,A))" + "(((C,B),A),(D,E))"
+                                                                      + "(((A,B),C),(D,E))" + "(((A,B),C),(D,E))",
+                                                              new NHXParser() );
             SupportCount.count( t0_1, phylogenies_1, true, false );
             final Phylogeny t0_2 = factory.create( "(((((A,B),C),D),E),(F,G))", new NHXParser() )[ 0 ];
             final Phylogeny[] phylogenies_2 = factory.create( "(((((A,B),C),D),E),(F,G))"
-                    + "(((((A,B),C),D),E),((F,G),X))"
-                    + "(((((A,Y),B),C),D),((F,G),E))"
-                    + "(((((A,B),C),D),E),(F,G))"
-                    + "(((((A,B),C),D),E),(F,G))"
-                    + "(((((A,B),C),D),E),(F,G))"
-                    + "(((((A,B),C),D),E),(F,G),Z)"
-                    + "(((((A,B),C),D),E),(F,G))"
-                    + "((((((A,B),C),D),E),F),G)"
-                    + "(((((X,Y),F,G),E),((A,B),C)),D)",
-                    new NHXParser() );
+                                                                      + "(((((A,B),C),D),E),((F,G),X))"
+                                                                      + "(((((A,Y),B),C),D),((F,G),E))"
+                                                                      + "(((((A,B),C),D),E),(F,G))"
+                                                                      + "(((((A,B),C),D),E),(F,G))"
+                                                                      + "(((((A,B),C),D),E),(F,G))"
+                                                                      + "(((((A,B),C),D),E),(F,G),Z)"
+                                                                      + "(((((A,B),C),D),E),(F,G))"
+                                                                      + "((((((A,B),C),D),E),F),G)"
+                                                                      + "(((((X,Y),F,G),E),((A,B),C)),D)",
+                                                              new NHXParser() );
             SupportCount.count( t0_2, phylogenies_2, true, false );
             final PhylogenyNodeIterator it = t0_2.iteratorPostorder();
             while ( it.hasNext() ) {
@@ -12663,7 +12662,7 @@ public final class Test {
 
     private static boolean testUniprotEntryRetrieval() {
         try {
-            final SequenceDatabaseEntry entry = SequenceDbWsTools.obtainUniProtEntry( "P12345", 200 );
+            final SequenceDatabaseEntry entry = SequenceDbWsTools.obtainUniProtEntry( "P12345", 5000 );
             if ( !entry.getAccession().equals( "P12345" ) ) {
                 return false;
             }
@@ -12682,12 +12681,16 @@ public final class Test {
             if ( !entry.getTaxonomyIdentifier().equals( "9986" ) ) {
                 return false;
             }
+            if ( entry.getMolecularSequence() == null ) {
+                return false;
+            }
             if ( !entry
                     .getMolecularSequence()
                     .getMolecularSequenceAsString()
                     .startsWith( "MALLHSARVLSGVASAFHPGLAAAASARASSWWAHVEMGPPDPILGVTEAYKRDTNSKKMNLGVGAYRDDNGKPYVLPSVRKAEAQIAAKGLDKEYLPIGGLAEFCRASAELALGENSEV" )
                     || !entry.getMolecularSequence().getMolecularSequenceAsString().endsWith( "LAHAIHQVTK" ) ) {
-                System.out.println( entry.getMolecularSequence().getMolecularSequenceAsString() );
+                System.out.println( "got: " + entry.getMolecularSequence().getMolecularSequenceAsString() );
+                System.out.println( "expected something else." );
                 return false;
             }
         }
@@ -12697,6 +12700,10 @@ public final class Test {
             e.printStackTrace( System.out );
             return true;
         }
+        catch ( final NullPointerException f ) {
+            f.printStackTrace( System.out );
+            return false;
+        }
         catch ( final Exception e ) {
             return false;
         }
index ba2346d..fa65992 100644 (file)
@@ -27,8 +27,8 @@ package org.forester.util;
 
 public final class ForesterConstants {
 
-    public final static String  FORESTER_VERSION            = "1.038";
-    public final static String  FORESTER_DATE               = "141014";
+    public final static String  FORESTER_VERSION            = "1.039";
+    public final static String  FORESTER_DATE               = "150513";
     public final static String  PHYLO_XML_VERSION           = "1.10";
     public final static String  PHYLO_XML_LOCATION          = "http://www.phyloxml.org";
     public final static String  PHYLO_XML_XSD               = "phyloxml.xsd";
index 82bcae9..aaa42aa 100644 (file)
@@ -43,28 +43,28 @@ public final class SequenceAccessionTools {
     //Protein:    3 letters + 5 numerals\r
     //http://www.ncbi.nlm.nih.gov/Sequin/acc.html\r
     public final static Pattern  GENBANK_NUC_PATTERN_1       = Pattern\r
-            .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
+                                                                     .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
     public final static Pattern  GENBANK_NUC_PATTERN_2       = Pattern\r
-            .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}\\d{6}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
+                                                                     .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}\\d{6}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
     public final static Pattern  GENBANK_PROT_PATTERN        = Pattern\r
-            .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{3}\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
+                                                                     .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{3}\\d{5}(?:\\.\\d+)?)(?:[^a-zA-Z0-9]|\\Z)" );\r
     public final static Pattern  GI_PATTERN                  = Pattern\r
-            .compile( "(?:\\b|_)(?:GI|gi)[|_=:](\\d+)(?:\\b|_)" );\r
+                                                                     .compile( "(?:\\b|_)(?:GI|gi)[|_=:](\\d+)(?:\\b|_)" );\r
     public final static String   UNIPROT_KB_BASE_PATTERN_STR = "((?:[OPQ][0-9][A-Z0-9]{3}[0-9])|(?:[A-NR-Z][0-9]([A-Z][A-Z0-9]{2}[0-9]){1,2}))";\r
     public final static Pattern  UNIPROT_KB_PATTERN_0        = Pattern.compile( "(?:\\b|_)"\r
-            + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
+                                                                     + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
     public final static Pattern  UNIPROT_KB_PATTERN_1        = Pattern.compile( "(?:\\b|_)(?:sp|tr)[\\.|\\-_=/\\\\]"\r
-            + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
+                                                                     + UNIPROT_KB_BASE_PATTERN_STR + "(?:\\b|_)" );\r
     public final static Pattern  UNIPROT_KB_PATTERN_2        = Pattern\r
-            .compile( "(?:\\b|_)(?:[A-Z0-9]{2,5}|"\r
-                    + UNIPROT_KB_BASE_PATTERN_STR\r
-                    + ")_(([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA)(?:\\b|_)" );\r
+                                                                     .compile( "(?:\\b|_)(?:[A-Z0-9]{2,5}|"\r
+                                                                             + UNIPROT_KB_BASE_PATTERN_STR\r
+                                                                             + ")_(([A-Z9][A-Z]{2}[A-Z0-9]{2})|RAT|PIG|PEA)(?:\\b|_)" );\r
     public final static Pattern  ENSEMBL_PATTERN             = Pattern.compile( "(?:\\b|_)(ENS[A-Z]*[0-9]+)(?:\\b|_)" );\r
     // RefSeq accession numbers can be distinguished from GenBank accessions\r
     // by their distinct prefix format of 2 characters followed by an\r
     // underscore character ('_'). For example, a RefSeq protein accession is NP_015325.\r
     private final static Pattern REFSEQ_PATTERN              = Pattern\r
-            .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}_\\d{6,})(?:[^a-zA-Z0-9]|\\Z)" );\r
+                                                                     .compile( "(?:\\A|.*[^a-zA-Z0-9])([A-Z]{2}_\\d{6,})(?:[^a-zA-Z0-9]|\\Z)" );\r
 \r
     private SequenceAccessionTools() {\r
         // Hiding the constructor.\r
index 8c2ce9a..96a2eb1 100644 (file)
@@ -39,6 +39,7 @@ import org.forester.util.ForesterUtil;
 
 public final class EbiDbEntry implements SequenceDatabaseEntry {
 
+    private final static boolean  DEBUG = false;
     private SortedSet<Annotation> _annotations;
     private String                _chromosome;
     private SortedSet<Accession>  _cross_references;
@@ -394,7 +395,9 @@ public final class EbiDbEntry implements SequenceDatabaseEntry {
         if ( _cross_references == null ) {
             _cross_references = new TreeSet<Accession>();
         }
-        System.out.println( "XREF ADDED: " + accession );
+        if ( DEBUG ) {
+            System.out.println( "XREF ADDED: " + accession );
+        }
         _cross_references.add( accession );
     }
 
index c2d2bd5..4eba410 100644 (file)
@@ -62,14 +62,14 @@ public final class SequenceDbWsTools {
     public final static String   EMBL_GENBANK               = "http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=GENBANK&style=raw&id=";
     public final static String   EMBL_REFSEQ                = "http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=REFSEQ&style=raw&id=";
     public final static String   EMBL_EMBL                  = "http://www.ebi.ac.uk/Tools/dbfetch/dbfetch?db=EMBL&style=raw&id=";
-    private final static boolean DEBUG                      = true;
+    private final static boolean DEBUG                      = false;
     private final static String  URL_ENC                    = "UTF-8";
     private final static int     SLEEP                      = 200;
     private static final boolean ALLOW_TO_OVERWRITE_MOL_SEQ = false;
 
     public static List<UniProtTaxonomy> getTaxonomiesFromCommonNameStrict( final String cn,
                                                                            final int max_taxonomies_return )
-                                                                                   throws IOException {
+            throws IOException {
         final List<UniProtTaxonomy> taxonomies = getTaxonomiesFromCommonName( cn, max_taxonomies_return );
         if ( ( taxonomies != null ) && ( taxonomies.size() > 0 ) ) {
             final List<UniProtTaxonomy> filtered_taxonomies = new ArrayList<UniProtTaxonomy>();
@@ -100,7 +100,7 @@ public final class SequenceDbWsTools {
      */
     public static List<UniProtTaxonomy> getTaxonomiesFromScientificNameStrict( final String sn,
                                                                                final int max_taxonomies_return )
-                                                                                       throws IOException {
+            throws IOException {
         final List<UniProtTaxonomy> taxonomies = getTaxonomiesFromScientificName( sn, max_taxonomies_return );
         if ( ( taxonomies != null ) && ( taxonomies.size() > 0 ) ) {
             final List<UniProtTaxonomy> filtered_taxonomies = new ArrayList<UniProtTaxonomy>();
@@ -116,7 +116,7 @@ public final class SequenceDbWsTools {
 
     public static List<UniProtTaxonomy> getTaxonomiesFromTaxonomyCode( final String code,
                                                                        final int max_taxonomies_return )
-                                                                               throws IOException {
+            throws IOException {
         final String my_code = new String( code );
         final List<String> result = getTaxonomyStringFromTaxonomyCode( my_code, max_taxonomies_return );
         if ( result.size() > 0 ) {
@@ -142,7 +142,7 @@ public final class SequenceDbWsTools {
         final Accession acc = SequenceAccessionTools.parseAccessorFromString( acc_str );
         if ( acc == null ) {
             throw new IllegalArgumentException( "could not extract acceptable sequence db accessor from \"" + acc_str
-                                                + "\"" );
+                    + "\"" );
         }
         if ( acc.getSource().equals( Source.REFSEQ.toString() ) || acc.getSource().equals( Source.EMBL.toString() )
                 || acc.getSource().equals( Source.NCBI.toString() ) ) {
@@ -153,7 +153,7 @@ public final class SequenceDbWsTools {
         }
         else {
             throw new IllegalArgumentException( "don't know how to handle request for source \"" + acc.getSource()
-                                                + "\"" );
+                    + "\"" );
         }
     }
 
@@ -263,7 +263,9 @@ public final class SequenceDbWsTools {
     public static List<String> queryEmblDb( final Accession acc, final int max_lines_to_return ) throws IOException {
         final StringBuilder url_sb = new StringBuilder();
         //  url_sb.append( BASE_EMBL_DB_URL );
-        System.out.println( "source: " + acc.getSource() );
+        if ( DEBUG ) {
+            System.out.println( "source: " + acc.getSource() );
+        }
         if ( acc.getSource().equals( Source.NCBI.toString() ) ) {
             url_sb.append( EMBL_GENBANK );
             //url_sb.append( '/' );
@@ -454,7 +456,7 @@ public final class SequenceDbWsTools {
 
     private static List<UniProtTaxonomy> getTaxonomiesFromScientificName( final String sn,
                                                                           final int max_taxonomies_return )
-                                                                                  throws IOException {
+            throws IOException {
         final List<String> result = getTaxonomyStringFromScientificName( sn, max_taxonomies_return );
         if ( result.size() > 0 ) {
             return parseUniProtTaxonomy( result );
@@ -486,7 +488,7 @@ public final class SequenceDbWsTools {
         return ( !( ( acc == null ) || ForesterUtil.isEmpty( acc.getSource() ) || ForesterUtil.isEmpty( acc.getValue() ) || ( ( acc
                 .getSource().equals( Source.UNIPROT.toString() ) )
                 && ( acc.getSource().toString().equals( Source.EMBL.toString() ) ) && ( acc.getSource().toString()
-                        .equals( Source.REFSEQ.toString() ) ) ) ) );
+                .equals( Source.REFSEQ.toString() ) ) ) ) );
     }
 
     private static List<UniProtTaxonomy> parseUniProtTaxonomy( final List<String> result ) throws IOException {
index 3f0df32..f0ebf04 100644 (file)
@@ -42,20 +42,19 @@ import org.forester.util.ForesterUtil;
 
 public final class UniProtEntry implements SequenceDatabaseEntry {
 
-    public final static Pattern  BindingDB_PATTERN = Pattern.compile( "BindingDB;\\s+([0-9A-Z]+);" );
-    public final static Pattern  CTD_PATTERN       = Pattern.compile( "CTD;\\s+(\\d+);" );
-    public final static Pattern  DrugBank_PATTERN  = Pattern.compile( "DrugBank;\\s+([0-9A-Z]+);\\s+([^\\.]+)" );
-    public final static Pattern  GO_PATTERN        = Pattern.compile( "GO;\\s+(GO:\\d+);\\s+([PFC]):([^;]+);" );
-    public final static Pattern  KEGG_PATTERN      = Pattern.compile( "KEGG;\\s+([a-z]+:[0-9]+);" );
-    public final static Pattern  MIM_PATTERN       = Pattern.compile( "MIM;\\s+(\\d+);" );
-    public final static Pattern  NextBio_PATTERN   = Pattern.compile( "NextBio;\\s+(\\d+);" );
-    public final static Pattern  Orphanet_PATTERN  = Pattern.compile( "Orphanet;\\s+(\\d+);\\s+([^\\.]+)" );
-    public final static Pattern  PDB_PATTERN       = Pattern.compile( "PDB;\\s+([0-9A-Z]{4});\\s+([^;]+)" );
-    public final static Pattern  PharmGKB_PATTERN  = Pattern.compile( "PharmGKB;\\s+([0-9A-Z]+);" );
-    public final static Pattern  Reactome_PATTERN  = Pattern.compile( "Reactome;\\s+([0-9A-Z]+);\\s+([^\\.]+)" );
-    public final static Pattern  HGNC_PATTERN      = Pattern.compile( "HGNC;\\s+HGNC:(\\d+);" );
-    public final static Pattern  NCBI_TAXID_PATTERN= Pattern.compile( "NCBI_TaxID=(\\d+)" );
-    
+    public final static Pattern  BindingDB_PATTERN  = Pattern.compile( "BindingDB;\\s+([0-9A-Z]+);" );
+    public final static Pattern  CTD_PATTERN        = Pattern.compile( "CTD;\\s+(\\d+);" );
+    public final static Pattern  DrugBank_PATTERN   = Pattern.compile( "DrugBank;\\s+([0-9A-Z]+);\\s+([^\\.]+)" );
+    public final static Pattern  GO_PATTERN         = Pattern.compile( "GO;\\s+(GO:\\d+);\\s+([PFC]):([^;]+);" );
+    public final static Pattern  KEGG_PATTERN       = Pattern.compile( "KEGG;\\s+([a-z]+:[0-9]+);" );
+    public final static Pattern  MIM_PATTERN        = Pattern.compile( "MIM;\\s+(\\d+);" );
+    public final static Pattern  NextBio_PATTERN    = Pattern.compile( "NextBio;\\s+(\\d+);" );
+    public final static Pattern  Orphanet_PATTERN   = Pattern.compile( "Orphanet;\\s+(\\d+);\\s+([^\\.]+)" );
+    public final static Pattern  PDB_PATTERN        = Pattern.compile( "PDB;\\s+([0-9A-Z]{4});\\s+([^;]+)" );
+    public final static Pattern  PharmGKB_PATTERN   = Pattern.compile( "PharmGKB;\\s+([0-9A-Z]+);" );
+    public final static Pattern  Reactome_PATTERN   = Pattern.compile( "Reactome;\\s+([0-9A-Z]+);\\s+([^\\.]+)" );
+    public final static Pattern  HGNC_PATTERN       = Pattern.compile( "HGNC;\\s+HGNC:(\\d+);" );
+    public final static Pattern  NCBI_TAXID_PATTERN = Pattern.compile( "NCBI_TaxID=(\\d+)" );
     private String               _ac;
     private SortedSet<Accession> _cross_references;
     private String               _gene_name;
@@ -125,7 +124,7 @@ public final class UniProtEntry implements SequenceDatabaseEntry {
                 && ForesterUtil.isEmpty( getTaxonomyScientificName() ) && ForesterUtil.isEmpty( getSequenceSymbol() )
                 && ForesterUtil.isEmpty( getGeneName() ) && ForesterUtil.isEmpty( getTaxonomyIdentifier() )
                 && ForesterUtil.isEmpty( getSequenceSymbol() ) && ( ( getGoTerms() == null ) || getGoTerms().isEmpty() ) && ( ( getCrossReferences() == null ) || getCrossReferences()
-                        .isEmpty() ) );
+                .isEmpty() ) );
     }
 
     private void addCrossReference( final Accession accession ) {
@@ -186,13 +185,12 @@ public final class UniProtEntry implements SequenceDatabaseEntry {
         final StringBuffer sq_buffer = new StringBuffer();
         boolean is_aa = false;
         for( final String line : lines ) {
-            //System.out.println( line );
             if ( line.startsWith( "AC" ) ) {
                 e.setAc( SequenceDbWsTools.extractFromTo( line, "AC", ";" ) );
             }
             else if ( line.startsWith( "DE" ) && ForesterUtil.isEmpty( e.getSequenceName() ) ) {
                 if ( ( line.indexOf( "RecName:" ) > 0 ) && ( line.indexOf( "Full=" ) > 0 ) ) {
-                    if ( line.indexOf( "{" ) > 0  ) {
+                    if ( line.indexOf( "{" ) > 0 ) {
                         e.setSequenceName( SequenceDbWsTools.extractFromTo( line, "Full=", "{" ) );
                     }
                     else {
@@ -200,30 +198,27 @@ public final class UniProtEntry implements SequenceDatabaseEntry {
                     }
                 }
                 else if ( ( line.indexOf( "SubName:" ) > 0 ) && ( line.indexOf( "Full=" ) > 0 ) ) {
-                    if ( line.indexOf( "{" ) > 0  ) {
+                    if ( line.indexOf( "{" ) > 0 ) {
                         e.setSequenceName( SequenceDbWsTools.extractFromTo( line, "Full=", "{" ) );
                     }
                     else {
                         e.setSequenceName( SequenceDbWsTools.extractFromTo( line, "Full=", ";" ) );
                     }
-                    
                 }
             }
             else if ( line.startsWith( "DE" ) && ForesterUtil.isEmpty( e.getSequenceSymbol() ) ) {
-              
                 if ( line.indexOf( "Short=" ) > 0 ) {
-                    if ( line.indexOf( "{" ) > 0  ) {
+                    if ( line.indexOf( "{" ) > 0 ) {
                         e.setSequenceSymbol( SequenceDbWsTools.extractFromTo( line, "Short=", "{" ) );
                     }
                     else {
                         e.setSequenceSymbol( SequenceDbWsTools.extractFromTo( line, "Short=", ";" ) );
                     }
-                   
                 }
             }
             else if ( line.startsWith( "GN" ) && ForesterUtil.isEmpty( e.getGeneName() ) ) {
                 if ( line.indexOf( "Name=" ) > 0 ) {
-                    if ( line.indexOf( "{" ) > 0  ) {
+                    if ( line.indexOf( "{" ) > 0 ) {
                         e.setGeneName( SequenceDbWsTools.extractFromTo( line, "Name=", "{" ) );
                     }
                     else {
@@ -341,8 +336,13 @@ public final class UniProtEntry implements SequenceDatabaseEntry {
                 sq_buffer.append( line.replaceAll( "\\s+", "" ) );
             }
         }
-        if ( ( sq_buffer.length() > 0 ) && is_aa ) {
-            e.setMolecularSequence( BasicSequence.createAaSequence( e.getAccession(), sq_buffer.toString() ) );
+        if ( sq_buffer.length() > 0 ) {
+            if ( is_aa ) {
+                e.setMolecularSequence( BasicSequence.createAaSequence( e.getAccession(), sq_buffer.toString() ) );
+            }
+            else {
+                e.setMolecularSequence( BasicSequence.createDnaSequence( e.getAccession(), sq_buffer.toString() ) );
+            }
         }
         return e;
     }
index a9b966d..9dfe65d 100644 (file)
                   <name>bc seq</name>
                   <domain_architecture length="124">
                      <domain from="120" to="130" confidence="0.9" id=""> A </domain>
-                     <domain from="21" to="44" confidence="2144" id="pfam"> B </domain>
+                     <domain from="21" to="44" confidence="0" id="pfam"> B </domain>
                      <domain to="43" confidence="1.0E-89" from="34" id=""> C </domain>
-                     <domain id="123" from="34" to="43" confidence="-1.3e-34"> D </domain>
+                     <domain id="123" from="34" to="43" confidence="1.3e-34"> D </domain>
                   </domain_architecture>
                </sequence>
                <date>