Quantification of electrophoresis gel bands using QuPath and Galaxy imaging tools

Overview
Creative Commons License: CC-BY Questions:
  • How can specific bands on an electrophoresis gel image be selected using QuPath?

  • How is a region of interest (ROI) GeoJSON file prepared?

  • How are bands labeled and quantified using Galaxy tools?

  • What outputs are generated during the analysis?

Objectives:
  • Learn how to select bands on an electrophoresis gel image

  • Generate ROI files in QuPath and process them in Galaxy

  • Quantify band intensity and extract tabular results

Requirements:
Time estimation: 1 hour
Supporting Materials:
Published: Aug 11, 2025
Last modification: Aug 11, 2025
License: Tutorial Content is licensed under Creative Commons Attribution 4.0 International License. The GTN Framework is licensed under MIT
version Revision: 1

Electrophoresis gel images are fundamental tools in molecular biology and biochemistry for separating DNA, RNA, or protein fragments by size or charge (Green and Sambrook 2019). Quantification of these bands allow for estimating product yield, comparing amplification efficiency, verifying PCR products, calculating molecular weights, and assessing enzyme activity or protein purity (Gallagher 2017).

Reliable measurement of band intensity provides quantitative insights into gene expression and other biochemical properties (Gassmann et al. 2009). However, manual quantification can be labor-intensive and prone to user bias.

Modern image analysis software suites such as QuPath (Bankhead et al. 2017) provide interactive tools for defining regions of interest (ROIs) directly on gel images. These ROIs can be exported as GeoJSON files, which encode the spatial coordinates of the selected bands in a standardized, machine-readable format.

Once the ROI file is generated, bioinformatics platforms like Galaxy (The Galaxy Community 2024) enable automated processing of these coordinates, measurement of pixel intensities for each band, and generation of transparent, reproducible quantification results.

Recent advances such as GelGenie (Aquilina et al. 2025) further highlight the trend towards AI-powered, automated analysis pipelines for electrophoresis gels, reinforcing the need for accessible, reproducible workflows that integrate modern image processing tools.

Agenda

In this tutorial, we will deal with:

  1. Data preparation
    1. Convert the image format
    2. Obtain image metadata
    3. Split image into separate channels
  2. Annotate and process regions of interest (ROIs)
    1. Prepare the ROI file with QuPath
    2. Extract the GeoJSON file
    3. Convert ROIs to label map
  3. Extract band intensity features
    1. Inspecting results
  4. Conclusion

Data preparation

The example dataset can be downloaded from here Electrophoresis gel dataset.

Electrophoresis Gel.

This image is from Ohgane and Yoshioka 2019.

Hands On: Download and upload the image
  1. Create a new history in Galaxy.
  2. Download the test image using the link above.
  3. Click the galaxy-upload Upload to add the image file into your galaxy history.

    • Copy the link location
    • Click galaxy-upload Upload Data at the top of the tool panel

    • Select galaxy-wf-edit Paste/Fetch Data
    • Paste the link(s) into the text field

    • Press Start

    • Close the window

    As an alternative to uploading the data from a URL or your computer, the files may also have been made available from a shared data library:

    1. Go into Libraries (left panel)
    2. Navigate to the correct folder as indicated by your instructor.
      • On most Galaxies tutorial data will be provided in a folder named GTN - Material –> Topic Name -> Tutorial Name.
    3. Select the desired files
    4. Click on Add to History galaxy-dropdown near the top and select as Datasets from the dropdown menu
    5. In the pop-up window, choose

      • “Select history”: the history you want to import the data to (or create a new one)
    6. Click on Import

    • Click on the galaxy-pencil pencil icon for the dataset to edit its attributes
    • In the central panel, click galaxy-chart-select-data Datatypes tab on the top
    • In the galaxy-chart-select-data Assign Datatype, select datatypes from “New Type” dropdown
      • Tip: you can start typing the datatype into the field to filter the dropdown menu
    • Click the Save button

  4. Rename galaxy-pencil the dataset to Electrophoresis-Gel.jpg.

Before we dive into the quantification steps let’s convert our JPG image file into the TIFF image format. This format is preferred for analysis and quantification as it preserves the image data and metadata.

