extraction#

HDF5CellExtraction#

class scportrait.pipeline.extraction.HDF5CellExtraction(*args, **kwargs)#

Bases: ProcessingStep

A class to extracts single cell images from a segmented scPortrait project and save the results to an HDF5 file.

process(partial=False, n_cells=None, seed=42)#

Extracts single cell images from a segmented scPortrait project and saves the results to an HDF5 file.

Parameters:
  • input_segmentation_path (str) – Path of the segmentation HDF5 file. If this class is used as part of a project processing workflow, this argument will be provided automatically.

  • filtered_classes_path (str, optional) – Path to the filtered classes that should be used for extraction. Default is None. If not provided, will use the automatically generated paths.

Important

If this class is used as part of a project processing workflow, all of the arguments will be provided by the Project class based on the previous segmentation. The Project class will automatically provide the most recent segmentation forward together with the supplied parameters.

Examples

# After project is initialized and input data has been loaded and segmented
project.extract()

Notes

The following parameters are required in the config file when running this method:

HDF5CellExtraction:
    # threads used in multithreading
    threads: 80

    # image size in pixels
    image_size: 128

    # directory where intermediate results should be saved
    cache: "/mnt/temp/cache"