Skip to content

Latest commit

 

History

History
281 lines (200 loc) · 10.7 KB

File metadata and controls

281 lines (200 loc) · 10.7 KB

Computational Pathology Learning Resources

Table of contents

Overview

This repository provides introductory and foundational learning resources for students who are starting computational pathology, bioinformatics, or research computing.

The linked materials are intended to help beginners become familiar with:

  • Python programming for scientific computing
  • Linux and the command-line shell
  • Git and GitHub for version control and collaboration
  • High-performance computing, job scheduling, and parallel computing

These resources are suitable for beginners and researchers with little or no previous experience. The focus here is on learning content that supports practical skill-building for research.

Recommended learning pathway

We recommend working through the resources in the following order:

  1. Linux shell and command-line fundamentals
  2. Git and GitHub
  3. Python programming
  4. High-performance computing

Students should first become comfortable navigating files and running commands, then learn version control, followed by Python, before progressing to HPC concepts such as remote systems, job scheduling, and parallel execution.

Resource 1: Software Carpentry Foundations

This is a beginner-friendly introduction to core research-computing skills.

It covers:

  • Navigating files and directories using the shell
  • Working with Bash commands
  • Automating repetitive tasks
  • Git fundamentals
  • Tracking changes in research code
  • Using GitHub for sharing and collaboration
  • Python programming
  • Jupyter Notebook
  • Basic scientific-computing workflows
  • Software installation and environment setup

Recommended for: students who are new to the command line, Git, GitHub, and Python.

Resource 2: Shell, Git, GitHub and Python

This is a more structured and detailed learning pathway covering foundational programming and research-computing skills.

Linux shell

  • Navigating files and directories
  • Creating and managing files
  • Pipes and filters
  • Loops
  • Shell scripts
  • Searching for files and content

Git and GitHub

  • Creating repositories
  • Tracking changes
  • Reviewing project history
  • Ignoring files
  • Working with remote repositories
  • Collaboration through GitHub
  • Open science, licences, and citations

Python

  • Modules, commands, and package installation
  • Variables and data types
  • Strings
  • Lists and tuples
  • Dictionaries and sets
  • Conditional expressions
  • Loops
  • Functions
  • File input and output
  • Object-oriented programming
  • Plotting
  • Accessing APIs

The page also provides workshop notes and installation guidance.

Recommended for: students who want a step-by-step introduction to Python, Linux shell, Git, and GitHub.

Resource 3: High-Performance Computing

This is an introduction to using high-performance computing systems for computationally demanding research.

It introduces:

  • Terminal fundamentals for HPC users
  • General HPC concepts
  • Logging in to remote computing systems
  • Working with files and directories on a cluster
  • Git for HPC-based projects
  • Text processing
  • Parallel processing
  • GNU Parallel
  • SLURM workload management
  • Writing and submitting computational jobs
  • Python on HPC systems
  • Parallelisation concepts
  • Parallel programming in Python
  • Introductory parallel-programming tools and languages

Recommended for: students who have already studied the shell and Python resources and want to begin working with clusters and batch-computing systems.

Resource 4: Napari IMC Data Visualization Notebook

This notebook introduces interactive visualization of Imaging Mass Cytometry (IMC) images and segmentation masks using Napari.

It is intended for lab members who already have basic familiarity with Python and Jupyter notebooks and want to inspect multiplex images, marker channels, segmentation labels, and simple cell-level summaries.

What is Napari?

Napari is an open-source, Python-based viewer for multidimensional scientific images. In computational pathology and spatial biology, it is useful because it can display multiplex microscopy data as separate image layers, adjust contrast interactively, overlay segmentation labels, and inspect image regions without converting the data into static figures first.

For IMC work, Napari is especially helpful for checking whether marker channels, tissue structures, and segmentation masks are spatially aligned. This makes it a practical quality-control tool before downstream cell phenotyping, spatial-feature extraction, or statistical analysis.

How this notebook uses Napari for IMC images