Note: Skip this step if the image is already in TIFF format.

Convert the image format

Hands On: Convert JPG to TIFF
  1. Convert image format ( Galaxy version 1.3.45+galaxy0)
    • “Image to convert”: Electrophoresis-Gel.jpg
    • “Output format”: TIFF

TIFF files preserve full image quality, avoid compression artifacts, and are compatible with downstream tools that require uncompressed data.

Obtain image metadata

To convert coordinates into a label map, we first need the image dimensions (width and height). In this step, we’ll retrieve that information.

Hands On: Identify image dimensions
  1. Show image info ( Galaxy version 5.7.1+galaxy1)
    • param-file “Image Input”: Select your uploaded Electrophoresis-Gel.tiff

The output of the tool can be visualize by clicking the galaxy-eye (eye) icon (View). See below:

Checking file format [Tagged Image File Format]
Initializing reader
TiffDelegateReader initializing /data/dnb11/galaxy_db/files/0/6/6/dataset_06685fae-ac3e-48b9-a460-d0ad39ea07a6.dat
Reading IFDs
Populating metadata
Checking comment style
Populating OME metadata
Initialization took 0.569s

Reading core metadata
filename = /data/dnb11/galaxy_db/files/0/6/6/dataset_06685fae-ac3e-48b9-a460-d0ad39ea07a6.dat
Series count = 1
Series #0 :
	Image count = 1
	RGB = true (3) 
	Interleaved = false
	Indexed = false (false color)
	Width = 1278
	Height = 250
	SizeZ = 1
	SizeT = 1
	SizeC = 3 (effectively 1)
	Thumbnail size = 128 x 25
	Endianness = intel (little)
	Dimension order = XYCZT (certain)
	Pixel type = uint8
	Valid bits per pixel = 8
	Metadata complete = true
	Thumbnail series = false
	-----
	Plane #0 <=> Z 0, C 0, T 0

Reading global metadata
BitsPerSample: 8
Compression: JPEG
Document Name: temp.tiff
ImageLength: 250
ImageWidth: 1278
MetaDataPhotometricInterpretation: RGB
MetaMorph: no
NumberOfChannels: 3
PageNumber: 0 1
PhotometricInterpretation: YCbCr
PlanarConfiguration: Chunky
ReferenceBlackWhite: 0
SampleFormat: unsigned integer
SamplesPerPixel: 3
Software: GraphicsMagick 1.3.45 2024-08-27 Q8 http://www.GraphicsMagick.org/

Reading metadata
  

Split image into separate channels

TIFF images can store multiple channels—such as different colors or fluorescence signals—in a single file. In this step, we will separate these channels by splitting the image along the channel axis (C-axis). This results in a list of single-channel images, which are required for the next processing steps.

Hands On: Split image into single channels
  1. Split image along axes ( Galaxy version 2.2.3+galaxy1) with the following parameters:
    • param-file “Image to split”: Select your uploaded Electrophoresis-Gel.tiff file
    • “Axis to split along”: Select C-axis (split the channels of an image or image sequence) from the dropdown menu
Comment: Use a single-channel image for downstream compatibility and annotation

While QuPath can handle multi-channel images, our other tools cannot. Therefore, after splitting the image, we will use the Extract Dataset tool to select one of the single-channel images. This image should represent the intensity channel we want to measure, and will be used for QuPath regions of interest (ROI) annotation.

Hands On: Extract the TIFF file from collection
  1. Extract Dataset with the following parameters:
    • param-collection “Input Collection”: Select the collection output from the Split image along axes ( Galaxy version 2.2.3+galaxy1) tool
    • “Which part of the Collection?”: Choose the TIFF file that represent the channel of your interest. In our dataset example, we extract 1.tiff

Annotate and process regions of interest (ROIs)

To identify and quantify specific regions in the image, such as electrophoresis bands, we need to define them manually. This is done using the interactive tool QuPath, which allows you to draw rectangles over each band of interest and assign them a unique label to annotate the ROIs. The result is a GeoJSON file containing the coordinates of these regions.

This GeoJSON file can then be processed in Galaxy to generate a label map for image quantification.

Prepare the ROI file with QuPath

