1209
Comment:
|
7556
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## This template may be useful for creating new Discussion pages ## This is a wiki comment - leave these in so that people can see them when editing the page |
|
Line 5: | Line 2: |
Line 9: | Line 5: |
Line 15: | Line 10: |
I have included a [:attachment:Cytoscape3.cys: 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. |
I have included a [attachment:Cytoscape3.cys Cytoscape session file] that demonstrates the class hierarchy. The session includes a custom Link Out URL that will pull up the [http://lewis.compbio.ucsf.edu/Cytoscape3.0/doc/index.html 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: attachment:Cytoscape3ClassHierarchy.png == Discussion == Hi Scooter - this looks great! Questions and comments below. Thanks, Gary. ==== 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. MikeSmoot - I don't know if I agree that CyHyperEdge should be part of the base model. Couldn't we have an extension of CyNetwork that handles this? Given what CyModelObject does now, then I think it's probably OK for CyNetwork to extend it. ==== CyModelObject ==== 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)? ==== CyNetwork ==== GaryBader - Should there be a remove change listener? MikeSmoot - I don't know that we want to concern ourselves with event listeners just yet. We just need to know that events will need to be supported. 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) MikeSmoot - My initial reaction is NO that CyNetwork should NOT be a factory for nodes and edges. I think that the CyNetwork ''interface'' should only be concerned with how one interacts with a network once it's created and shouldn't be concerned with issues of creation. 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. MikeSmoot - We need to clarify if we're supporting a mixed graph or just directed/undirected. We may want sub interfaces to support different the different cases. 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. MikeSmoot - This should definitely be part of CyNetwork or CyNode as this is something that only the graph or node knows about. In general I'm opposed to utility classes with utility methods. GaryBader - Why not use the CyModelObject here? - can you not select groups and hyperedges? boolean isSelected(CyEdge edge) boolean isSelected(CyNode node) GaryBader - same thing goes for add, remove, unselect, etc. MikeSmoot - good point! 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. ==== CyNode ==== GaryBader - Group methods should only be in CyGroup, not in CyNode. GaryBader - Some of the methods in various packages are missing their return type. ==== CyEdge ==== 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. ==== CyGroup ==== GaryBader - GetState - what is this? GaryBader - getViewer() returns string - should this be a groupviewer? ==== CyGroupViewer ==== GaryBader - Shouldn't a viewer just register for a group change event? Maybe change listener should be on CyModelObject? ==== CyNetworkChangeListener ==== GaryBader - Should we have more enums for types of changes, like CyGroupViewer.ChangeType? We could just have all of these in one place. MikeSmoot - I agree that we probably want to consider consolidating all ChangeTypes into a single enum. ==== CyProject ==== GaryBader - addManipulation - too granular? Can we use comments for this? If necessary, we could add a type of comment, allowing attribute/value pairs. MikeSmoot - Maybe we want the granularity to be at the command layer? Or maybe the granularity should be events? GaryBader - What does addFile do with the file once it's added? |
Line 17: | Line 110: |
== Discussion == |
MikeSmoot - addFile sounds a lot like an IO thing. Should this be in the model? 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? ==== CyAttributes ==== GaryBader - Has anything changed here from the current CyAttributes? MikeSmoot - I'd like to transition to using enums to define attribute types rather than ints like we've got now. |
Discussion Title : Cytoscape 3.0 Model |
Editor(s): ScooterMorris |
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
References
I have included a [attachment:Cytoscape3.cys Cytoscape session file] that demonstrates the class hierarchy. The session includes a custom Link Out URL that will pull up the [http://lewis.compbio.ucsf.edu/Cytoscape3.0/doc/index.html 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: attachment:Cytoscape3ClassHierarchy.png
Discussion
Hi Scooter - this looks great! Questions and comments below. Thanks, Gary.
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.
MikeSmoot - I don't know if I agree that CyHyperEdge should be part of the base model. Couldn't we have an extension of CyNetwork that handles this?
Given what CyModelObject does now, then I think it's probably OK for CyNetwork to extend it.
CyModelObject
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)?
CyNetwork
GaryBader - Should there be a remove change listener?
MikeSmoot - I don't know that we want to concern ourselves with event listeners just yet. We just need to know that events will need to be supported.
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)
MikeSmoot - My initial reaction is NO that CyNetwork should NOT be a factory for nodes and edges. I think that the CyNetwork interface should only be concerned with how one interacts with a network once it's created and shouldn't be concerned with issues of creation.
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.
MikeSmoot - We need to clarify if we're supporting a mixed graph or just directed/undirected. We may want sub interfaces to support different the different cases.
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.
MikeSmoot - This should definitely be part of CyNetwork or CyNode as this is something that only the graph or node knows about. In general I'm opposed to utility classes with utility methods.
GaryBader - Why not use the CyModelObject here? - can you not select groups and hyperedges? boolean isSelected(CyEdge edge) boolean isSelected(CyNode node)
GaryBader - same thing goes for add, remove, unselect, etc.
MikeSmoot - good point!
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.
CyNode
GaryBader - Group methods should only be in CyGroup, not in CyNode.
GaryBader - Some of the methods in various packages are missing their return type.
CyEdge
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.
CyGroup
GaryBader - GetState - what is this?
GaryBader - getViewer() returns string - should this be a groupviewer?
CyGroupViewer
GaryBader - Shouldn't a viewer just register for a group change event? Maybe change listener should be on CyModelObject?
CyNetworkChangeListener
GaryBader - Should we have more enums for types of changes, like CyGroupViewer.ChangeType? We could just have all of these in one place.
MikeSmoot - I agree that we probably want to consider consolidating all ChangeTypes into a single enum.
CyProject
GaryBader - addManipulation - too granular? Can we use comments for this? If necessary, we could add a type of comment, allowing attribute/value pairs.
MikeSmoot - Maybe we want the granularity to be at the command layer? Or maybe the granularity should be events?
GaryBader - What does addFile do with the file once it's added?
MikeSmoot - addFile sounds a lot like an IO thing. Should this be in the model?
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?
CyAttributes
GaryBader - Has anything changed here from the current CyAttributes?
MikeSmoot - I'd like to transition to using enums to define attribute types rather than ints like we've got now.