From 8cb65713b89737f529cedce7bcd39f2b9f9fc8a1 Mon Sep 17 00:00:00 2001 From: "cmzmasek@gmail.com" Date: Wed, 21 Dec 2011 00:11:52 +0000 Subject: [PATCH] in progress --- .../org/forester/archaeopteryx/ArchaeopteryxE.java | 6 +- .../src/org/forester/archaeopteryx/Constants.java | 4 +- .../src/org/forester/archaeopteryx/MainFrame.java | 121 ++++++++++++-------- .../archaeopteryx/MainFrameApplication.java | 19 ++- .../src/org/forester/archaeopteryx/Options.java | 91 +++++++-------- .../src/org/forester/io/parsers/nhx/NHXParser.java | 4 +- .../java/src/org/forester/phylogeny/Phylogeny.java | 4 + .../org/forester/phylogeny/PhylogenyMethods.java | 2 +- 8 files changed, 142 insertions(+), 109 deletions(-) diff --git a/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java b/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java index 6d96616..7ba34f4 100644 --- a/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java +++ b/forester/java/src/org/forester/archaeopteryx/ArchaeopteryxE.java @@ -333,7 +333,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { case NHX: return getMainPanel().getCurrentPhylogeny().toNewHampshireX(); case NEXUS: - return getMainPanel().getCurrentPhylogeny().toNexus( false ); + return getMainPanel().getCurrentPhylogeny().toNexus(); case PHYLOXML: return getMainPanel().getCurrentPhylogeny().toPhyloXML( -1 ); default: @@ -1068,7 +1068,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { || ( getMainPanel().getCurrentPhylogeny().getNumberOfExternalNodes() > 10000 ) ) { return; } - _textframe = TextFrame.instantiate( getMainPanel().getCurrentPhylogeny().toNexus( false ) ); + _textframe = TextFrame.instantiate( getMainPanel().getCurrentPhylogeny().toNexus() ); } void viewAsNH() { @@ -1077,7 +1077,7 @@ public class ArchaeopteryxE extends JApplet implements ActionListener { || ( getMainPanel().getCurrentPhylogeny().getNumberOfExternalNodes() > 10000 ) ) { return; } - _textframe = TextFrame.instantiate( getMainPanel().getCurrentPhylogeny().toNewHampshire( false, false ) ); + _textframe = TextFrame.instantiate( getMainPanel().getCurrentPhylogeny().toNewHampshire() ); } void viewAsNHX() { diff --git a/forester/java/src/org/forester/archaeopteryx/Constants.java b/forester/java/src/org/forester/archaeopteryx/Constants.java index da8bf0c..00511a7 100644 --- a/forester/java/src/org/forester/archaeopteryx/Constants.java +++ b/forester/java/src/org/forester/archaeopteryx/Constants.java @@ -41,8 +41,8 @@ public final class Constants { public final static boolean __SNAPSHOT_RELEASE = true; // TODO remove me public final static boolean __SYNTH_LF = false; // TODO remove me public final static String PRG_NAME = "Archaeopteryx"; - final static String VERSION = "0.966 beta T2P"; - final static String PRG_DATE = "2011.12.15"; + final static String VERSION = "0.967 beta T2P"; + final static String PRG_DATE = "2011.12.20"; final static String DEFAULT_CONFIGURATION_FILE_NAME = "_aptx_configuration_file"; final static String[] DEFAULT_FONT_CHOICES = { "Verdana", "Tahoma", "Arial", "Helvetica", "Dialog", "Lucida Sans", "SansSerif", "Sans-serif", "Sans" }; diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrame.java b/forester/java/src/org/forester/archaeopteryx/MainFrame.java index 2aaf8fc..6b4c096 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrame.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrame.java @@ -47,6 +47,7 @@ import org.forester.archaeopteryx.Options.CLADOGRAM_TYPE; import org.forester.archaeopteryx.Options.NODE_LABEL_DIRECTION; import org.forester.archaeopteryx.Options.PHYLOGENY_GRAPHICS_TYPE; import org.forester.phylogeny.Phylogeny; +import org.forester.phylogeny.PhylogenyNodeI.NH_CONVERSION_SUPPORT_VALUE_STYLE; import org.forester.phylogeny.data.NodeVisualization.NodeFill; import org.forester.phylogeny.data.NodeVisualization.NodeShape; import org.forester.util.ForesterConstants; @@ -54,50 +55,51 @@ import org.forester.util.ForesterUtil; public abstract class MainFrame extends JFrame implements ActionListener { - static final String USE_MOUSEWHEEL_SHIFT_TO_ROTATE = "In this display type, use mousewheel + Shift to rotate [or A and S]"; - static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME - static final String APTX_REF_TOOL_TIP = Constants.APTX_REFERENCE; - private static final long serialVersionUID = 3655000897845508358L; - final static Font menu_font = new Font( Configuration.getDefaultFontFamilyName(), - Font.PLAIN, - 10 ); - static final String TYPE_MENU_HEADER = "Type"; - static final String RECTANGULAR_TYPE_CBMI_LABEL = "Rectangular"; - static final String EURO_TYPE_CBMI_LABEL = "Euro Type"; - static final String CURVED_TYPE_CBMI_LABEL = "Curved"; - static final String TRIANGULAR_TYPE_CBMI_LABEL = "Triangular"; - static final String CONVEX_TYPE_CBMI_LABEL = "Convex"; - static final String ROUNDED_TYPE_CBMI_LABEL = "Rounded"; - static final String UNROOTED_TYPE_CBMI_LABEL = "Unrooted (alpha)"; //TODO - static final String CIRCULAR_TYPE_CBMI_LABEL = "Circular (alpha)"; //TODO - static final String OPTIONS_HEADER = "Options"; - static final String SEARCH_SUBHEADER = "Search:"; - static final String DISPLAY_SUBHEADER = "Display:"; - static final String SEARCH_TERMS_ONLY_LABEL = "Match Complete Terms Only"; - static final String SEARCH_CASE_SENSITIVE_LABEL = "Case Sensitive"; - static final String INVERSE_SEARCH_RESULT_LABEL = "Negate Result"; - static final String DISPLAY_BRANCH_LENGTH_VALUES_LABEL = "Display Branch Length Values"; - static final String DISPLAY_SCALE_LABEL = "Display Scale"; - static final String NON_LINED_UP_CLADOGRAMS_LABEL = "Non-Lined Up Cladograms"; - static final String UNIFORM_CLADOGRAMS_LABEL = "Total Node Sum Dependent Cladograms"; - static final String LABEL_DIRECTION_LABEL = "Radial Labels"; - static final String LABEL_DIRECTION_TIP = "To use radial node labels in radial and unrooted display types"; - static final String SCREEN_ANTIALIAS_LABEL = "Antialias"; - static final String COLOR_LABELS_LABEL = "Colorize Labels Same as Parent Branch"; - static final String BG_GRAD_LABEL = "Background Color Gradient"; - static final String DISPLAY_NODE_BOXES_LABEL = "Show Node Shapes"; - static final String SHOW_OVERVIEW_LABEL = "Show Overview"; - static final String FONT_SIZE_MENU_LABEL = "Font Size"; - static final String NONUNIFORM_CLADOGRAMS_LABEL = "External Node Sum Dependent Cladograms"; - static final String SHOW_DOMAIN_LABELS_LABEL = "Show Domain Labels"; - static final String COLOR_LABELS_TIP = "To use parent branch colors for node labels as well, need to turn off taxonomy dependent colorization and turn on branch colorization for this to become apparent"; - static final String ABBREV_SN_LABEL = "Abbreviate Scientific Taxonomic Names"; - static final String TAXONOMY_COLORIZE_NODE_SHAPES_LABEL = "Colorize Node Shapes According to Taxonomy"; - static final String CYCLE_NODE_SHAPE_LABEL = "Cycle Node Shapes"; - static final String CYCLE_NODE_FILL_LABEL = "Cycle Node Fill Type"; - static final String CHOOSE_NODE_SIZE_LABEL = "Choose Node Shape Size"; - static final String SHOW_CONF_STDDEV_LABEL = "Show Confidence Standard Deviations"; - static final String USE_BRACKETS_FOR_CONF_IN_NH_LABEL = "Brackets for Confidences in NH/Nexus Output"; + static final String USE_MOUSEWHEEL_SHIFT_TO_ROTATE = "In this display type, use mousewheel + Shift to rotate [or A and S]"; + static final String PHYLOXML_REF_TOOL_TIP = Constants.PHYLOXML_REFERENCE; //TODO //FIXME + static final String APTX_REF_TOOL_TIP = Constants.APTX_REFERENCE; + private static final long serialVersionUID = 3655000897845508358L; + final static Font menu_font = new Font( Configuration.getDefaultFontFamilyName(), + Font.PLAIN, + 10 ); + static final String TYPE_MENU_HEADER = "Type"; + static final String RECTANGULAR_TYPE_CBMI_LABEL = "Rectangular"; + static final String EURO_TYPE_CBMI_LABEL = "Euro Type"; + static final String CURVED_TYPE_CBMI_LABEL = "Curved"; + static final String TRIANGULAR_TYPE_CBMI_LABEL = "Triangular"; + static final String CONVEX_TYPE_CBMI_LABEL = "Convex"; + static final String ROUNDED_TYPE_CBMI_LABEL = "Rounded"; + static final String UNROOTED_TYPE_CBMI_LABEL = "Unrooted (alpha)"; //TODO + static final String CIRCULAR_TYPE_CBMI_LABEL = "Circular (alpha)"; //TODO + static final String OPTIONS_HEADER = "Options"; + static final String SEARCH_SUBHEADER = "Search:"; + static final String DISPLAY_SUBHEADER = "Display:"; + static final String SEARCH_TERMS_ONLY_LABEL = "Match Complete Terms Only"; + static final String SEARCH_CASE_SENSITIVE_LABEL = "Case Sensitive"; + static final String INVERSE_SEARCH_RESULT_LABEL = "Negate Result"; + static final String DISPLAY_BRANCH_LENGTH_VALUES_LABEL = "Display Branch Length Values"; + static final String DISPLAY_SCALE_LABEL = "Display Scale"; + static final String NON_LINED_UP_CLADOGRAMS_LABEL = "Non-Lined Up Cladograms"; + static final String UNIFORM_CLADOGRAMS_LABEL = "Total Node Sum Dependent Cladograms"; + static final String LABEL_DIRECTION_LABEL = "Radial Labels"; + static final String LABEL_DIRECTION_TIP = "To use radial node labels in radial and unrooted display types"; + static final String SCREEN_ANTIALIAS_LABEL = "Antialias"; + static final String COLOR_LABELS_LABEL = "Colorize Labels Same as Parent Branch"; + static final String BG_GRAD_LABEL = "Background Color Gradient"; + static final String DISPLAY_NODE_BOXES_LABEL = "Show Node Shapes"; + static final String SHOW_OVERVIEW_LABEL = "Show Overview"; + static final String FONT_SIZE_MENU_LABEL = "Font Size"; + static final String NONUNIFORM_CLADOGRAMS_LABEL = "External Node Sum Dependent Cladograms"; + static final String SHOW_DOMAIN_LABELS_LABEL = "Show Domain Labels"; + static final String COLOR_LABELS_TIP = "To use parent branch colors for node labels as well, need to turn off taxonomy dependent colorization and turn on branch colorization for this to become apparent"; + static final String ABBREV_SN_LABEL = "Abbreviate Scientific Taxonomic Names"; + static final String TAXONOMY_COLORIZE_NODE_SHAPES_LABEL = "Colorize Node Shapes According to Taxonomy"; + static final String CYCLE_NODE_SHAPE_LABEL = "Cycle Node Shapes"; + static final String CYCLE_NODE_FILL_LABEL = "Cycle Node Fill Type"; + static final String CHOOSE_NODE_SIZE_LABEL = "Choose Node Shape Size"; + static final String SHOW_CONF_STDDEV_LABEL = "Show Confidence Standard Deviations"; + static final String USE_BRACKETS_FOR_CONF_IN_NH_LABEL = "Use Brackets for Confidence Values"; + static final String USE_INTERNAL_NAMES_FOR_CONF_IN_NH_LABEL = "Use Internal Node Names for Confidence Values"; JMenuBar _jmenubar; JMenu _file_jmenu; JMenu _tools_menu; @@ -121,7 +123,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { JMenuItem _color_rank_jmi; JMenuItem _infer_common_sn_names_item; JMenuItem _collapse_species_specific_subtrees; - JMenuItem _collapse_below_threshold; //TODO implememt me + JMenuItem _collapse_below_threshold; //TODO implememt me JMenuItem _obtain_detailed_taxonomic_information_jmi; JMenuItem _obtain_detailed_taxonomic_information_deleting_jmi; JMenuItem _obtain_uniprot_seq_information_jmi; @@ -146,7 +148,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { JRadioButtonMenuItem _uniform_cladograms_rbmi; JRadioButtonMenuItem _ext_node_dependent_cladogram_rbmi; JCheckBoxMenuItem _show_branch_length_values_cbmi; - JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me + JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me JCheckBoxMenuItem _show_overview_cbmi; JCheckBoxMenuItem _show_domain_labels; JCheckBoxMenuItem _abbreviate_scientific_names; @@ -172,6 +174,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { JCheckBoxMenuItem _extract_pfam_style_tax_codes_cbmi; JCheckBoxMenuItem _replace_underscores_cbmi; JCheckBoxMenuItem _use_brackets_for_conf_in_nh_export_cbmi; + JCheckBoxMenuItem _use_internal_names_for_conf_in_nh_export_cbmi; // _ search JCheckBoxMenuItem _search_case_senstive_cbmi; JCheckBoxMenuItem _search_whole_words_only_cbmi; @@ -389,6 +392,15 @@ public abstract class MainFrame extends JFrame implements ActionListener { updateOptions( getOptions() ); } else if ( o == _use_brackets_for_conf_in_nh_export_cbmi ) { + if ( _use_brackets_for_conf_in_nh_export_cbmi.isSelected() ) { + _use_internal_names_for_conf_in_nh_export_cbmi.setSelected( false ); + } + updateOptions( getOptions() ); + } + else if ( o == _use_internal_names_for_conf_in_nh_export_cbmi ) { + if ( _use_internal_names_for_conf_in_nh_export_cbmi.isSelected() ) { + _use_brackets_for_conf_in_nh_export_cbmi.setSelected( false ); + } updateOptions( getOptions() ); } else if ( o == _label_direction_cbmi ) { @@ -976,8 +988,17 @@ public abstract class MainFrame extends JFrame implements ActionListener { options.setGraphicsExportUsingActualSize( ( _graphics_export_using_actual_size_cbmi != null ) && ( _graphics_export_using_actual_size_cbmi.isSelected() ) ); options.setAntialiasPrint( ( _antialias_print_cbmi != null ) && _antialias_print_cbmi.isSelected() ); - options.setUseBracketsForConfInNhExport( ( _use_brackets_for_conf_in_nh_export_cbmi != null ) - && _use_brackets_for_conf_in_nh_export_cbmi.isSelected() ); + if ( ( _use_brackets_for_conf_in_nh_export_cbmi != null ) + && _use_brackets_for_conf_in_nh_export_cbmi.isSelected() ) { + options.setNhConversionSupportValueStyle( NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS ); + } + else if ( ( _use_internal_names_for_conf_in_nh_export_cbmi != null ) + && _use_internal_names_for_conf_in_nh_export_cbmi.isSelected() ) { + options.setNhConversionSupportValueStyle( NH_CONVERSION_SUPPORT_VALUE_STYLE.AS_INTERNAL_NODE_NAMES ); + } + else { + options.setNhConversionSupportValueStyle( NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE ); + } options.setPrintBlackAndWhite( ( _print_black_and_white_cbmi != null ) && _print_black_and_white_cbmi.isSelected() ); options.setInternalNumberAreConfidenceForNhParsing( ( _internal_number_are_confidence_for_nh_parsing_cbmi != null ) @@ -1045,7 +1066,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { return; } _textframe = TextFrame.instantiate( _mainpanel.getCurrentPhylogeny().toNexus( getOptions() - .isUseBracketsForConfInNhExport() ) ); + .getNhConversionSupportValueStyle() ) ); } void viewAsNH() { @@ -1055,7 +1076,7 @@ public abstract class MainFrame extends JFrame implements ActionListener { return; } _textframe = TextFrame.instantiate( _mainpanel.getCurrentPhylogeny() - .toNewHampshire( false, getOptions().isUseBracketsForConfInNhExport() ) ); + .toNewHampshire( false, getOptions().getNhConversionSupportValueStyle() ) ); } void viewAsNHX() { diff --git a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java index 10d1a56..20c775d 100644 --- a/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java +++ b/forester/java/src/org/forester/archaeopteryx/MainFrameApplication.java @@ -88,6 +88,7 @@ import org.forester.msa.MsaFormatException; import org.forester.phylogeny.Phylogeny; import org.forester.phylogeny.PhylogenyMethods; import org.forester.phylogeny.PhylogenyNode; +import org.forester.phylogeny.PhylogenyNodeI.NH_CONVERSION_SUPPORT_VALUE_STYLE; import org.forester.phylogeny.data.Confidence; import org.forester.phylogeny.data.Taxonomy; import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory; @@ -828,15 +829,19 @@ public final class MainFrameApplication extends MainFrame { _options_jmenu.add( _print_size_mi = new JMenuItem( "" ) ); _options_jmenu.add( _choose_pdf_width_mi = new JMenuItem( "" ) ); _options_jmenu.addSeparator(); - _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/NHX/Nexus Input/Output:" ), - getConfiguration() ) ); + _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/NHX/Nexus Input:" ), getConfiguration() ) ); _options_jmenu - .add( _internal_number_are_confidence_for_nh_parsing_cbmi = new JCheckBoxMenuItem( "Internal Numbers Are Confidence Values" ) ); + .add( _internal_number_are_confidence_for_nh_parsing_cbmi = new JCheckBoxMenuItem( "Internal Node Names are Confidence Values" ) ); _options_jmenu.add( _replace_underscores_cbmi = new JCheckBoxMenuItem( "Replace Underscores with Spaces" ) ); _options_jmenu .add( _extract_pfam_style_tax_codes_cbmi = new JCheckBoxMenuItem( "Extract Taxonomy Codes from Pfam-style Labels" ) ); + _options_jmenu.add( customizeMenuItemAsLabel( new JMenuItem( "Newick/Nexus Output:" ), getConfiguration() ) ); _options_jmenu .add( _use_brackets_for_conf_in_nh_export_cbmi = new JCheckBoxMenuItem( USE_BRACKETS_FOR_CONF_IN_NH_LABEL ) ); + _use_brackets_for_conf_in_nh_export_cbmi + .setToolTipText( "e.g. \"0.1[90]\" for a branch with support 90 and a length of 0.1" ); + _options_jmenu + .add( _use_internal_names_for_conf_in_nh_export_cbmi = new JCheckBoxMenuItem( USE_INTERNAL_NAMES_FOR_CONF_IN_NH_LABEL ) ); customizeJMenuItem( _choose_font_mi ); customizeJMenuItem( _choose_minimal_confidence_mi ); customizeJMenuItem( _switch_colors_mi ); @@ -880,7 +885,9 @@ public final class MainFrameApplication extends MainFrame { .isGraphicsExportUsingActualSize() ); customizeCheckBoxMenuItem( _show_confidence_stddev_cbmi, getOptions().isShowConfidenceStddev() ); customizeCheckBoxMenuItem( _use_brackets_for_conf_in_nh_export_cbmi, getOptions() - .isUseBracketsForConfInNhExport() ); + .getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.IN_SQUARE_BRACKETS ); + customizeCheckBoxMenuItem( _use_internal_names_for_conf_in_nh_export_cbmi, getOptions() + .getNhConversionSupportValueStyle() == NH_CONVERSION_SUPPORT_VALUE_STYLE.AS_INTERNAL_NODE_NAMES ); _jmenubar.add( _options_jmenu ); } @@ -2318,7 +2325,7 @@ public final class MainFrameApplication extends MainFrame { private boolean writeAsNewHampshire( final Phylogeny t, boolean exception, final File file ) { try { final PhylogenyWriter writer = new PhylogenyWriter(); - writer.toNewHampshire( t, false, true, getOptions().isUseBracketsForConfInNhExport(), file ); + writer.toNewHampshire( t, false, true, getOptions().getNhConversionSupportValueStyle(), file ); } catch ( final Exception e ) { exception = true; @@ -2330,7 +2337,7 @@ public final class MainFrameApplication extends MainFrame { private boolean writeAsNexus( final Phylogeny t, boolean exception, final File file ) { try { final PhylogenyWriter writer = new PhylogenyWriter(); - writer.toNexus( file, t, getOptions().isUseBracketsForConfInNhExport() ); + writer.toNexus( file, t, getOptions().getNhConversionSupportValueStyle() ); } catch ( final Exception e ) { exception = true; diff --git a/forester/java/src/org/forester/archaeopteryx/Options.java b/forester/java/src/org/forester/archaeopteryx/Options.java index 80be186..4ba2ded 100644 --- a/forester/java/src/org/forester/archaeopteryx/Options.java +++ b/forester/java/src/org/forester/archaeopteryx/Options.java @@ -27,6 +27,7 @@ package org.forester.archaeopteryx; import java.awt.Font; +import org.forester.phylogeny.PhylogenyNodeI.NH_CONVERSION_SUPPORT_VALUE_STYLE; import org.forester.phylogeny.data.NodeVisualization; import org.forester.phylogeny.data.NodeVisualization.NodeFill; import org.forester.phylogeny.data.NodeVisualization.NodeShape; @@ -37,46 +38,46 @@ import org.forester.util.ForesterUtil; */ final public class Options { - static final double MIN_CONFIDENCE_DEFAULT = 0.0; - private boolean _show_branch_length_values; - private boolean _internal_number_are_confidence_for_nh_parsing; - private boolean _show_scale; - private boolean _show_overview; - private boolean _antialias_screen; - private boolean _antialias_print; - private boolean _graphics_export_visible_only; - private int _print_size_x; - private int _print_size_y; - private double _min_confidence_value; - private boolean _print_black_and_white; - private boolean _print_using_actual_size; - private boolean _graphics_export_using_actual_size; - private PHYLOGENY_GRAPHICS_TYPE _phylogeny_graphics_type; - private CLADOGRAM_TYPE _cladogram_type; - private OVERVIEW_PLACEMENT_TYPE _ov_placement; - private NODE_LABEL_DIRECTION _node_label_direction; - private Font _base_font; - private boolean _match_whole_terms_only; - private boolean _search_case_sensitive; - private float _print_line_width; - private boolean _inverse_search_result; - private double _scale_bar_length; - private short _number_of_digits_after_comma_for_confidence_values; - private short _number_of_digits_after_comma_for_branch_length_values; - private boolean _nh_parsing_replace_underscores; - private boolean _nh_parsing_extract_pfam_taxonomy_codes; - private boolean _editable; - private boolean _background_color_gradient; - private boolean _show_domain_labels; - private boolean _color_labels_same_as_parent_branch; - private boolean _abbreviate_scientific_names; - private NodeVisualization.NodeShape _default_node_shape; - private NodeVisualization.NodeFill _default_node_fill; - private short _default_node_shape_size; - private boolean _taxonomy_colorize_node_shapes; - private boolean _show_default_node_shapes; - private boolean _show_confidence_stddev; - private boolean _use_brackets_for_conf_in_nh_export; + static final double MIN_CONFIDENCE_DEFAULT = 0.0; + private boolean _show_branch_length_values; + private boolean _internal_number_are_confidence_for_nh_parsing; + private boolean _show_scale; + private boolean _show_overview; + private boolean _antialias_screen; + private boolean _antialias_print; + private boolean _graphics_export_visible_only; + private int _print_size_x; + private int _print_size_y; + private double _min_confidence_value; + private boolean _print_black_and_white; + private boolean _print_using_actual_size; + private boolean _graphics_export_using_actual_size; + private PHYLOGENY_GRAPHICS_TYPE _phylogeny_graphics_type; + private CLADOGRAM_TYPE _cladogram_type; + private OVERVIEW_PLACEMENT_TYPE _ov_placement; + private NODE_LABEL_DIRECTION _node_label_direction; + private Font _base_font; + private boolean _match_whole_terms_only; + private boolean _search_case_sensitive; + private float _print_line_width; + private boolean _inverse_search_result; + private double _scale_bar_length; + private short _number_of_digits_after_comma_for_confidence_values; + private short _number_of_digits_after_comma_for_branch_length_values; + private boolean _nh_parsing_replace_underscores; + private boolean _nh_parsing_extract_pfam_taxonomy_codes; + private boolean _editable; + private boolean _background_color_gradient; + private boolean _show_domain_labels; + private boolean _color_labels_same_as_parent_branch; + private boolean _abbreviate_scientific_names; + private NodeVisualization.NodeShape _default_node_shape; + private NodeVisualization.NodeFill _default_node_fill; + private short _default_node_shape_size; + private boolean _taxonomy_colorize_node_shapes; + private boolean _show_default_node_shapes; + private boolean _show_confidence_stddev; + private NH_CONVERSION_SUPPORT_VALUE_STYLE _nh_conversion_support_value_style; private Options() { init(); @@ -187,7 +188,7 @@ final public class Options { setAbbreviateScientificTaxonNames( false ); _color_labels_same_as_parent_branch = false; _show_confidence_stddev = true; - _use_brackets_for_conf_in_nh_export = false; + _nh_conversion_support_value_style = NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE; } boolean isShowConfidenceStddev() { @@ -198,12 +199,12 @@ final public class Options { _show_confidence_stddev = show_confidence_stddev; } - boolean isUseBracketsForConfInNhExport() { - return _use_brackets_for_conf_in_nh_export; + NH_CONVERSION_SUPPORT_VALUE_STYLE getNhConversionSupportValueStyle() { + return _nh_conversion_support_value_style; } - void setUseBracketsForConfInNhExport( final boolean use_brackets_for_conf_in_nh_export ) { - _use_brackets_for_conf_in_nh_export = use_brackets_for_conf_in_nh_export; + void setNhConversionSupportValueStyle( final NH_CONVERSION_SUPPORT_VALUE_STYLE nh_conversion_support_value_style ) { + _nh_conversion_support_value_style = nh_conversion_support_value_style; } final boolean isAbbreviateScientificTaxonNames() { diff --git a/forester/java/src/org/forester/io/parsers/nhx/NHXParser.java b/forester/java/src/org/forester/io/parsers/nhx/NHXParser.java index 39f677a..600f00f 100644 --- a/forester/java/src/org/forester/io/parsers/nhx/NHXParser.java +++ b/forester/java/src/org/forester/io/parsers/nhx/NHXParser.java @@ -128,7 +128,7 @@ public final class NHXParser implements PhylogenyParser { isReplaceUnderscores() ); if ( NHXParser.GUESS_IF_SUPPORT_VALUES ) { if ( NHXParser.isBranchLengthsLikeBootstrapValues( getCurrentPhylogeny() ) ) { - NHXParser.moveBranchLengthsToBootstrapValues( getCurrentPhylogeny() ); + NHXParser.moveBranchLengthsToConfidenceValues( getCurrentPhylogeny() ); } } if ( isGuessRootedness() ) { @@ -631,7 +631,7 @@ public final class NHXParser implements PhylogenyParser { return true; } - private static void moveBranchLengthsToBootstrapValues( final Phylogeny p ) { + private static void moveBranchLengthsToConfidenceValues( final Phylogeny p ) { final PhylogenyNodeIterator it = p.iteratorPostorder(); while ( it.hasNext() ) { final PhylogenyNode n = it.next(); diff --git a/forester/java/src/org/forester/phylogeny/Phylogeny.java b/forester/java/src/org/forester/phylogeny/Phylogeny.java index 91f714d..f61a79a 100644 --- a/forester/java/src/org/forester/phylogeny/Phylogeny.java +++ b/forester/java/src/org/forester/phylogeny/Phylogeny.java @@ -1311,6 +1311,10 @@ public class Phylogeny { } } + public String toNexus() { + return toNexus( NH_CONVERSION_SUPPORT_VALUE_STYLE.NONE ); + } + public String toPhyloXML( final int phyloxml_level ) { try { return new PhylogenyWriter().toPhyloXML( this, phyloxml_level ).toString(); diff --git a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java index cbf2885..9ca9086 100644 --- a/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java +++ b/forester/java/src/org/forester/phylogeny/PhylogenyMethods.java @@ -193,7 +193,7 @@ public class PhylogenyMethods { final PhylogenyNodeIterator it = phy.iteratorPostorder(); while ( it.hasNext() ) { final PhylogenyNode n = it.next(); - if ( !n.isRoot() && !n.isExternal() && !n.getBranchData().isHasConfidences() ) { + if ( !n.isExternal() && !n.getBranchData().isHasConfidences() ) { if ( !ForesterUtil.isEmpty( n.getName() ) ) { double d = -1.0; try { -- 1.7.10.2