Networks

Basic Networks

Functions for NETWORK management and retrieving information on networks, nodes and edges. Includes all functions that result in the creation of a new network in Cytoscape, in addition to funcitons that extract network models into other useful objects.

  1. General network functions

  2. General node functions

  3. General edge functions

  4. Network creation

  5. Network extraction

  6. Internal functions

Note

See the Network Selection section for all selection-related functions.

See the Utils section for functions that convert node and edge names to SUIDs, and vice versa.

Nodes

add_cy_nodes(node_names[, …])

Add one or more nodes to a Cytoscape network.

get_all_nodes([network, base_url])

Retrieve the names of all the nodes in the network.

get_first_neighbors([node_names, …])

Returns a non-redundant list of first neighbors of the supplied list of nodes or current node selection.

get_node_count([network, base_url])

Reports the number of nodes in the network.

Edges

add_cy_edges(source_target_list[, …])

Add one or more edges to a Cytoscape network by listing source and target node pairs.

get_all_edges([network, base_url])

Retrieve the names of all the edges in the network.

get_edge_count([network, base_url])

Reports the number of the edges in the network.

get_edge_info(edges[, network, base_url])

Returns source, target and edge table row values.

Network Management

clone_network([network, base_url])

Makes a copy of a Cytoscape Network with all of its edges and nodes.

create_subnetwork([nodes, nodes_by_col, …])

Copies a subset of nodes and edges into a newly created subnetwork.

delete_all_networks([base_url])

Delete all networks from the current Cytoscape session.

delete_network([network, base_url])

Delete a network from the current Cytoscape session.

get_network_count([base_url])

Get the number of Cytoscape networks in the current Cytoscape session.

get_network_list([base_url, get_suids])

Returns the list of Cytoscape network names in the current Cytoscape session.

get_network_name([suid, base_url])

Get the name of a network.

get_network_suid([title, base_url])

Get the SUID of a network.

rename_network(title[, network, base_url])

Sets a new name for a network.

set_current_network([network, base_url])

Selects the given network as “current”.

Import/Export

create_cytoscapejs_from_network([network, …])

Create a Cytoscape JS representation of a Cytoscape network.

create_igraph_from_network([network, base_url])

Create an igraph network from a Cytoscape network.

create_network_from_cytoscapejs(cytoscapejs)

Create a network from CytoscapeJS JSON.

create_network_from_data_frames([nodes, …])

Create a network from data frames.

create_network_from_igraph(igraph[, title, …])

Create a Cytoscape network from an igraph network.

create_network_from_networkx(netx[, title, …])

Create a Cytoscape network from a NetworkX graph.

create_networkx_from_network([network, base_url])

Return the Cytoscape network as a networkx multi-di-graph.

export_network([filename, type, network, …])

Export a network to one of mulitple file formats.

import_network_from_file([file, base_url])

Loads a network from specified file.

import_network_from_tabular_file([file, …])

Loads a network from specified file.

Network Selection

Functions for working with SELECTIONS of nodes and edges in networks, including operations that perform selection and rely on prior selection events.

  1. General selection functions

  2. Node selection functions

  3. Edge selection functions

Nodes

clear_selection([type, network, base_url])

If any nodes are selected in the network, they will be unselected.

delete_selected_nodes([network, base_url])

Delete currently selected nodes from the network.

get_selected_node_count([network, base_url])

Returns the number of nodes currently selected in the network.

get_selected_nodes([node_suids, network, …])

Retrieve the names of all the nodes selected in the network.

invert_node_selection([network, base_url])

Select all nodes that were not selected and deselect all nodes that were selected.

select_all([network, base_url])

Selects all nodes and edges in a Cytoscape Network

select_all_nodes([network, base_url])

Selects all nodes in a Cytoscape Network.

select_first_neighbors([direction, network, …])

Select nodes directly connected to currently selected nodes.

select_nodes(nodes[, by_col, …])

Select nodes in the network by SUID, name or other column values.

select_nodes_connected_by_selected_edges([…])

Take currently selected edges and extends the selection to connected nodes, regardless of directionality.

Edges

clear_selection([type, network, base_url])

If any nodes are selected in the network, they will be unselected.

delete_duplicate_edges([network, base_url, …])

Remove edges with duplicate names.

delete_selected_edges([network, base_url])

Delete the currently selected edges in the network.

delete_self_loops([network, base_url])

Removes edges that connect to a single node as both source and target.

get_selected_edge_count([network, base_url])

Return the number of edges currently selected in the network.

get_selected_edges([edge_suids, network, …])

Retrieve the names of all the edges selected in the network.

invert_edge_selection([network, base_url])

Select all edges that were not selected and deselect all edges that were selected.

select_all([network, base_url])

Selects all nodes and edges in a Cytoscape Network

select_all_edges([network, base_url])

Selects all edges in a Cytoscape Network.

select_edges(edges[, by_col, …])

Select edges in the network by SUID, name or other column values.

select_edges_adjacent_to_nodes(nodes[, …])

Take currently selected nodes and add to the selection all edges connected to those nodes, regardless of directionality.

select_edges_adjacent_to_selected_nodes([…])

Take currently selected nodes and add to the selection all edges connected to those nodes, regardless of directionality.

select_edges_connecting_selected_nodes([…])

Select edges in a Cytoscape Network connecting the selected nodes, including self loops connecting single nodes.

Network Views

Functions for performing VIEW operations in addition to getting and setting view properties.

Views

create_view([layout, network, base_url])

Create a network view if one does not already exist

export_image([filename, type, resolution, …])

Save the current network view as an image file.

fit_content([selected_only, network, base_url])

Zoom and pan network view to maximize either height or width of current network window.

get_network_view_suid([network, base_url])

Retrieve the SUID of a network view.

get_network_views([network, base_url])

Retrieve list of network view SUIDs.

set_current_view([network, base_url])

Set which network view is “current”.

toggle_graphics_details([base_url])

Toggle Graphics Details.