Author : Nathaniel Evans (evansna@ohsu.edu)
This tutorial is intended for use in Oregon Health & Science University (OHSU) BMI 567/667: Network Science and Biology – Principles, Programming, Analysis and Visualization.
I recommend setting up a local environment to run this tutorial; however, if you run into issues it can be run using mybinder.org. It may take 5-10 minutes to set up the docker image so double check that it works before class. Also, keep in mind that some of the more computationally expensive operations in the tutorial may take longer to run on mybinder.
It's recommended to have access to bash for this installation, if you are on windows this can be done using git bash or WSL2.
$ git clone https://github.com/nathanieljevans/networkx_tutorial.git
$ cd networkx_tutorial
First, make sure you have the conda package manager installed.
If you're new to conda, this is a helpful command cheat sheet.
# create the conda env
$ conda create --file environment.yml
Note: This may be quite slow. In case it is too slow, try to install packages individually using pip after creating the environment with Python=3.10 as shown below.
# If you have not run the above command, create an environment first
$ conda create -n nx_env python=3.10
# activate the environment
$ conda activate nx_env
# install packages individually
$ pip install networkx
$ pip install matplotlib
$ pip install pandas
$ pip install seaborn
$ pip install jupyter
$ pip install ipykernel
$ pip install scipy
$ conda activate nx_env
Step 4: Start a Jupyter session or Open the folder in VSCode (Preferred). To use VSCode, make sure it has Python lanugage extension bundle installed.
$ jupyter notebook
Note, if you're in WSL, the window won't automatically open. You will need to copy the provided url (see output from command) into a browser.