This repo demonstrates how to use the ipycytoscape widget to visualize a Neo4j subgraph with cytoscape.js in JupyterLab and the Jupyter notebook.
Notebook | Description |
---|---|
Neo4j_Example1 | Creates a small Neo4j graph locally and demonstrates how to display a Neo4j subgraph |
Neo4j_Example2 | Accesses the COVID-19-Net Knowledge Graph server and demonstrates how to display a Neo4j subgraph |
Follow the steps below to setup and run the example notebooks on Mac, Linux, or Windows.
Prerequisites: Miniconda3 (light-weight, preferred) or Anaconda3 and Mamba
- Install Miniconda3
- Update an existing miniconda3 installation:
conda update conda
- Install Mamba:
conda install mamba -n base -c conda-forge
- Install Git (if not installed):
conda install git -n base -c anaconda
1. Clone this Git repository
git clone https://github.com/sbl-sdsc/neo4j-ipycytoscape.git
cd neo4j-ipycytoscape
2. Create a Conda environment
The file environment.yml
specifies the Python version and all packages required by the tutorial.
mamba env create -f environment.yml
Activate the conda environment
conda activate neo4j-ipycytoscape
3. Launch Jupyter Lab
jupyter lab
Navigate to the notebooks
directory to run the example Jupyter Notebooks.
4. Deactivate the Conda environment
When you are finished, deactivate the conda environment or close the terminal window.
conda deactivate
To remove the Conda environment, run
conda env remove -n neo4j-ipycytoscape
Run Jupyter Lab in your web browser using Pangeo Binder
NOTE: Authentication is required to launch binder! Sign into GitHub from your browser, then click on the launch binder
badge below to launch Jupyter Lab.
Pangeo Binder is unsupported and may not always be available or slow. Launching Jupyter Lab may take a few minutes.
Prerequisites:
- XSEDE account
- Expanse allocation
- Append
export PATH="/cm/shared/apps/sdsc/galyleo:${PATH}"
to your.bashrc
on Expanse and runsource ./.bashrc
-
Log into the Expanse Portal with your XSEDE credentials.
-
Open a Terminal Window ("Shell Access") through the Expanse Portal
-
Clone the Git repository neo4j-ipycytoscape
git clone https://github.com/sbl-sdsc/neo4j-ipycytoscape.git
-
Launch Jupyter Lab using the Galyleo
Fill in the your project account number in the command below.
This script will generate a URL for your Jupyter Lab session.
galyleo launch --account <account_number> --partition shared --cpus 4 --memory 8 --time-limit 00:30:00 --conda-env neo4j-ipycytoscape --conda-yml "${HOME}/neo4j-ipycytoscape/environment.yml" --mamba
- Open a new tab in your web browser and paste the Jupyter Lab URL.
You should see the Satellite Reserver Proxy Servive page launch in your browser.
Wait until Jupyter Lab launches. This may take several minutes.
-
Run the example notebooks
Navigate to the
notebooks
directory to run the example Jupyter Notebooks. -
Shutdown Jupyter Lab
From the file menu select
Shutdown
to terminate the process.
If you do not shutdown Jupyter Lab, the process will continue running and use up allocated resources.
Peter W. Rose, David Valentine, Ilya Zaslavsky, COVID-19-Net: Integrating Health, Pathogen and Environmental Data into a Knowledge Graph for Case Tracking, Analysis, and Forecasting. Available online: https://github.com/covid-19-net/covid-19-community (2020).
The Neo4j graph visualization for ipycytoscape is in part supported by the National Science Foundation under Award Numbers:
NSF Convergence Accelerator Phase I (RAISE): Knowledge Open Network Queries for Research (KONQUER) (1937136)
NSF RAPID: COVID-19-Net: Integrating Health, Pathogen and Environmental Data into a Knowledge Graph for Case Tracking, Analysis, and Forecasting (2028411)