Skip to main content

Running CellProfiler with AVITI24 Data

CellProfiler is an open-source cellular morphology and analysis tool. AVITI24 already uses CellProfiler modules to generate morphology metrics, but you can reanalyze AVITI24 cytoprofiling data or include other CellProfiler modules to your analysis.

This tutorial describes how to use CellProfiler for additional analysis of AVITI24 cytoprofiling data.

Before You Begin

Make sure your system has the most recent version of CellProfiler.

To use CellProfiler, you must first create a pipeline that defines the analysis you want to use. While this tutorial recommends particular modules, you might prefer other modules for your workflow. For more information on pipeline creation and available modules, see the CellProfiler Manuals.

Create a Module to Load AVITI24 Data

To use CellProfiler, you must create a pipeline of modules to process your data. The first module needs to load the AVITI24 run data in the CellSegmentation and Projection folders of the output files.

  1. Copy the following content into a blank CSV file, and save it in the run folder on your computer.
Image_FileName_CellularMask,Image_FileName_Target
CellSegmentation\WellA2\L1R02C03S1_Cell.tif,Projection\WellA2\CP02_L1R02C03S1_Target.tif
  1. In CellProfiler, select the Add icon to add a module.
  2. Select File Processing, and then select the LoadData module.
  3. Select Add to Pipeline.
  4. In the Input Data File Location drop-down menu, select Elsewhere, and then enter the path to the location of the input data CSV file.
  5. Enter the name of the input data CSV file.
  6. Select View to confirm that Cellprofiler can parse the CSV file correctly.
  7. In the Base Image Location field, select Elsewhere, and then enter the path to the location of the CellSegmentation and Projection folders for your run.

Prepare CellProfiler to Convert Images

After loading data, the CellProfiler pipeline needs to identify objects and cell boundaries in the images. Measurements for different types of analyses requires this information.

  1. Select the Add icon to add another module.
  2. Select Object Processing, and then select the ConvertImagetoObjects module.
  3. Select Add to Pipeline.
  4. In the Select the Input Image drop-down menu, select CellularMask.
  5. Enter an informative name for the output object, such as CellularMaskObjects.
  6. Select No for converting to a boolean image.
  7. Select Yes for preserving original labels.

    These options make sure that you preserve the individual cell mask values present in the original image.

Add Modules to Measure and Process Data

Because the first modules in the pipeline load the intensity data for targets and identify cell boundary definitions, you can add modules that use these inputs to process and measure objects. This tutorial uses the MeasureObjectSizeShape and MeasureObjectIntensity modules.

  1. Select the Add icon to add another module.
  2. Select Measurement, and then select the MeasureObjectSizeShape module.
  3. In the Select Object Sets to Measure field, select CelluluarMaskObjects.
  4. Select Yes or No for calculating the Zernike features and other advanced features.
  5. Select the Add icon again.
  6. Select Measurement, and then select the MeasureObjectIntensity module.
  7. In the Select Images to Measure field, select Target.
  8. In the Select Objects to Measure field, select CellularMaskObjects.

Configure and Run the Pipeline for Data Output

  1. Select the Add icon to add another module.
  2. Select File Processing, and then select the ExportToSpreadsheet module.
  3. Review the settings and update selections as necessary.

    The default selections for this module are acceptable for this tutorial.

  4. Select Analyze Images.

    CellProfiler processes the pipeline and generates a CSV file with quantification output.

  5. Navigate to the output directory, and open the CSV file.

Reviewing CellProfiler Analysis Output

In the CellProfiler analysis output file, each row of the file is a cell ID, and each column is a measurement from CellProfiler. The ObjectNumber column lists a cell ID for each image. This cell ID corresponds to the pixel value of the cell in the cell mask image for the analysis.

To associate the ObjectNumber cell ID with a cell ID in the RawCellStats.csv output file for the run, you must calculate a global cell ID. To do so, complete the following steps:

  1. Identify the name of the tile for the image (e.g., L1R01C01S1).
  2. Open the RunParameters.json file, and locate the tile in the Tiles array.
  3. Identify the ordinal position of the tile in the Tiles array.
  4. Multiply the position number by 65,536 to calculate the image ID.
  5. Add the cell ID number from the ObjectNumber to the image ID to calculate the global cell ID.

    For example, for the ObjectNumber cell ID of 6 from the image for the 37th tile, the global cell ID is 2,424,838 (37 * 65,536 + 6 = 2,424,838).