1207
Comment:
|
10432
|
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? ScooterMorris - Given the upcoming change to CyNode, where nodes will maintain a reference to their edges, I think that the right solution to handling HyperEdges is probably to extend CyEdge. I would imagine that the way we would traverse the network is to get the first node, then get the list of neighbors from that node, etc., etc. To extend this to hyperedges, all we would need to do would be to add CyHyperEdge support to the getNeighbors routine. MikeSmoot - Given what CyModelObject does now, then I think it's probably OK for CyNetwork to extend it. ==== CyModelObject ==== GaryBader - is clone a deep copy? ScooterMorris - I think it should be. GaryBader - getIdentifier() - will this be unique across all CyModelObjects within a Cytoscape session? This could be useful for e.g. storing objects in hashes. ScooterMorris - Yes. I think we need to separate getIdentifier() from getName, which would give us much more flexibility. An identifier, in this case, is an internal value that (in general) the user should never see. GaryBader - What's the use case for getAttribute(java.lang.String attributeName)? ScooterMorris - it returns the named attribute for this object. The idea is to separate global attributes from attributes that are specific to an object. 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. ==== 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. ScooterMorris - No, but I see no reason not to capture the place holders. I actually like the suggestion of moving all of these to CyModelObjects. 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. ScooterMorris - on the other hand, if there are hyperedges in the network, all of the standard graph algorithms will break. I'm now thinking that a CyHyperEdge extends CyEdge and that internally we provide mechanisms to handle it appropriately. We know that there is a valid use case for hyperedges, so I think we should consider including them in the model. 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. ScooterMorris - OK, then we should add methods for "addNetworkView and removeNetworkView" ==== CyNode ==== GaryBader - Group methods should only be in CyGroup, not in CyNode. ScooterMorris - not sure what you mean. Asking a CyNode if its a group, or what groups it is a member of is much easier than trying to maintain a list of CyGroup static methods. I think that this is somewhat the same argument as having nodes "know" about their edges. 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. ScooterMorris - nice suggestion. 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? ScooterMorris - the current state of the group. The specific semantics are implemented by the CyGroupViewer, but the state needs to be saved and restored, so it needs to be part of the CyGroup itself. GaryBader - getViewer() returns string - should this be a groupviewer? ScooterMorris - No, because there is no way I can know if the groupViewer has been registered, yet. ==== 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 124: |
== Discussion == |
MikeSmoot - addFile sounds a lot like an IO thing. Should this be in the model? ScooterMorris - My idea is just that the project will maintain a list of all of the files that were used to create the session (network files, ontologies, attributes, etc.). This is just the way to tell the project that a file was added to the session. Perhaps this could be replaced with a special type of comment, if we follow the suggestion above of extending comments. 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?
ScooterMorris - Given the upcoming change to CyNode, where nodes will maintain a reference to their edges, I think that the right solution to handling HyperEdges is probably to extend CyEdge. I would imagine that the way we would traverse the network is to get the first node, then get the list of neighbors from that node, etc., etc. To extend this to hyperedges, all we would need to do would be to add CyHyperEdge support to the getNeighbors routine.
MikeSmoot - Given what CyModelObject does now, then I think it's probably OK for CyNetwork to extend it.
CyModelObject
GaryBader - is clone a deep copy?
ScooterMorris - I think it should be.
GaryBader - getIdentifier() - will this be unique across all CyModelObjects within a Cytoscape session? This could be useful for e.g. storing objects in hashes.
ScooterMorris - Yes. I think we need to separate getIdentifier() from getName, which would give us much more flexibility. An identifier, in this case, is an internal value that (in general) the user should never see.
GaryBader - What's the use case for getAttribute(java.lang.String attributeName)?
ScooterMorris - it returns the named attribute for this object. The idea is to separate global attributes from attributes that are specific to an object.
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.
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.
ScooterMorris - No, but I see no reason not to capture the place holders. I actually like the suggestion of moving all of these to CyModelObjects.
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.
ScooterMorris - on the other hand, if there are hyperedges in the network, all of the standard graph algorithms will break. I'm now thinking that a CyHyperEdge extends CyEdge and that internally we provide mechanisms to handle it appropriately. We know that there is a valid use case for hyperedges, so I think we should consider including them in the model.
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.
ScooterMorris - OK, then we should add methods for "addNetworkView and removeNetworkView"
CyNode
GaryBader - Group methods should only be in CyGroup, not in CyNode.
ScooterMorris - not sure what you mean. Asking a CyNode if its a group, or what groups it is a member of is much easier than trying to maintain a list of CyGroup static methods. I think that this is somewhat the same argument as having nodes "know" about their edges.
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.
ScooterMorris - nice suggestion.
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?
ScooterMorris - the current state of the group. The specific semantics are implemented by the CyGroupViewer, but the state needs to be saved and restored, so it needs to be part of the CyGroup itself.
GaryBader - getViewer() returns string - should this be a groupviewer?
ScooterMorris - No, because there is no way I can know if the groupViewer has been registered, yet.
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?
ScooterMorris - My idea is just that the project will maintain a list of all of the files that were used to create the session (network files, ontologies, attributes, etc.). This is just the way to tell the project that a file was added to the session. Perhaps this could be replaced with a special type of comment, if we follow the suggestion above of extending comments.
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.