Skip to content

Latest commit

 

History

History
134 lines (98 loc) · 7.41 KB

setup.md

File metadata and controls

134 lines (98 loc) · 7.41 KB

Copyright (c) 2020 OERCompBiomed (Seili-2020)

Setting up your system

Are you using Mac?

Then you must install xcode (for free) before you start. See also here and here.
Thereafter (see also here):

  • Launch the terminal.app, found in /Applications/Utilities/
  • Type the following command string: xcode-select --install

On Mac, Windows and Linux we will use the command line (shell)

See e.g. Basic Unix Commands and Computing Skills for Biologists [here] if this is unfamiliar to you. See also the Unix Shell lessons (thanks to Anne Fouilloux, UiO)

... and luckily also the Jupyter notebook

  • for openness ! and reproduciblity !

GitHub:

The course code is hosted on the code-sharing platform GitHub (where you now are reading this). If you do not have a GitHub account already you should make one now (https://github.com/join). We recommend that you are using the platform for your own projects during the course. Hence:

  • Create an account on GitHub (https://github.com) using the Sign up for GitHub form on the right side of the page.
  • Send your GitHub username to your instructor.
  • Once your instructor adds you to the course GitHub organization you will receive an email asking you to accept the invitation. Click on the link to accept.
  • Check if this worked
    • Go to https://github.com.
    • Sign in if necessary.
    • In the upper left corner click on the drop down with your name.
    • Confirm that the name of the course GitHub organization is present

Anaconda:

We recommend installing Python via the Anaconda Distribution. Be sure to use the "Python 3.7.x" version. We will use the Conda Package Management System within the Anaconda Distribution. From the documentation:

Conda is an open source package management system and environment management system that runs on Windows, macOS and Linux. Conda quickly installs, runs and updates packages and their dependencies. Conda easily creates, saves, loads and switches between environments on your local computer.

After the installation run python --version in a terminal window (in "Anaconda Prompt" if you are using Windows). If the output show "Python 3.7.x" (and "Anaconda") you are good to go.

Atom:

Atom is a free and open-source text and source code editor for writing and editing text files e.g. YAML configuration files, Markdown files, JSON files, HTML files and others. By its developers it is called a "hackable text editor for the 21st Century" and is a useful tool in addition to the browser-based Jupyter notebook that we will use. You can also render markdown files (e.g. local README.md files): Packages -> Markdow Preview -> Toggle Preview.
Install Atom (Mac Windows Linux) from: https://flight-manual.atom.io/getting-started/sections/installing-atom

ITK-SNAP:

ITK-SNAP is an open-source image analysis tool used to segment and label structures in 3D medical images. ITK-SNAP is supported on Mac, Windows and Linux and provides semi-automatic segmentation using active contour methods, as well as manual delineation and image navigation. You can read and interact with DICOM and NIFTI images, and plot time-course data. Download the newest release of ITK-SNAP at http://www.itksnap.org/pmwiki/pmwiki.php?n=Downloads.SNAP3

GitHub:

The course code is hosted on the code-sharing platform GitHub (where you now are reading this). If you do not have a GitHub account already you should make one now. We recommend that you are using the platform for you own projects during the course. https://github.com/join.

Install and test the course environment

After you have successfully installed Anaconda, go through the following steps (if you are using Windows, be at the "Anaconda Prompt").

Install Git:

conda install git

Download the repository:

git clone https://github.com/OERCompBiomed/Seili-2020
cd Seili-2020
# git clone https://github.com/arvidl/Seili-2020-dev
# cd Seili-2020-dev

Configure the Python-environment:

conda env update

Activate the environment:

conda activate seili2020

Install a Jupyter kernel:

python -m ipykernel install --user --name seili2020 --display-name "SEILI2020"

Optionally - install notebook extension ipywidgets

jupyter nbextension enable --py --sys-prefix widgetsnbextension

Optionally - install Jupyter extensions

These are useful to have nice tables of contents in the notebooks, but they are not required

conda install -n seili2020 -c conda-forge jupyter_contrib_nbextensions

Optionally - Jupyter Lab

You can (preferably) consider to use JupyterLab, i.e. > jupyter lab
(in addition to or insted of the > jupyter notebook)

Test you installation:

Go through the notebook 0.0-test-installation.ipynb in the test-notebooks-directory:

cd test-notebooks
jupyter notebook  (or, jupyter lab)

.

Update:

The code and environment will be updated during the course. Run the following commands regularly:

  • Update code: git pull
  • Update environment:
conda activate seili2020
conda env update

Unix Shell

Learners need to understand what files and directories are and what a working directory is. These concepts are covered in the Unix Shell lessons (thanks to Anne Fouilloux, UiO)

Programming with Python

The best way to learn how to program is to do something useful, so this introduction to Python is built around a common scientific task: data analysis; see also here (thanks to Anne Fouilloux, UiO)

A note on R (tip for previous R users)

It is possible to run R-scripts in Jupyter notebooks (Jupyter = Julia, Python and R).

If you want to continue working with R (not part of this course) you should:

  • Be using the latest R version (https://www.r-project.org) and the RStudio Desktop [download] for your Windows, MacOS or Linux system.
  • Install the R kernel by opening an R console and then follow the instructions at https://irkernel.github.io/installation
  • Necessary (or new) R libraries should be installed via RStudio and the corresponding R environment.
  • See also here and here.
  • The rpy2 interface to use R form Python is also possible (but can be a bit more messy).