Discussion Title : Cytoscape 3.0 Model

Editor(s): ScooterMorris

<<TableOfContents: execution failed [Argument "maxdepth" must be an integer value, not "[2]"] (see also the log)>>

About this document

This document should serve to begin the discussion about the Cytoscape 3.0 model. At the 2007 Retreat, it was agreed that we would investigate a new class model for Cytoscape objects to replace the current, complicated combination of cytoscape, giny, ding, and fing models that currently provide the API for Cytoscape. Our goal at this point should be to design a model that provides a clean interface to cytoscape objects and provides the cleanest interface we can imagine for plugin writers.

General Notes


I have included a Cytoscape session file that demonstrates the class hierarchy. The session includes a custom Link Out URL that will pull up the JavaDoc file for that interface. I have currently written proposed interfaces for CyNetwork, CyNode, CyEdge, CyModeObject, CyGroup, CyProject, and CyModelObject. Here is an image from the session: Cytoscape3ClassHierarchy.png


Note From Conference Call 2007 Nov 29

ScooterMorris presented the Javadocs for the model. At this stage, it seemed one would still be querying the network for information about node and edge relationships, which was done in part by Scooter to allow for the possibility of CyNodes participating in multiple graphs. BrianTurner and SarahKillcoyne pointed out that the discussions in Amsterdam indicated a desire for the model API to more closely reflect the way graphs are generally modeled. In this sense CyNodes would know about their edges--even at the price of losing the idea of a CyNode participating in multiple graphs, which, like the root graph, seemed another unpopular concept with plugin developers at the retreat. However, as GaryBader pointed out, and everyone agreed with, this is about the API, and providing an intuitive way to interrogate the model and its components, not the underlying implementation--that is to say, we would like to be able as a CyNode about its edges and neighbors, but the actual implementation might, nonetheless, have network itself actually managing and knowing about those relationships.

MikeSmoot - I'm very concerned by the push to include lots of information in CyNodes, specifically information about adjacent edges, neighbors, etc.. This is because graph data structures simply aren't built this way. In almost all cases I'm aware of, fast and space efficient graph data structures are implemented as adjacency lists of integers (and for those with lots and lots of space, adjacency matrices). I'm all for syntactic sugar in the right places, but if we deviate too far from the implementation, then we risk performance problems and issues with conceptual integrity. We need to be very careful about making design decisions that allow or encourage uses of the graph data structure that don't conform well with their behavior. As nice as it would be to ignore the implementation of the underlying graph, I don't thing we have the luxury of doing this.

Overall model

GaryBader - We should add CyHyperedge. Also, CyGroup and CyHyperedge shoudl extend CyModelObject. This will make it easier to write general methods like getSelected, which can apply to any network object. CyNetwork should not extend CyModelObject since you don't want to add a network to a network. Also, maybe change CyModelObject to CyNetworkObject.


GaryBader - is clone a deep copy?

GaryBader - getIdentifier() - will this be unique across all CyModelObjects within a Cytoscape session? This could be useful for e.g. storing objects in hashes.

GaryBader - What's the use case for getAttribute(java.lang.String attributeName)?

ScooterMorris - one thing I would like to add to CyModelObject is to add some form of userDataObject stuff back in. I know that it was there at one point and not heavily used, but I think that we have a lot more plugin developers today that are implementing a much wider variety of applications. Providing them "hooks" at this level would be potentially very useful.


GaryBader - Should there be a remove change listener?

GaryBader - Naming: use List instead of plurals? E.g. addEdgeList instead of addEdges. A list can contain one object and addEdge is very close to addEdges, so could be confusing.

GaryBader - Should there be an addGroupList method?

GaryBader - Should the CyNetwork be a factory for nodes, edges, etc.? If so, shouldn't the object be immediately added to the network? (some of the javadoc is not clear on this policy)

GaryBader - Hyperedges should not be included in edges - they should be their own object, just like groups is separate. Overloading CyEdge with hyperedge will make simple graph algorithms much more complex to implement because you will have to check in many places to make sure you're not using a hyperedge edge. We should evaluate the Agilent hyperedge object for model inclusion as CyHyperedge.

GaryBader - getDegree must include undirected, in, out. In general, we should probably have clearer separation between undirected and directed edge methods e.g. getDegree would give you everything, getDegreeIn, getDegreeOut, getDegreeUndirected (or use an enum to filter) would give you specific results. Same things with all edge methods, edgecount, getedgelist. Right now you can only filter with some methods and you can't specify to get only undirected.

GaryBader - Naming: getEdgesList -> getEdgeList (avoid all use of plurals in all packages)

GaryBader - Why is hide part of CyNetwork - should it only be part of the view? We may want to remove this altogether and just use remove/add

GaryBader - Use case for isNeighbor? It could be useful, but maybe better as a utility method.

GaryBader - Why not use the CyModelObject here? - can you not select groups and hyperedges?

GaryBader - same thing goes for add, remove, unselect, etc.

GaryBader - Don't think we need selectAllNodes, edges in there, as they are utility methods. Same with unselect. You can easily select all using setSelectedEdgeState + getNodeList.

GaryBader - createEdge - change 'interaction' parameter to edgeType, or similar.

MikeSmoot - createNetworkView should definitely NOT be part of this interface.


GaryBader - Group methods should only be in CyGroup, not in CyNode.

GaryBader - Some of the methods in various packages are missing their return type.


GaryBader - Again, remove hyperedge methods to simplify this.

GaryBader - getInteraction() - should be getEdgeType. How will this be related to identifier? Is the edge type part of the ID like 2.x? I don't think it should, since this causes a lot of confusion.

GaryBader - Need to be able to filter by edge type in getTarget type methods - source, target and none for the undirected case. This would be another good place for a global edge enum type: in, out, undirected.


GaryBader - GetState - what is this?

GaryBader - getViewer() returns string - should this be a groupviewer?


GaryBader - Shouldn't a viewer just register for a group change event? Maybe change listener should be on CyModelObject?


GaryBader - Should we have more enums for types of changes, like CyGroupViewer.ChangeType? We could just have all of these in one place.


GaryBader - addManipulation - too granular? Can we use comments for this? If necessary, we could add a type of comment, allowing attribute/value pairs.

GaryBader - What does addFile do with the file once it's added?

GaryBader - getname, but no setname?

GaryBader - Should we be able to have subprojects? E.g. most IDEs have this.

GaryBader - Where is the active state of the project set? There is no setActive method.

GaryBader - setProjectPath - is this the name of the file storing the project?


GaryBader - Has anything changed here from the current CyAttributes?

Outdated_Cytoscape_3.0/Model (last edited 2011-02-24 16:11:47 by PietMolenaar)

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