If you want to have the MetaNodes plugin to show only one edge between the MetaNodes after they are collapsed, you can use this hack. (from a post from Iliana) Open up the class: {{{ metaNodeViewer.model.AbstractMetaNodeModeler }}} And then search for the string '''Kris'''. This will take you to a commented-out section of the code that Iliana wrote for a person named Kris who wanted edge collapsing. Uncomment this part of the code and comment the part on top of it so that it looks like this: COMMENT THIS OUT: {{{#!java for ( int ci = 0; ci < connectingEdgesRindices.length; ++ci ) { edges_to_restore.add( connectingEdgesRindices[ci] ); } }}} UNCOMMENT THIS: {{{#!java //----------- For Kris Gonsalus:------------------------ // Kris has a graph with 78 nodes, and > 2000 edges, so she // wants to see only one edge between metanodes... edges_to_restore.add(connectingEdgesRindices[0]); //------------------------------------------------------ }}} Compile, make new jar, and load into C2.1. This is a hack! But it should work. After this, I (MarcioSilva) wanted to have an edge attribute that saves the number of edge that each "MetaEdge" is representing. I did this: in {{{metaNodeViewer.model.AbstractMetaNodeModeler}}}: {{{#!java //----------- For Kris Gonsalus:------------------------ // Kris has a graph with 78 nodes, and > 2000 edges, so she // wants to see only one edge between metanodes... edges_to_restore.add(connectingEdgesRindices[0]); // path by mrsva int edge = connectingEdgesRindices[0]; String attr = new String("metaedgesize"); Integer value = new Integer(connectingEdgesRindices.length); cy_network.setEdgeAttributeValue(edge, attr, value); // end mrsva's path }}} and in {{{metaNodeViewer.data.SimpleMetaNodeAttributesHandler}}} class: from line 269: {{{#!java for (int i = 0; i < allAttrNames.length; i++) { String attrName = allAttrNames[i]; if (attrName.equals("metaedgesize")) // added by mrsva continue; // reserved // added by mrsva if (attrName.equals("interaction")) continue; // reserved if (attrName.equals(Semantics.CANONICAL_NAME)) continue; // reserved }}} and from line 345 (or 343 if the modification above was not made): {{{#!java for (int i = 0; i < attributes.length; i++) { if (attributes[i].equals(Semantics.CANONICAL_NAME) || attributes[i].equals(Semantics.COMMON_NAME) || attributes[i].equals("metaedgesize")) { // added by mrsva continue; } }}} You can get the complete file {{{SimpleMetaNodeAttributesHandler.java}}} with the modifications here: [[attachment:SimpleMetaNodeAttributesHandler.java]] A final hack (also from Iliana) is in the main {{{cytoscape.jar}}} file to avoid some exceptions in the execution of the plugin. There are 2 fixes. As the fixes are both in the Cytoscape core, you will need to download the source for Cytoscape 2.1 (NOT the source in CVS, which is under development!). To get the source code of Cytoscape 2.1 go to [[http://cytoscape.org/download_list.php|Cytoscape download page]]. The fixes are very easy: 1. In class {{{cytoscape.visual.VisualMappingManager }}} modify method {{{ applyEdgeAppearances( CyNetwork network, CyNetworkView network_view ) }}} to do this: {{{#!java EdgeAppearanceCalculator edgeAppearanceCalculator = visualStyle.getEdgeAppearanceCalculator(); for (Iterator i = network_view.getEdgeViewsIterator(); i.hasNext(); ) { EdgeView edgeView = (EdgeView)i.next(); //----------- NEW -------------------------------------- if(edgeView == null){ continue; } //---------------------------------------------------------- // other code stays the same... }}} 2.#2 In class {{{ cytoscape.view.GraphViewController }}} modify method {{{ graphPerspectiveChanged (GraphPerspectiveChangeEvent event) }}} to do this: {{{#!java public void graphPerspectiveChanged (GraphPerspectiveChangeEvent event){ //TODO: Remove //System.out.println("In GraphViewController.graphPerspectiveChanged(), event = " + event); // ------------------- NEW ------------------------------------------------------- // Weird. The source can be a GraphPerspective, or a RootGraph // even though the name of the event is GraphPerspectiveChangeEvent Object source = event.getSource(); if(!(source instanceof GraphPerspective)){ //TODO: What to do here??? System.out.println("GraphViewController.graphPerspectiveChanged(): The source of the event is not a GraphPerspective!. Event = " + event); return; } //------------------------------------------------------------------------------------- // code after this stays the same... }}}