Introduction to Bioinformatics
Laboratory Manual
Preface
Welcome to the Introduction to Bioinformatics laboratory manual, the companion practical for the Introduction to Bioinformatics course of the Màster en Enginyeria Biomèdica at the Universitat Politècnica de Catalunya.
This manual is the Quarto edition of the lab book originally written in Sweave/LaTeX by Flavio Palmieri and Alexandre Perera i Lluna (b2slab.upc.edu). Each chapter is a self-contained laboratory that mixes explanatory text, runnable R code, and exercises.
How the labs are organised
Every lab follows the same rhythm: a short motivation, worked examples you can run line by line, and a set of exercises (marked with a ✅ callout) that you are expected to complete and write up in a report.
The laboratories are:
- Introduction to R — the R language, data types, and graphics.
- Searching NCBI — querying biological databases.
- Association studies — genotype–phenotype association.
- Gait / GWAS — genome-wide association on a quantitative trait.
- Homology — sequence alignment and homology search.
- Eigenfaces — principal component analysis on images.
- Differential expression — transcriptomics analysis.
- Functional enrichment — over-representation and pathway analysis.
Tools for working with R
The code in this book is written in R. The labs are designed to be worked through in your own script or notebook: type the code, run it, and inspect the results as you go. You will need:
- A computer.
- R, the language interpreter, installed from https://www.R-project.org. R itself is free and open-source software (GPL).
- An editor or integrated development environment (IDE) — see below.
Most of these editors are free and open source; the exceptions are noted.
- RStudio Desktop (https://posit.co/download/rstudio-desktop/) is the classic R IDE: console, editor, plots, help, and package management in one workbench. It is the environment we recommend for this course. RStudio is open source (AGPLv3); the company behind it, Posit, also sells a commercial server edition, but the desktop IDE is fully free.
- Positron (https://positron.posit.co/) is a newer, polyglot data-science IDE from Posit with first-class support for both R and Python. It is built on Code OSS — the open-source core of Visual Studio Code from which editors like VSCodium are also derived — but Positron itself is source-available rather than open source: you can read and build the code, yet its Elastic License 2.0 restricts offering it as a paid service.
- Visual Studio Code / VSCodium with the R extension, Emacs with ESS, Vim/Neovim with Nvim-R, and Jupyter with an R kernel are further open-source options; any plain text editor plus a terminal running
Rworks too.
The labs have been tested on GNU/Linux and macOS (both x86-64 and ARM); Windows may require some extra setup.
Exercises are marked with a ✅ callout, and most have a collapsed solution right below them — click to expand, but only after giving the exercise a serious attempt.
R is case sensitive. Pay attention to upper- and lower-case letters in function and variable names throughout these labs.