python-igraph manual

For using igraph from Python

   Home       Trees       Indices       Help   
Package igraph :: Package drawing :: Module graph :: Class CytoscapeGraphDrawer
[hide private]

Class CytoscapeGraphDrawer

source code

                  object --+        
                           |        
  baseclasses.AbstractDrawer --+    
                               |    
baseclasses.AbstractXMLRPCDrawer --+
                                   |
                  object --+       |
                           |       |
  baseclasses.AbstractDrawer --+   |
                               |   |
             AbstractGraphDrawer --+
                                   |
                                  CytoscapeGraphDrawer

Graph drawer that sends/receives graphs to/from Cytoscape using CytoscapeRPC.

This graph drawer cooperates with Cytoscape using CytoscapeRPC. You need to install the CytoscapeRPC plugin first and start the XML-RPC server on a given port (port 9000 by default) from the appropriate Plugins submenu in Cytoscape.

Graph, vertex and edge attributes are transferred to Cytoscape whenever possible (i.e. when a suitable mapping exists between a Python type and a Cytoscape type). If there is no suitable Cytoscape type for a Python type, the drawer will use a string attribute on the Cytoscape side and invoke str() on the Python attributes.

If an attribute to be created on the Cytoscape side already exists with a different type, an underscore will be appended to the attribute name to resolve the type conflict.

You can use the network_id attribute of this class to figure out the network ID of the last graph drawn with this drawer.

Instance Methods [hide private]
 
__init__(self, url='http://localhost:9000/Cytoscape')
Constructs a Cytoscape graph drawer using the XML-RPC interface of Cytoscape at the given URL.
source code
 
draw(self, graph, name='Network from igraph', create_view=True, *args, **kwds)
Sends the given graph to Cytoscape as a new network.
source code
 
fetch(self, name=None, directed=False, keep_canonical_names=False)
Fetches the network with the given name from Cytoscape.
source code

Inherited from AbstractGraphDrawer: ensure_layout

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
infer_cytoscape_type(values)
Returns a Cytoscape type that can be used to represent all the values in `values` and an appropriately converted copy of `values` that is suitable for an XML-RPC call.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, url='http://localhost:9000/Cytoscape')
(Constructor)

source code 

Constructs a Cytoscape graph drawer using the XML-RPC interface of Cytoscape at the given URL.

Parameters:
  • url - the URL where the XML-RPC calls for the service should be addressed to.
  • service - the name of the service at the XML-RPC address. If None, requests will be directed to the server proxy object constructed by xmlrpclib.ServerProxy; if not None, the given attribute will be looked up in the server proxy object.
Overrides: object.__init__

draw(self, graph, name='Network from igraph', create_view=True, *args, **kwds)

source code 

Sends the given graph to Cytoscape as a new network.

Parameters:
  • name - the name of the network in Cytoscape.
  • create_view - whether to create a view for the network in Cytoscape.The default is True.
  • node_ids - specifies the identifiers of the nodes to be used in Cytoscape. This must either be the name of a vertex attribute or a list specifying the identifiers, one for each node in the graph. The default is None, which simply uses the vertex index for each vertex.
Overrides: baseclasses.AbstractDrawer.draw

fetch(self, name=None, directed=False, keep_canonical_names=False)

source code 

Fetches the network with the given name from Cytoscape.

When fetching networks from Cytoscape, the canonicalName attributes of vertices and edges are not converted by default. Use the keep_canonical_names parameter to retrieve these attributes as well.

Parameters:
  • name - the name of the network in Cytoscape.
  • directed - whether the network is directed.
  • keep_canonical_names - whether to keep the canonicalName vertex/edge attributes that are added automatically by Cytoscape
Returns:
an appropriately constructed igraph Graph.

infer_cytoscape_type(values)
Static Method

source code 

Returns a Cytoscape type that can be used to represent all the values in `values` and an appropriately converted copy of `values` that is suitable for an XML-RPC call. Note that the string type in Cytoscape is used as a catch-all type; if no other type fits, attribute values will be converted to string and then posted to Cytoscape.

``None`` entries are allowed in `values`, they will be ignored on the Cytoscape side.


   Home       Trees       Indices       Help