Differences between revisions 13 and 14
Revision 13 as of 2007-11-29 19:23:46
Size: 5576
Editor: GaryBader
Comment:
Revision 14 as of 2007-11-29 19:52:03
Size: 7556
Editor: nebbiolo
Comment:
Deletions are marked like this. Additions are marked like this.
Line 15: Line 15:
{{{
Line 18: Line 18:
Overall model
============
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.
==== 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.
Line 22: Line 21:
CyModelObject
=============
is clone a deep copy?
  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.
Line 26: Line 24:
getIdentifier() - will this be unique across all CyModelObjects within a Cytoscape session? This could be useful for e.g. storing objects in hashes. ==== CyModelObject ====
GaryBader - is clone a deep copy?
Line 28: Line 27:
What's the use case for getAttribute(java.lang.String attributeName)? GaryBader - getIdentifier() - will this be unique across all CyModelObjects within a Cytoscape session? This could be useful for e.g. storing objects in hashes.
Line 30: Line 29:
CyNetwork
=========
Should there be a remove change listener?
GaryBader - What's the use case for getAttribute(java.lang.String attributeName)?
Line 34: Line 31:
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. ==== CyNetwork ====
GaryBader - Should there be a remove change listener?
Line 36: Line 34:
Should there be an addGroupList method?   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.
Line 38: Line 36:
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 - 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.
Line 40: Line 38:
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 - Should there be an addGroupList method?
Line 42: Line 40:
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 - 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)
Line 44: Line 42:
Naming: getEdgesList -> getEdgeList (avoid all use of plurals in all packages)   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.
Line 46: Line 44:
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
Line 48: Line 45:
Use case for isNeighbor? It could be useful, but maybe better as a utility method. 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.
Line 50: Line 47:
Why not use the CyModelObject here? - can you not select groups and hyperedges? 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?
Line 54: Line 64:
same thing goes for add, remove, unselect, etc. GaryBader - same thing goes for add, remove, unselect, etc.
Line 56: Line 66:
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.   MikeSmoot - good point!
Line 58: Line 68:
createEdge - change 'interaction' parameter to edgeType, or similar. 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.
Line 60: Line 70:
CyNode
======
Group methods should only be in CyGroup, not in CyNode.
GaryBader - createEdge - change 'interaction' parameter to edgeType, or similar.
Line 64: Line 72:
Some of the methods in various packages are missing their return type. MikeSmoot - createNetworkView should definitely '''NOT''' be part of this interface.
Line 66: Line 74:
CyEdge
======
Again, remove hyperedge methods to simplify this.
==== CyNode ====
Line 70: Line 76:
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 - Group methods should only be in CyGroup, not in CyNode.
Line 72: Line 78:
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 - Some of the methods in various packages are missing their return type.
Line 74: Line 80:
CyGroup
=======
GetState - what is this?
==== CyEdge ====
GaryBader - Again, remove hyperedge methods to simplify this.
Line 78: Line 83:
getViewer() returns string - should this be a groupviewer? 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.
Line 80: Line 85:
CyGroupViewer
=============
Shouldn't a viewer just register for a group change event? Maybe change listener should be on CyModelObject?
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.
Line 84: Line 87:
CyNetworkChangeListener
=======================
Should we have more enums for types of changes, like CyGroupViewer.ChangeType? We could just have all of these in one place.
==== CyGroup ====
GaryBader - GetState - what is this?
Line 88: Line 90:
CyProject
=========
addManipulation - too granular? Can we use comments for this? If necessary, we could add a type of comment, allowing attribute/value pairs.
GaryBader - getViewer() returns string - should this be a groupviewer?
Line 92: Line 92:
What does addFile do with the file once it's added? ==== CyGroupViewer ====
Line 94: Line 94:
getname, but no setname? GaryBader - Shouldn't a viewer just register for a group change event? Maybe change listener should be on CyModelObject?
Line 96: Line 96:
Should we be able to have subprojects? E.g. most IDEs have this. ==== CyNetworkChangeListener ====
Line 98: Line 98:
Where is the active state of the project set? There is no setActive method. GaryBader - Should we have more enums for types of changes, like CyGroupViewer.ChangeType? We could just have all of these in one place.
Line 100: Line 100:
setProjectPath - is this the name of the file storing the project?   MikeSmoot - I agree that we probably want to consider consolidating all ChangeTypes into a single enum.
Line 102: Line 102:
CyAttributes
============
Has anything changed here from the current CyAttributes?
==== CyProject ====
Line 106: Line 104:
}}} 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.

Discussion Title : Cytoscape 3.0 Model

Editor(s): ScooterMorris

TableOfContents([2])

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.

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.

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