}
}
else if ( my_str.length() > 2 ) {
- third = ( char ) ( Math.abs( str.hashCode() / 16909320 ) );
- System.out.println( str.hashCode() );
+ third = my_str.charAt( ( my_str.length() - 1 ) / 2 );
}
}
first = AptxUtil.normalizeCharForRGB( first );
second = AptxUtil.normalizeCharForRGB( second );
- if ( is_taxonomy ) {
- third = AptxUtil.normalizeCharForRGB( third );
- }
- else {
- third = third > 255 ? 255 : third;
- }
+ third = AptxUtil.normalizeCharForRGB( third );
if ( ( first > 235 ) && ( second > 235 ) && ( third > 235 ) ) {
first = 0;
}
- else if ( ( first < 80 ) && ( second < 80 ) && ( third < 80 ) ) {
+ else if ( ( first < 60 ) && ( second < 60 ) && ( third < 60 ) ) {
second = 255;
}
return new Color( first, second, third );
return colorizations;
}
- final static String createAnnotationString( final SortedSet<Annotation> annotations ) {
+ final static String createAnnotationString( final SortedSet<Annotation> annotations, final boolean show_ref_sources ) {
final SortedMap<String, List<Annotation>> m = new TreeMap<String, List<Annotation>>();
for( final Annotation an : annotations ) {
final String ref_source = ForesterUtil.isEmpty( an.getRefSource() ) ? "?" : an.getRefSource();
if ( m.size() > 1 ) {
sb.append( "[" );
}
- if ( !ref_source.equals( "?" ) ) {
+ if ( show_ref_sources && !ref_source.equals( "?" ) ) {
sb.append( ref_source );
sb.append( ": " );
}
private JMenuItem _aptx_ref_item;
private JMenuItem _remove_branch_color_item;
private JCheckBoxMenuItem _show_domain_labels;
+ private JCheckBoxMenuItem _show_annotation_ref_source;
private JCheckBoxMenuItem _color_labels_same_as_parent_branch;
private JCheckBoxMenuItem _abbreviate_scientific_names;
private JCheckBoxMenuItem _screen_antialias_cbmi;
customizeCheckBoxMenuItem( _screen_antialias_cbmi, getOptions().isAntialiasScreen() );
customizeCheckBoxMenuItem( _background_gradient_cbmi, getOptions().isBackgroundColorGradient() );
customizeCheckBoxMenuItem( _show_domain_labels, getOptions().isShowDomainLabels() );
+ customizeCheckBoxMenuItem( _show_annotation_ref_source, getOptions().isShowAnnotationRefSource() );
customizeCheckBoxMenuItem( _abbreviate_scientific_names, getOptions().isAbbreviateScientificTaxonNames() );
customizeCheckBoxMenuItem( _show_default_node_shapes_external_cbmi, getOptions()
.isShowDefaultNodeShapesExternal() );
options.setBackgroundColorGradient( ( _background_gradient_cbmi != null )
&& _background_gradient_cbmi.isSelected() );
options.setShowDomainLabels( ( _show_domain_labels != null ) && _show_domain_labels.isSelected() );
+ options.setShowAnnotationRefSource( ( _show_annotation_ref_source != null )
+ && _show_annotation_ref_source.isSelected() );
options.setAbbreviateScientificTaxonNames( ( _abbreviate_scientific_names != null )
&& _abbreviate_scientific_names.isSelected() );
options.setColorLabelsSameAsParentBranch( ( _color_labels_same_as_parent_branch != null )
private boolean _validate_against_phyloxml_xsd_schema = Constants.VALIDATE_AGAINST_PHYLOXML_XSD_SCJEMA_DEFAULT;
private boolean _background_color_gradient = false;
private boolean _show_domain_labels = true;
+ private boolean _show_annotation_ref_source = true;
private boolean _abbreviate_scientific_names = false;
private boolean _color_labels_same_as_parent_branch = false;
private boolean _show_default_node_shapes_internal = false;
else if ( key.equals( "show_domain_labels" ) ) {
setShowDomainLabels( parseBoolean( ( String ) st.nextElement() ) );
}
+ else if ( key.equals( "show_seq_annotation_ref_sources" ) ) {
+ setShowAnnotationRefSource( parseBoolean( ( String ) st.nextElement() ) );
+ }
else if ( key.equals( "abbreviate_scientific_names" ) ) {
setAbbreviateScientificTaxonNames( parseBoolean( ( String ) st.nextElement() ) );
}
}
}
+ private void setShowAnnotationRefSource( final boolean b ) {
+ _show_annotation_ref_source = b;
+ }
+
private void setLabelForGetExtDescendentsData( final String label_for_get_ext_descendents_data ) {
_label_for_get_ext_descendents_data = label_for_get_ext_descendents_data;
}
public void setMidpointReroot( final boolean midpoint_root ) {
_midpoint_root = midpoint_root;
}
+
+ public boolean isShowAnnotationRefSource() {
+ return _show_annotation_ref_source;
+ }
}
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 SHOW_ANN_REF_SOURCE_LABEL = "Show Seq Annotation Ref Sources";
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";
JCheckBoxMenuItem _show_scale_cbmi; //TODO fix me
JCheckBoxMenuItem _show_overview_cbmi;
JCheckBoxMenuItem _show_domain_labels;
+ JCheckBoxMenuItem _show_annotation_ref_source;
JCheckBoxMenuItem _abbreviate_scientific_names;
JCheckBoxMenuItem _color_labels_same_as_parent_branch;
JMenuItem _overview_placment_mi;
else if ( o == _show_domain_labels ) {
updateOptions( getOptions() );
}
+ else if ( o == _show_annotation_ref_source ) {
+ updateOptions( getOptions() );
+ }
else if ( o == _abbreviate_scientific_names ) {
updateOptions( getOptions() );
}
options.setBackgroundColorGradient( ( _background_gradient_cbmi != null )
&& _background_gradient_cbmi.isSelected() );
options.setShowDomainLabels( ( _show_domain_labels != null ) && _show_domain_labels.isSelected() );
+ options.setShowAnnotationRefSource( ( _show_annotation_ref_source != null )
+ && _show_annotation_ref_source.isSelected() );
options.setAbbreviateScientificTaxonNames( ( _abbreviate_scientific_names != null )
&& _abbreviate_scientific_names.isSelected() );
options.setColorLabelsSameAsParentBranch( ( _color_labels_same_as_parent_branch != null )
if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {
_options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( SHOW_DOMAIN_LABELS_LABEL ) );
}
+ _options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( SHOW_ANN_REF_SOURCE_LABEL ) );
_options_jmenu.add( _choose_minimal_confidence_mi = new JMenuItem( "" ) );
_options_jmenu.add( _overview_placment_mi = new JMenuItem( "" ) );
_options_jmenu.add( _switch_colors_mi = new JMenuItem( "" ) );
customizeCheckBoxMenuItem( _screen_antialias_cbmi, getOptions().isAntialiasScreen() );
customizeCheckBoxMenuItem( _background_gradient_cbmi, getOptions().isBackgroundColorGradient() );
customizeCheckBoxMenuItem( _show_domain_labels, getOptions().isShowDomainLabels() );
+ customizeCheckBoxMenuItem( _show_annotation_ref_source, getOptions().isShowAnnotationRefSource() );
customizeCheckBoxMenuItem( _abbreviate_scientific_names, getOptions().isAbbreviateScientificTaxonNames() );
customizeCheckBoxMenuItem( _search_case_senstive_cbmi, getOptions().isSearchCaseSensitive() );
customizeCheckBoxMenuItem( _show_scale_cbmi, getOptions().isShowScale() );
if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {
_options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( SHOW_DOMAIN_LABELS_LABEL ) );
}
+ _options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( SHOW_ANN_REF_SOURCE_LABEL ) );
_options_jmenu.add( _choose_minimal_confidence_mi = new JMenuItem( "" ) );
_options_jmenu.add( _overview_placment_mi = new JMenuItem( "" ) );
_options_jmenu.add( _switch_colors_mi = new JMenuItem( "" ) );
customizeCheckBoxMenuItem( _screen_antialias_cbmi, getOptions().isAntialiasScreen() );
customizeCheckBoxMenuItem( _background_gradient_cbmi, getOptions().isBackgroundColorGradient() );
customizeCheckBoxMenuItem( _show_domain_labels, getOptions().isShowDomainLabels() );
+ customizeCheckBoxMenuItem( _show_annotation_ref_source, getOptions().isShowAnnotationRefSource() );
customizeCheckBoxMenuItem( _abbreviate_scientific_names, getOptions().isAbbreviateScientificTaxonNames() );
customizeCheckBoxMenuItem( _search_case_senstive_cbmi, getOptions().isSearchCaseSensitive() );
customizeCheckBoxMenuItem( _show_scale_cbmi, getOptions().isShowScale() );
private boolean _editable;
private boolean _background_color_gradient;
private boolean _show_domain_labels;
+ private boolean _show_annotation_ref_source;
private boolean _color_labels_same_as_parent_branch;
private boolean _abbreviate_scientific_names;
private NodeVisualization.NodeShape _default_node_shape;
return _show_domain_labels;
}
+ public final boolean isShowAnnotationRefSource() {
+ return _show_annotation_ref_source;
+ }
+
+ public final void setShowAnnotationRefSource( final boolean show_annotation_ref_source ) {
+ _show_annotation_ref_source = show_annotation_ref_source;
+ }
+
public void setBackgroundColorGradient( final boolean background_color_gradient ) {
_background_color_gradient = background_color_gradient;
}
_taxonomy_extraction = TAXONOMY_EXTRACTION.NO;
_cladogram_type = Constants.CLADOGRAM_TYPE_DEFAULT;
_show_domain_labels = true;
+ _show_annotation_ref_source = true;
setAbbreviateScientificTaxonNames( false );
_color_labels_same_as_parent_branch = false;
_show_confidence_stddev = true;
instance.setEditable( configuration.isEditable() );
instance.setColorLabelsSameAsParentBranch( configuration.isColorLabelsSameAsParentBranch() );
instance.setShowDomainLabels( configuration.isShowDomainLabels() );
+ instance.setShowAnnotationRefSource( configuration.isShowAnnotationRefSource() );
instance.setAbbreviateScientificTaxonNames( configuration.isAbbreviateScientificTaxonNames() );
if ( configuration.getMinConfidenceValue() != MIN_CONFIDENCE_DEFAULT ) {
instance.setMinConfidenceValue( configuration.getMinConfidenceValue() );
&& ( node.getNodeData().getSequence().getAnnotations() != null )
&& !node.getNodeData().getSequence().getAnnotations().isEmpty() ) {
sum += getTreeFontSet()._fm_large.stringWidth( AptxUtil.createAnnotationString( node.getNodeData()
- .getSequence().getAnnotations() )
+ .getSequence().getAnnotations(), getOptions().isShowAnnotationRefSource() )
+ " " );
}
if ( getControlPanel().isShowDomainArchitectures()
else if ( getControlPanel().isColorAccordingToAnnotation() ) {
g.setColor( calculateColorForAnnotation( ann ) );
}
- final String ann_str = AptxUtil.createAnnotationString( ann );
+ final String ann_str = AptxUtil.createAnnotationString( ann, getOptions().isShowAnnotationRefSource() );
TreePanel.drawString( ann_str, node.getXcoord() + x + 3 + half_box_size, node.getYcoord()
+ ( getTreeFontSet()._fm_large.getAscent() / down_shift_factor ), g );
_sb.setLength( 0 );
.getAccession().toString()
+ " " );
}
+ if ( getControlPanel().isShowAnnotation()
+ && ( node.getNodeData().getSequence().getAnnotations() != null )
+ && ( !node.getNodeData().getSequence().getAnnotations().isEmpty() ) ) {
+ x += getTreeFontSet()._fm_large.stringWidth( AptxUtil.createAnnotationString( node
+ .getNodeData().getSequence().getAnnotations(), getOptions()
+ .isShowAnnotationRefSource() )
+ + " " );
+ }
}
if ( getControlPanel().isShowNodeNames() && !ForesterUtil.isEmpty( node.getName() ) ) {
x += getTreeFontSet()._fm_large.stringWidth( node.getName() + " " );