Skip to content

Latest commit

 

History

History
84 lines (64 loc) · 3.2 KB

ndex2.rst

File metadata and controls

84 lines (64 loc) · 3.2 KB

NiceCXNetwork

Note

Using the newer data model :py~ndex2.cx2.CX2Network is encouraged since all networks on NDEx can be retrieved in newer CX2 format via the NDEx REST Service

The ~ndex2.nice_cx_network.NiceCXNetwork class provides a data model for working with NDEx networks that are stored in the legacy CX format

The term niceCX is CX with no duplicate aspects.

Methods are provided to add nodes, edges, node attributes, edge attributes, etc. Once a ~ndex2.nice_cx_network.NiceCXNetwork object is populated it can be saved to the NDEx server by calling either :py~ndex2.nice_cx_network.NiceCXNetwork.upload_to to create a new network or :py~ndex2.nice_cx_network.NiceCXNetwork.update_to to update an existing network.

Methods

Example usage of the methods below can be found in the Jupyter notebook links here:

Tutorial Notebook Navigating NiceCXNetwork Notebook

Node methods

ndex2.nice_cx_network.NiceCXNetwork

Edge methods

ndex2.nice_cx_network.NiceCXNetwork

Network methods

ndex2.nice_cx_network.NiceCXNetwork

Miscellaneous methods

ndex2.nice_cx_network.NiceCXNetwork

Supported data types

The following CX Data Types are supported in methods that accept type

Example:

import ndex2
net = ndex2.nice_cx_network.NiceCXNetwork()
node_id = net.create_node('hi')
net.set_node_attribute(node_id, 'somevalue', 0.5, type='double')
  • string
  • double
  • boolean
  • integer
  • long
  • list_of_string
  • list_of_double
  • list_of_boolean
  • list_of_integer
  • list_of_long

These constants are defined here: :py~ndex2.constants.VALID_ATTRIBUTE_DATATYPES