The notebook is designed as an interactive viewer for a typical IMC workflow directory. It:

  1. Reads data/panel.csv so IMC channel numbers can be matched to biological marker names.
  2. Finds the workflow directory automatically, or uses IMC_WORKFLOW_DIR when that environment variable is set.
  3. Lists available ROI images from data/img/ and allows the user to choose one ROI.
  4. Loads the selected multi-channel TIFF image and checks the image channel dimension against the panel metadata.
  5. Loads the matching segmentation mask from data/masks/ using the same ROI file stem.
  6. Opens a Napari viewer with marker channels added as image layers.
  7. Builds simple composite views for selected marker groups, such as nuclear, immune, stromal, or tumor-context channels when those markers are present.
  8. Overlays the segmentation mask as a labels layer so users can inspect cell boundaries against the IMC signal.
  9. Saves selected screenshots to figures/napari_screenshots/ for lab notes, presentations, or QC documentation.
  10. Summarises simple cell-area measurements from the segmentation labels as a first-pass QC check.

The notebook is meant for descriptive image review and segmentation quality control. It is not a formal diagnostic, prognostic, predictive, or causal analysis by itself.

The notebook supports:

  • loading multi-channel TIFF images
  • reading marker names from panel.csv
  • selecting an ROI image
  • loading a matching segmentation mask
  • viewing marker channels in Napari
  • creating simple composite views
  • overlaying segmentation labels
  • saving Napari screenshots
  • summarising basic cell-area measurements

Expected folder layout

The notebook looks for an IMC workflow directory with this structure:

workflow-root/
├── data/
│   ├── img/
│   │   └── ROI_NAME.tiff
│   ├── masks/
│   │   └── ROI_NAME.tiff
│   └── panel.csv
├── figures/
├── notebooks/
└── scripts/

The image and mask should share the same stem. For example:

data/img/ROI_001.tiff
data/masks/ROI_001.tiff

The panel file should contain marker information, including columns used by the notebook such as:

channel,name,keep,deepcell

Install dependencies

Create or activate a Python environment, then install:

python3 -m pip install napari[all] numpy pandas tifffile scikit-image jupyter

If your system already has a Qt backend configured, napari[all] may not be necessary, but it is the simplest option for beginners.

Run the notebook

From the workflow root:

jupyter notebook notebooks/napariDataVisualization.ipynb

Alternatively, set the workflow directory explicitly:

export IMC_WORKFLOW_DIR=/path/to/workflow-root
jupyter notebook notebooks/napariDataVisualization.ipynb

The notebook starts with:

%gui qt

This enables Napari’s interactive Qt event loop inside Jupyter. If Napari does not open, check that you are running the notebook on a machine with a graphical display or an appropriate remote-display setup.

Data and privacy notes

No image data, segmentation masks, or patient information are included in this repository. Use only de-identified training or approved research data when running the notebook.

Before sharing screenshots or derived figures, confirm that they do not contain identifiers, private file paths, or restricted sample labels.

Recommended for: lab members learning interactive IMC image inspection, segmentation quality control, and Napari-based visualization.

Getting started

Use this checklist before beginning:

  • Install a terminal or Git Bash where necessary.
  • Create a GitHub account.
  • Install Git.
  • Install a recent Python 3 distribution.
  • Install or open Jupyter Notebook.
  • Work through the resources in the recommended order.
  • Practise each concept using a small research-related project.
  • Ask the lab team for HPC access details before attempting cluster exercises.
  • For the Napari notebook, use de-identified IMC example data or a lab-approved training dataset.

Suggested practice project

A good beginner project that connects the four topics is:

  1. Create a local project directory using the shell.
  2. Create a Python script or Jupyter Notebook that reads a small CSV file.
  3. Calculate basic summary statistics.
  4. Produce a simple plot.
  5. Track the project using Git.
  6. Push it to a GitHub repository.
  7. Adapt the script so it can later be submitted as an HPC batch job.

This small workflow helps connect command-line practice, Python analysis, Git-based tracking, and future HPC use.

Additional notes

  • The linked pages contain external educational materials.
  • Students should check software-version requirements because some setup instructions may change over time.
  • For cluster-specific login details, storage locations, software modules, environments, and SLURM settings, consult the lab’s internal documentation.
  • This repository is intended to summarise and link to useful material rather than reproduce full external course content.

Contributing

Lab members can help improve this repository by suggesting new resources, correcting broken links, or refining descriptions. See CONTRIBUTING.md for a brief contribution guide.