JSON FORMAT
Cytoscape CX2 logo

Cytoscape CX2

CX2 (Cytoscape Exchange Format, Version 2) is a JSON-based, aspect-oriented format for representing networks together with their attributes and visual styling. It was developed jointly by the Cytoscape and NDEx (Network Data Exchange) teams as the successor to the original CX format (Cytoscape CX), designed to be more compact, more streaming-friendly, and simpler to parse. It is the native transport format used to move networks between Cytoscape Desktop, Cytoscape Web, and the NDEx repository.

A CX2 document is a single JSON array. Its first element is a required CX descriptor declaring the version; the final element is a required status object confirming successful generation. Between them sit optional pre/post metadata blocks and a sequence of "aspect" data blocks, each an independently schema'd fragment of the network. Core aspects include attributeDeclarations (which types every attribute and defines defaults and aliases, and must precede any aspect that references those attributes), nodes, edges, networkAttributes, and visualProperties, plus nodeBypasses/edgeBypasses for per-element style overrides and visualEditorProperties for viewport and table UI state. Nodes carry a unique id, optional x/y/z coordinates, and an attribute object "v"; edges carry a unique id, source ("s"), target ("t"), and their own "v" object. Supported attribute types include string, long, integer, double, boolean and their list variants.

The most visible change from CX1 is that node coordinates are embedded directly on node elements rather than held in a separate cartesianLayout aspect; the two mechanisms must not be mixed. CX2 also leans on Cytoscape Portable Graphic Styles so that discrete, continuous, and passthrough visual mappings travel with the network across tools.

CX2's strengths are lossless round-tripping of Cytoscape networks (topology, typed attributes, and full visual styling), an aspect model that lets consumers ingest or filter incrementally while streaming, and a compact web-oriented encoding. Its limitations are that it is tightly coupled to the Cytoscape/NDEx ecosystem rather than a neutral interchange format; non-portable styles must be relegated to opaque aspects; special float values such as NaN and Infinity collapse to null; and coordinates are all-or-nothing across nodes. For lighter Cytoscape.js consumption, the simpler Cytoscape JSON is often used instead, and HCX layers hierarchical semantics on top of CX2.

Alternative Names: CX2, Cytoscape Exchange version 2

File Extensions: .cx2 v2.0
FeatureCytoscape CX2
Multiple Graphs per Document not supported
Nodes supported
Directed Edges partial
Hyperedges not supported
Mixed-directionality Edges not supported
Parallel Edges supported
Self-loops supported
Edges on Edges not supported
Nested Graphs in Edges not supported
Node Labels supported
Edge Labels partial
Attributes on Nodes supported
Attributes on Edges supported
Attributes on Graphs supported
Typed Edges supported

Tools(Read & Write)

Read-only Tools

Frequently Asked Questions

What is a Cytoscape CX2 file?

A Cytoscape CX2 file stores a graph — its nodes, edges and attributes — in the Cytoscape CX2 format (also: CX2, Cytoscape Exchange version 2). See the feature table above for what it supports.

How do I open a Cytoscape CX2 file?

Open it in a graph tool that supports Cytoscape CX2, or convert it to a format your tool reads. With GraphInOut you can convert Cytoscape CX2 to GraphML, DOT, Connected JSON and more, right in your browser.

How do I convert a Cytoscape CX2 file to another format?

Use the Convert from Cytoscape CX2 link above: upload or paste your Cytoscape CX2 file (input preset to Cytoscape CX2), choose a target format and download the result — free, no install.