Running CellProfiler with AVITI24 Data
CellProfiler is an open-source cellular morphology and analysis tool. To generate morphology metrics, AVITI24™ uses CellProfiler modules. You can also re-analyze AVITI24 cytoprofiling data or include other CellProfiler modules to your analysis.
The following tutorial provides steps on how to use CellProfiler for additional analysis of AVITI24 cytoprofiling data.
Before You Begin
- Make sure that your system has the most recent version of CellProfiler.
- Create a pipeline that defines the analysis that you want to use.
This tutorial recommends specific modules. However, 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 must load the AVITI24 run data in the CellSegmentation
and Projection
folders of the output files.
To process a single cell paint target for a single tile, copy the following example CellProfiler input into a blank CSV file. You can use this method for initial testing of your CellProfiler pipeline.
Image_FileName_CellularMask,Image_FileName_Target
CellSegmentation\WellA2\L1R02C03S1_Cell.tif,Projection\WellA2\CP01_L1R02C03S1_Actin.tifOr, to process all cell paint targets for all tiles, use the following full CellProfiler input files based on your well layout:
In CellProfiler, select the
+
icon to add a module.Select File Processing, and then select the LoadData module.
Select Add to Pipeline.
In the Input Data File Location drop-down menu, select Elsewhere, and then enter the input data CSV file path.
Enter the name of the input data CSV file.
Select View to confirm that Cellprofiler can parse the CSV file correctly.
In the Base Image Location field, select Elsewhere, and then enter the paths to the
CellSegmentation
andProjection
folders for your run.
Prepare CellProfiler to Convert Images
After data is loaded, the CellProfiler pipeline must identify objects and cell boundaries in the images. Measurements for different types of analyses require this information.
- Select the
+
icon to add another module. - Select Object Processing, and then select the ConvertImagetoObjects module.
- Select Add to Pipeline.
- In the Select the Input Image drop-down menu, select CellularMask.
- Enter a name for the output object, such as CellularMaskObjects.
- Select No for converting to a boolean image.
- Select Yes for preserving original labels.
These options allow you to preserve the individual cell mask values that are present in the original image.
Add Modules to Measure and Process Data
The first modules in the pipeline load the intensity data for targets and identify cell boundary definitions. To process and measure objects, you can add modules that use the inputs from the first modules. The following steps use the MeasureObjectSizeShape
and MeasureObjectIntensity
modules:
- Select the
+
icon to add another module. - Select Measurement, and then select the MeasureObjectSizeShape module.
- In the Select Object Sets to Measure field, select CelluluarMaskObjects.
- Select Yes or No for calculating the Zernike features and other advanced features.
- Select the
+
icon again. - Select Measurement, and then select the MeasureObjectIntensity module.
- In the Select Images to Measure field, select Target.
- In the Select Objects to Measure field, select CellularMaskObjects.
Configure and Run the Pipeline for Data Output
- Select the
+
icon to add another module. - Select File Processing, and then select the ExportToSpreadsheet module.
- Review the settings and update selections as required.
The default selections for this module are acceptable for this tutorial.
- Select Analyze Images.
CellProfiler processes the pipeline and generates a CSV file with quantification output.
- Navigate to the output directory, and then open the CSV file.
Review the 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 transform the per-tile cell ID that is present in the CellProfiler output to a global cell ID that is used in the RawCellStats
table. The following python example shows how to perform this translation:
import json
def convert_local_to_global_cell_id(local_cell_id, tile, run_parameters_json):
tile_index = run_parameters_json["Tiles"].index(tile)
image_id = tile_index << 16
global_cell_id = image_id + local_cell_id
return global_cell_id
with open("RunParameters.json", "rb") as json_handle:
run_parameters_json = json.load(json_handle)
local_cell_id = 6
tile = "L1R01C03S1"
global_cell_id = convert_local_to_global_cell_id(local_cell_id, tile, run_parameters_json)
print(f"Global cell ID for local cell ID {local_cell_id} is {global_cell_id}")
This python example:
- Requires a local cell ID, the tile name for the for the local cell ID, and the
RunParameters.json
file from the run directory. - Identifies the tile index for the specified tile as the ordinal index of the tile name in the
Tiles
array that is located in theRunParameters.json
file. - Converts the tile index to a tile ID by multiplying the tile index by 65,536.
- Adds the tile ID to the local cell ID to produce a global cell ID. For example, for the
ObjectNumber
cell ID of6
that is from the image for the 37th tile, the global cell ID is36 x 65,536 + 6
, which is2,359,302
.