From: cmzmasek@gmail.com Date: Sat, 13 Dec 2014 03:14:31 +0000 (+0000) Subject: domain + go output work begins X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=884d428fdefc13f8da7cdfdb2fb48046e589d8fa;p=jalview.git domain + go output work begins --- diff --git a/forester/java/src/org/forester/archaeopteryx/Options.java b/forester/java/src/org/forester/archaeopteryx/Options.java index ec72006..8130013 100644 --- a/forester/java/src/org/forester/archaeopteryx/Options.java +++ b/forester/java/src/org/forester/archaeopteryx/Options.java @@ -94,7 +94,11 @@ final public class Options { } public NodeData.NODE_DATA getExtDescNodeDataToReturn() { - return _ext_desc_data_to_return; + return NodeData.NODE_DATA.DOMAINS; + // TODO fix me + // FIXME remove me + // ~~~~~~ + //return _ext_desc_data_to_return; } public boolean isAllowErrorsInDistanceToParent() { diff --git a/forester/java/src/org/forester/archaeopteryx/TreePanel.java b/forester/java/src/org/forester/archaeopteryx/TreePanel.java index 4d50d28..c100ec5 100644 --- a/forester/java/src/org/forester/archaeopteryx/TreePanel.java +++ b/forester/java/src/org/forester/archaeopteryx/TreePanel.java @@ -77,8 +77,11 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Hashtable; import java.util.List; +import java.util.Map; import java.util.Set; +import java.util.SortedMap; import java.util.SortedSet; +import java.util.TreeMap; import javax.swing.BorderFactory; import javax.swing.JApplet; @@ -121,6 +124,7 @@ import org.forester.phylogeny.data.NodeVisualData.NodeShape; import org.forester.phylogeny.data.PhylogenyDataUtil; import org.forester.phylogeny.data.PropertiesMap; import org.forester.phylogeny.data.Property; +import org.forester.phylogeny.data.ProteinDomain; import org.forester.phylogeny.data.Sequence; import org.forester.phylogeny.data.SequenceRelation; import org.forester.phylogeny.data.Taxonomy; @@ -5491,6 +5495,9 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee private void showExtDescNodeData( final PhylogenyNode node ) { final List data = new ArrayList(); + final SortedMap string_int_map = new TreeMap(); + + final List nodes = node.getAllExternalDescendants(); if ( ( getFoundNodes0() != null ) || ( getFoundNodes1() != null ) ) { for( final PhylogenyNode n : getFoundNodesAsListOfPhylogenyNodes() ) { @@ -5607,6 +5614,32 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee data.add( n.getNodeData().getTaxonomy().getTaxonomyCode() ); } break; + case DOMAINS: + if ( n.getNodeData().isHasSequence() + && n.getNodeData().getSequence().getDomainArchitecture() != null ) { + final DomainArchitecture da = n.getNodeData().getSequence().getDomainArchitecture(); + for( int i = 0; i < da.getDomains().size(); ++i ) { + final ProteinDomain d = da.getDomain( i ); + if ( d.getConfidence() < 1 ) { + String dn = d.getName(); + if ( !string_int_map.containsKey( dn ) ) { + string_int_map.put( dn, 1 ); + } + else { + string_int_map.put( dn, string_int_map.get( dn ) + 1 ); + } + + } + + } + } + break; + case GO_ANNOTATIONS: + if ( n.getNodeData().isHasSequence() ) { + //TODO do something clever + } + break; + case UNKNOWN: TreePanelUtil.showExtDescNodeDataUserSelectedHelper( getControlPanel(), n, data ); break; @@ -5615,6 +5648,17 @@ public final class TreePanel extends JPanel implements ActionListener, MouseWhee + getOptions().getExtDescNodeDataToReturn() ); } } // for loop + /////////////////////////////////////////////////////// + //TODO remove me + if ( string_int_map != null ) { + for( final Object key : string_int_map.keySet() ) { + System.out.print( key.toString() ); + System.out.print( ": " ); + System.out.print( string_int_map.get( key ).toString() ); + System.out.println(); + } + } + /////////////////////////////////////////////////////// final StringBuilder sb = new StringBuilder(); final int size = TreePanelUtil.makeSB( data, getOptions(), sb ); if ( ( getConfiguration().getExtNodeDataReturnOn() == EXT_NODE_DATA_RETURN_ON.CONSOLE ) diff --git a/forester/java/src/org/forester/phylogeny/data/NodeData.java b/forester/java/src/org/forester/phylogeny/data/NodeData.java index 28bedb9..4cdf9b3 100644 --- a/forester/java/src/org/forester/phylogeny/data/NodeData.java +++ b/forester/java/src/org/forester/phylogeny/data/NodeData.java @@ -50,7 +50,9 @@ public class NodeData implements PhylogenyData { TAXONOMY_SCIENTIFIC_NAME, TAXONOMY_COMM0N_NAME, TAXONOMY_CODE, - UNKNOWN; + UNKNOWN, + DOMAINS, + GO_ANNOTATIONS; } private String _node_name; private Event _event;