In this step, you will open the image in QuPath, annotate the ROIs using rectangles, and export the annotations as a GeoJSON file. Each band should be marked with a rectangle and given a unique name (e.g., “1”, “2”, etc.).

Hands On: Select ROIs and export GeoJSON file
  1. Open the image in QuPath using our interactive tool QuPath with the following parameters:
    • param-collection “Input file in TIFF format”: Select the Electrophoresis-Gel.tiff dataset after channel splitting.

    When the image opens in QuPath, set the image type to Other:
    Select image type.

  2. Select the Rectangle tool from the toolbar:
    Rectangle tool selection.

  3. Draw a rectangle around the first band of interest:
    First band selection.

  4. Open the Annotations panel:
    Annotations panel.

  5. Double-click the rectangle and set its type to Other:
    Set annotation type.

  6. Duplicate the annotation to create additional rectangles:
    • Go to Object → Annotations
    • Select Duplicate selected annotations
      Duplicate annotation.
  7. Verify the new rectangle appears in the Annotations panel:
    Second annotation.

  8. Select the new rectangle and reposition it over the next band:
    Select second annotation.
    Position second annotation.

  9. Repeat steps 6–8 for all bands you want to annotate.

  10. Set a unique label for each annotation:
    • Right-click each rectangle, choose Set parameters, and enter a label (e.g., "1", "2")
      Name first annotation. Name first annotation. Name first annotation. Name second annotation.
  11. Confirm that all rectangles are labeled:
    Labeled annotations.

  12. Select all labeled annotations:
    Select all annotations.

  13. Export the annotations as a GeoJSON file:
    • Click File → Export objects as GeoJSON
    • Choose Export as FeatureCollection
    • Click Save
      Export process.
      Export process.
      Export process.
  14. Exit QuPath:
    • Click File → Quit
    • Save changes if prompted
      Quit QuPath.
      Quit QuPath.
  15. The exported file will appear in your Galaxy history as part of a collection within 2–3 minutes.

Extract the GeoJSON file

QuPath exports the annotations as a Galaxy collection. In this step, we extract the GeoJSON file to use it in the next stage of the analysis.

Hands On: Extract the GeoJSON file
  1. Extract Dataset with the following parameters:
    • param-collection “Input Collection”: Select the QuPath outputs collection
    • “Which part of the Collection?”: Choose the GeoJSON file
  2. galaxy-pencil Rename the extracted file to Bands.geojson.

Convert ROIs to label map

Now that we have the coordinate information in GeoJSON format, we can convert it into a label map. This label map is an image where each ROI is assigned a unique label, allowing it to be quantified or visualized in downstream steps. In this step, you will also need the information obtained earlier with the Show image info ( Galaxy version 5.7.1+galaxy1) tool about the width and height of the image.

Hands On: Convert coordinates to label map
  1. Convert coordinates to label map ( Galaxy version 0.4.1+galaxy1) with the following parameters:
    • param-file “List of points in tabular or GeoJSON format”: Select your Bands.geojson file
    • “Width of output image”: 1278 (Use the width from the Show image info result)
    • “Height of output image”: 250 (Use the height from the Show image info result)
    • “Tabular list of points has header?”: Yes

Extract band intensity features

Hands On: Measure band intensity
  1. Extract image features ( Galaxy version 0.18.1+galaxy0)
    • “Label map”: Output from previous step
    • “Use the intensity image”: Use intensity image
    • “Intensity image”: Electrophoresis-Gel.tiff
    • “Features to compute”:
      • Select: “Label from label map”
      • Select: “Mean Intensity”

Inspecting results

The table result can be inspected by clicking on the galaxy-eye (eye) icon (View) of the tool output and used for further analysis.

Conclusion

In this tutorial, we explored a complete workflow for quantifying electrophoresis gel bands by:

  • Uploading and converting the gel image into a suitable format
  • Interactively selecting bands as regions of interest (ROIs) using QuPath
  • Exporting ROI coordinates and converting them into a label map in Galaxy
  • Measuring the intensity of each band and extracting the results in tabular format

By combining QuPath for annotation and Galaxy for analysis, this approach offers a transparent, reproducible, and user-friendly method for gel band quantification, suitable for a variety of molecular biology applications.