This repository contains tutorials and code examples to work with networks using the ndex2
Python client and NiceCX object class.
The tutorials require Python 3.6+ and the ndex2
module . See the ndex2 GitHub repo for installation instructions.
In this tutorial you will learn to use the ndex2
Python client. It is a module that simplifies access to the NDEx
Server API and provides convenience methods for common operations on networks.
This notebook shows how to:
- Load a network from
NDEx
- Copy and apply a visual style from an existing template in
NDEx
- Save (upload) the modified network to your
NDEx
account - Apply a layout
- Save (update) the modified network to your
NDEx
account
This notebook shows how to:
- download a network from
NDEx
as aNiceCX
network - make a
networkxGraph()object
via the to_networkx(mode='default') method - display the networkx network
- remove 0 degree nodes
- create a new
NiceCX
network from the modified networkx network - upload the new network to NDEx.
This notebook shows how to find subgraphs of NDEx networks based on queries in which a list of strings is applied to a network. The result returned is a CX
network containing nodes whose names match one of the strings and nodes that are "nearby" in the network, the "neighborhood" subgraph. A common use for these queries is to find subgraphs of an interactome based on a list of gene names.
This notebook shows how to create a NiceCX
network from:
- An Empty Network
- A CX File
- An NDEx Networks
- A NetworkX Network
- A Pandas DataFrame
Network Sets
are used to group networks. They are essentially sets of "bookmarks", where a network can belong to many different sets, created by different users. This notebook shows how to:
- Get a network set
- Operate on the networks in a set
- Create a network set
- Add a network to a set
- Remove a network from a set
- Rename a network set
- Delete a network set
This notebook shows how to access the elements of the NiceCX
network object.
This notebook shows how to perform simple operations on networks stored in NDEx
, using the ndex2
client and NiceCX
class. This notebook is part of the publication: "NDEx: Accessing Network Models and Streamlining Network Biology Workflows" (Curr Protoc. 2021 Sep;1(9):e258. doi: 10.1002/cpz1.258).
In this notebook, we show how to extract information from PubMed records using the Element Tree XML
API, organize it in a Pandas
dataframe and save it to NDEx
as a network. The starting point of the notebook is a short list of PubMed IDs (PMIDS), so this example doesn't include any code to query the PubMed API.
This notebook shows how to reset the values used in a continuous mapping to match the actual range of values in the data rather then using the range of values present in the style template. This is achieved by using py4cytoscape
to control the Cytoscape
desktop application.