Differences between revisions 20 and 46 (spanning 26 versions)
Revision 20 as of 2006-02-28 13:15:37
Size: 2673
Editor: cosiapat1
Comment:
Revision 46 as of 2006-03-02 20:44:20
Size: 1590
Editor: pix39
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
Example 1. Algorithm calculated groups: {{{
//
Example 1. Algorithm calculated groups:
Line 7: Line 8:
{{{CyNetwork [] groups = someAlgorithm.calculateGroups(someArgs); CyNetwork [] groups = someAlgorithm.calculateGroups(someArgs);
Line 14: Line 15:
   if(groups[i].nodeCount() > SOME_LIMIT){
    collapsingStrategy.group(myNetwork,groups[i]); // this collapses the groups
   }else{
    stackingStrategy.group(myNetwork,groups[i]); // this aligns the nodes in a stack
   }
Line 20: Line 16:
   // Layout the nodes in a column
   stackingStrategy.group(myNetwork,groups[i]);

   if(groups[i].nodeCount() > SOME_LIMIT)
        // collapse groups that are too large
        collapsingStrategy.group(myNetwork,groups[i]);
Line 21: Line 23:
}}}
Line 22: Line 25:
}}} /CommentInterfaces
Line 27: Line 30:
 2. The {{{GroupingManager}}} is an interface to the data structure that stores groups for Cytoscape networks. We have not decided what data structure will do this. Alternatives that have been mentioned in the past are:
   * {{{CyAttributes}}}
   * {{{CyNodes}}} (as it is done currently)
   * A new data structure
Here is my opinion on each:
   * {{{CyAttributes}}} Requires that a node (if we use node {{{CyAttributes}}}) or an edge (if we use edge {{{CyAttributes}}}) be created per group. Only in one case ({{{COLLAPSING_STRATEGY}}}) is a node per group needed. The other grouping strategies do not need new nodes or edges. Additionally, there is no safe way of storing information that tells us to which network a group belongs, since the node that functions as a key in {{{CyAttributes}}} can be manipulated very easily by users (removing it, adding it to a new network, etc).
   * {{{CyNode}}} Also requires a node per group. This was originally done because when we were designing the GINY API, we were not thinking of the more general {{{grouping}}} problem. We were thinking of {{{MetaNodes}}} only.
   * A new data structure. This could be a data-structure that resembles {{{CyAttributes}}} (some sort of map structure) but that does not require the creation of a node per group. Also, this data structure would be hidden, so that the only way of interacting with it is {{{GroupingManager}}}. I vote for this.
Line 36: Line 31:
/CommentSemantics (is {{{Group}}} a good word to use? what other wording would you suggest?)
Line 37: Line 33:
Comments:
   * AllanK: Does the {{{GroupingStrategy}}}, as it is currently defined, conflate the model and the view?
 1. The {{{GroupingManager}}} is an interface to the data structure that stores groups for Cytoscape networks. We have not decided what data structure will do this. Alternatives that have been mentioned in the past are:
  * {{{CyAttributes}}}
  * {{{CyNodes}}} (as it is done currently)
  * A new data structure

/CommentDataStructure

Please review the Java-Docs at http://db.systemsbiology.net/cytoscape/grouping/doc/ and comment.

To give you a better idea of how the interfaces work together, here is an example:

// Example 1. Algorithm calculated groups:

CyNetwork [] groups = someAlgorithm.calculateGroups(someArgs);
groupManager.addGroupsToNetwork(myNetwork);
GroupingStrategy collapsingStrategy = 
     GroupingStrategyFactory.createGroupingStrategy(GroupingStrategyFactory.COLLAPSING_STRATEGY);
GroupingStrategy stackingStrategy =
     GroupingStrategyFactory.createGroupingStrategy(GroupingStrategyFactory.STACKING_STRATEGY);
for(int i = 0; i < groups.length; i++){

   // Layout the nodes in a column
   stackingStrategy.group(myNetwork,groups[i]);

   if(groups[i].nodeCount() > SOME_LIMIT)
        // collapse groups that are too large
        collapsingStrategy.group(myNetwork,groups[i]); 
}

/CommentInterfaces

Notes:

  1. I decided to name the interfaces in this API using the group word instead of the MetaNode word. A MetaNode is a way of grouping nodes/edges in a graph. The more general concept is grouping.

/CommentSemantics (is Group a good word to use? what other wording would you suggest?)

  1. The GroupingManager is an interface to the data structure that stores groups for Cytoscape networks. We have not decided what data structure will do this. Alternatives that have been mentioned in the past are:

    • CyAttributes

    • CyNodes (as it is done currently)

    • A new data structure

/CommentDataStructure

API (last edited 2009-02-12 01:04:00 by localhost)

Funding for Cytoscape is provided by a federal grant from the U.S. National Institute of General Medical Sciences (NIGMS) of the Na tional Institutes of Health (NIH) under award number GM070743-01. Corporate funding is provided through a contract from Unilever PLC.

MoinMoin Appliance - Powered by TurnKey Linux