import org.forester.phylogeny.PhylogenyNode;\r
import org.forester.phylogeny.PhylogenyNode.NH_CONVERSION_SUPPORT_VALUE_STYLE;\r
import org.forester.phylogeny.data.Confidence;\r
+import org.forester.phylogeny.data.Sequence;\r
import org.forester.phylogeny.data.Taxonomy;\r
import org.forester.phylogeny.factories.ParserBasedPhylogenyFactory;\r
import org.forester.phylogeny.factories.PhylogenyFactory;\r
private final static SequencesFileFilter seqsfilter = new SequencesFileFilter();\r
private final static DefaultFilter defaultfilter = new DefaultFilter();\r
private static final long serialVersionUID = -799735726778865234L;\r
+ private static final boolean PREPROCESS_TREES = false;\r
private final JFileChooser _values_filechooser;\r
private final JFileChooser _sequences_filechooser;\r
private final JFileChooser _open_filechooser;\r
.add( _show_default_node_shapes_internal_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_INT ) );\r
_options_jmenu\r
.add( _show_default_node_shapes_external_cbmi = new JCheckBoxMenuItem( DISPLAY_NODE_BOXES_LABEL_EXT ) );\r
+ _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) );\r
if ( getConfiguration().doDisplayOption( Configuration.show_domain_architectures ) ) {\r
- _options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( SHOW_DOMAIN_LABELS_LABEL ) );\r
_options_jmenu.add( _right_line_up_domains_cbmi = new JCheckBoxMenuItem( MainFrame.RIGHT_LINE_UP_DOMAINS ) );\r
+ _options_jmenu.add( _show_domain_labels = new JCheckBoxMenuItem( MainFrame.SHOW_DOMAIN_LABELS_LABEL ) );\r
}\r
- _options_jmenu.add( _line_up_renderable_data_cbmi = new JCheckBoxMenuItem( MainFrame.LINE_UP_RENDERABLE_DATA ) );\r
_options_jmenu.add( _show_annotation_ref_source = new JCheckBoxMenuItem( SHOW_ANN_REF_SOURCE_LABEL ) );\r
_options_jmenu.add( _show_confidence_stddev_cbmi = new JCheckBoxMenuItem( SHOW_CONF_STDDEV_LABEL ) );\r
_options_jmenu.add( _color_by_taxonomic_group_cbmi = new JCheckBoxMenuItem( COLOR_BY_TAXONOMIC_GROUP ) );\r
}\r
}\r
}\r
+ if ( PREPROCESS_TREES ) {\r
+ preProcessTreesUponReading( phys );\r
+ }\r
AptxUtil.addPhylogeniesToTabs( phys,\r
file.getName(),\r
file.getAbsolutePath(),\r
System.gc();\r
}\r
\r
+ private void preProcessTreesUponReading( final Phylogeny[] phys ) {\r
+ for( final Phylogeny phy : phys ) {\r
+ if ( ( phy != null ) && !phy.isEmpty() ) {\r
+ for( final PhylogenyNodeIterator it = phy.iteratorPreorder(); it.hasNext(); ) {\r
+ final PhylogenyNode n = it.next();\r
+ if ( n.isExternal() ) {\r
+ if ( n.getNodeData().isHasSequence() ) {\r
+ final Sequence s = n.getNodeData().getSequence();\r
+ if ( ForesterUtil.isEmpty( s.getGeneName() ) ) {\r
+ if ( ( s.getAccession() != null )\r
+ && !ForesterUtil.isEmpty( s.getAccession().getValue() ) ) {\r
+ s.setGeneName( s.getAccession().getValue() );\r
+ }\r
+ else if ( !ForesterUtil.isEmpty( n.getName() ) ) {\r
+ s.setGeneName( n.getName() );\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
private void readSpeciesTreeFromFile() {\r
Phylogeny t = null;\r
boolean exception = false;\r