analyze_gel

Add-on functions for electropherogram generation from an annotated gel image

Author: Anja Hess

Date: 2025-APR-15

Functions

range_intersect(r1, r2)

Find intersection of two ranges

resize_img(image)

Resize each image (helpful for data storage)

remove_colors_from_img(image[, max_range])

Remove colors from an image, especially colored arrows or marker annotations

analyze_gel(image_file[, run_id, marker_lane])

Core function to generate a signal table from a DNA gel image.

Module Contents

analyze_gel.range_intersect(r1, r2)

Find intersection of two ranges

Parameters:
  • r1 – range

  • r2 – range

Returns:

intersection

analyze_gel.resize_img(image)

Resize each image (helpful for data storage)

Parameters:

image_file – image array

Returns:

resized image

analyze_gel.remove_colors_from_img(image, max_range=0.3)

Remove colors from an image, especially colored arrows or marker annotations :param image: numpy array :param max_range: maximum color range to accept before making this black -> increasing = more tolerance :return: all colors now black.

analyze_gel.analyze_gel(image_file, run_id=None, marker_lane=0)

Core function to generate a signal table from a DNA gel image.

Parameters:

image_file – str, path to DNA gel image

Returns:

multiple intermediate images to visualize the gel band detection are generated and saved, finally the signal table is saved to disk and returned along with the save_dir (str) and the error.