Logo

CB2030

Here we store material for the Data Analysis part of the CB2030, Systems Biology course.

This project is maintained by statisticalbiotechnology

Getting your software ready

We suggest you install the software with conda from the command line (first section below). Alternatively, you can use the Anaconda graphical interface (second section).

Installing the software with conda (bash)

If you work on Windows, we suggest you install the Linux subsystem for Windows first, and follow the instructions for Linux.

  1. Install (Mini)conda by following instructions for Linux or MacOS
  2. Clone the course directory by running git clone https://github.com/statisticalbiotechnology/cb2030.git.
  3. Go to the Lab0 directory (cd cb2030/lab/Lab0/)
  4. Create the environment (conda env create -f cb2030-labs-environment.yml)
  5. Activate the environment (conda activate cb2030)

Installing the software with Anaconda (Graphical User Interface)

  1. Install Anaconda, you can download it here.
  2. Download the files needed for the lab here (Check the green “Code” field in top right corner or (better) write and execute git clone https://github.com/statisticalbiotechnology/cb2030.git in your command line (Linux/Mac/Linux subsystem for Windows).
  3. Open Anaconda Navigator.
  4. Environments → Import.
  5. Select the cb2030-labs-environment.yml file.
    • If you are using Windows, select the cb2030-labs-environment-windows.yml file instead.
    • This will install some packages that are required for the labs, it might take some time.
  6. Once this is done, we will test to see if everything works correctly.

Testing if everything installed correctly

If you installed the conda environment through the terminal:

  1. Launch Jupyter Notebook (jupyter notebook, the conda environment needs to be activated, see point nr 5 above).
  2. Enter one of the links displayed in the terminal (clicking on it while holding ctrl or Cmd should work, otherwise you can copy the link and open it in the browser). Or, if you installed the environment through Anaconda Graphical User Interface:
  3. On Anaconda Navigator → Home, select cb2030 on the Applications on: dropdown menu.
  4. Launch Jupyter Notebook by clicking [Launch].

The following steps are common regardless of the way you installed the conda environment:

  1. Navigate to and open the Lab0.ipynb notebook.
  2. Run the first cell by clicking on [► Run].
    • You only need to run the first cell to test the software. The rest of the notebook gives you an introduction on how to use Jupyter notebooks.
  3. If you didn’t get any errors, your Python installation is ready! :D

Introduction to Jupyter notebooks.

The rest of the notebook will give you an overview of how to use Jupyter notebooks, something we will use a lot on the course. You can now try to follow it along.

If you have encountered any problems during the software installation, or have any question on how to use notebooks, bring your questions to lab session C0.


Appendix: The course JupyterHub

If you cannot install and run Jupyter notebooks on your own computer, you can use the course’s JupyterHub instead. It is a single server shared by everyone on the course, not a KTH-wide service, so please use it only if your own computer doesn’t work. Sign in with your hub account, and the material is copied into your own workspace. Following the link again later updates the material without discarding the changes you have made. Open the labs on the course JupyterHub.

Appendix: Binder

As a last resort, you can run the notebooks on the cloud through a service called Binder.

All you have to do is click this respective icon for the notebook you want: Binder

There are, however, two big caveats of doing this, the first being that the notebook will shut down after 10 minutes of inactivity (if you leave your window open, this will be counted as “activity”), and this means that you can easily lose all your data and progress if you are not careful. The second is that it will run much slower in the cloud than on your computer.