Package netconv :: Module network :: Class Network
[show private | hide private]
[frames | no frames]

Class Network


Stores information of network

Methods for importing/exporting network are provided
Method Summary
  __init__(self, nnodes, nedges)
  attributes2Cluster(self, attr)
Converts attributes to cluster
  cluster2Attributes(self, attr, s)
Converts cluster info to attributes
  findId(self, id)
Finds node by Id
  findNode(self, node)
Finds node by name
  fromList(self, list, nodesList)
reads the network from a list of interactions.
  getAllNodes(self)
Returns a list with all nodes names.
  getAttribute(self, attr, attribs)
Return generic attribute for the network
  pajek2pos(self, mult)
Converts pajek node positions (range from 0 to 1) to graph position
  pos2pajek(self)
Converts node positions to pajek format (range from 0 to 1)
  reset(self)
Cleans the network
  setAttribute(self, attr, value, attribs)
Defines generic attribute for the network
  toList(self)
Converts the network to a list of interactions.

Instance Variable Summary
str coordsModel: set the model used to store network coords

Method Details

__init__(self, nnodes=0, nedges=0)
(Constructor)

Parameters:
nnodes - number of nodes
nedges - number of edges

attributes2Cluster(self, attr=('cluster', 'cluster'))

Converts attributes to cluster
Parameters:
attr - attribute to convert from (defaults to 'Cluster')

cluster2Attributes(self, attr=('cluster', 'cluster'), s='')

Converts cluster info to attributes
Parameters:
attr - attribute that will receive the information (defaults to 'Cluster')
s - string to add at the begining of the value of attribute to avoids problems with "numerical" nodes with the VisualMapper from Cytoscape

findId(self, id)

Finds node by Id
Parameters:
id - Id of node
Returns:
index in the network

findNode(self, node)

Finds node by name
Parameters:
node - name (canonical) of node
Returns:
index in the network

fromList(self, list, nodesList=None)

reads the network from a list of interactions.
Parameters:
list - list of interactions

getAllNodes(self)

Returns a list with all nodes names.

getAttribute(self, attr, attribs=None)

Parameters:
attr - attribute to be read
attribs - dict of attributes
Returns:
generic attribute for the network

pajek2pos(self, mult)

Converts pajek node positions (range from 0 to 1) to graph position
Parameters:
mult - valut to multiply the pajek value

pos2pajek(self)

Converts node positions to pajek format (range from 0 to 1)

reset(self)

Cleans the network

setAttribute(self, attr, value, attribs=None)

Defines generic attribute for the network
Parameters:
attr - attribute to be set (can be a tuple)
value - value of attribute
attribs - dict of attributes

toList(self)

Converts the network to a list of interactions.
Returns:
list of interactions

Instance Variable Details

coordsModel

set the model used to store network coords
  • pajek: coords range from 0 to 1
  • pos: coords are the position in graph
Type:
str
Value:
'pos'                                                                  

Generated by Epydoc 2.1 on Tue Aug 30 11:04:15 2005 http://epydoc.sf.net