Exporting Plate Based Data That Contains Multiple Fields Per Well
Often images of multiple fields within a single well of a plate format experiment are taken. CellProfiler can segment all of the individual field images and pool the data as a single well for export to FCS Express Image Cytometry. The resulting data sets may then be opened in FCS Express to review and analyze the data in Heat Maps, Picture Plots, Dot Plots, and Histograms.
In the course of this tutorial we will explain:
• | Image naming conventions needed for FCS Express to import the multi well, multi field, imaging data processed by CellProfiler. |
• | Exporting Multiple Well, Multiple Field Location, Imaging data in CellProfiler for use in FCS Express. |
Naming Conventions for Plate Based Multiple Field Location Image Data Sets
When reconstructing a series of plate based data containing multiple fields per well FCS Express will use information stored in the filename to assign well locations and to merge the multiple field images into a single image. In particular the regular expression names Row and Column (for well locations) and rowtile and coltile (for the field location within the well) should be used when exporting plate based data with multiple image locations per well. These names define the plate location of the well by Row Letter and Column Number and the location of the field within the well by rowtile and coltile position. To successfully use regular expression for processing the data in CellProfiler and analyzing the data in FCS Express the information for Well numbers and field locations must be stored somewhere within the filename of the image. In Figure T24.55 below the image name is: Channel1-01-A-01_00_00. The red box highlights the well Row and Column information (well A01), and the blue box highlights the field location (position 00, 00).
Figure T24.55 The image name is: Channel1-01-A-01_00_00. The red box highlights the well Row and Column information (well A01), and the blue box highlights the field location (position 00, 00).
Exporting Multiple Field Location Plate Imaging Data in CellProfiler for use in FCS Express
The CellProfiler modules that will be discussed in this section are Load Images, Save Images, and Export to Spreadsheet. The completed pipeline for this example can be found in the Tutorial Sample Data archive within the Multiple Field Location Plate Imaging folder is named MultipleFieldLocationPipelineCOMPLETED.cp. The completed pipeline is meant to be used as a template for comparison to your pipeline and represents the finished product of this tutorial.
The example data set we will be using can be found in the Tutorial Sample Data archive within the Multiple Field Location Plate Imaging folder. The example data set contains 16 images which are broken down into two channels of images (channel 1 and channel 2) and two wells (A1 and A2) with 4 fields per well.
The steps for exporting data from CellProfiler have been broken down by module according to the MultipleFieldLocationPipeline.cp. pipeline. After loading the MultipleFieldLocationPipeline.cp. pipeline in CellProfiler, follow the steps below to amend the pipeline to prepare for export to FCS Express.
Selecting Default Input and Output Folders
To organize your data correctly for FCS Express, first ensure that the default input (where your images are stored) and output folders in CellProfiler are set to the same folder in the Input/Output Folder window (Figure T24.56).
Note: The DefaultOUT.mat file will also be exported to the Output Folder. This file is for use in MATLAB. If you do not wish to use this file, we recommend deleting it to conserve disk space.
Figure T24.56 Set the Default Input and Output Folders to the Same Location
LoadImages Module Setup
In order for FCS Express to recognize your image data is in a well row and column and field location rowtile and coltile format for a multiple field location plate based assay, metadata from the image file names must be extracted. A Regular Expression must be defined to find the metadata in the file name or path of the data by following these steps (Figure T24.57):
1. | Click on the Channel2- drop-down list labeled Extract metadata from where?. |
2. | Select which metadata you wish to use. For this example, choose File name. |
3. | Enter the "Regular Expression" you wish to use in the field labeled Regular expression that finds metadata in the file name. For this example we will use "Channel2-[0-9]{2}-(?P<Row>[A-H])-(?P<Column>[0-9]{2})_(?P<rowtile>[0-9]{1,2})_(?P<coltile>[0-9]{1,2}).tif" which defines the well row and column (Row and Column) information and the field location (rowtile and coltile) information as found in the image name. |
Notes:
• | Follow these links for a tutorial on "Regular Expressions" and how to translate regular expressions. |
• | Setting up metadata and regular expressions only has to be done for one image in the set. For this example, it has been set up for Channel2. |
• | The regular expression output names: Well, Row, Column, rowtile and coltile may only be used with plate based or montage imaging experiments. These output names are reserved, and should not be used for anything aside from denoting the well and/or field positions. |
Figure T24.57 Setting up a Regular Expression in the LoadImages Module for a multiple field plate based experiment.
SaveImages Module
The image masks that were defined in the ConvertObjectsToImage module must now be saved and related to the original images/data.
12. | Select the first SaveImages module in the pipeline. |
13. | Select the type of image to save as Image from the drop-down list. |
14. | Select the image to save as Cells. |
Note: When defining your own pipeline, select the appropriate image you defined in the ConvertObjectsToImage module.
15. | Select method for constructing file names as single name from the drop-down list. |
16. | Enter single file name as any name you prefer followed by a hyphen. For this example use CellLabel- |
17. | Right-click after CellLabel- , choose Row. |
18. | Type a - (hyphen symbol) next to Row. |
19. | Right-click after Row- and choose Column. |
20. | Type a _ (underscore symbol) next to Column. |
21. | Right-click after Column_ and choose rowtile. |
22. | Type a _ (underscore symbol) next to rowtile. |
23. | Right-click after rowtile_ and choose coltile. |
The completed Enter single file name field should now look like figure T24.58 below.
Figure T24.58 The completed Enter single file name field.
24. | Select the second SaveImages module in the pipeline. |
25. | Select the type of image to save as Image from the drop-down list. |
26. | Select the image to save as Nuclei. |
27. | Select method for constructing file names as Single name from the drop-down list. |
28. | Enter single file name as any name you prefer followed by a hyphen. For this example use NucleiLabel- |
29. | Right-click after Nuclei- , choose Row. |
30. | Repeat steps 18-23 above with the second SaveImages module. |
Note: Row, Column, rowtile and coltile are values you defined as regular expressions for the load images module. Using regular expressions allows every output file to be assigned a unique file name based on the text from the input file name. This will prevent output file names from overwriting each other and allows FCS Express to identify the unique image mask associated with each image file.
Perform steps 33-36 on both the SaveImages modules set up for CellLabel and NucleiLabel
33. | Select the format to use as tif from the drop-down list. |
34. | Set Image bit depth at 16 from the drop-down list. |
35. | Check the Overwrite existing files without warning? box. |
36. | Check the Store file and path information to the saved image? box. |
The SaveImages module for CellLabel should now look like Figure T24.59
Figure T24.59 Defining the SaveImages Module
ExportToSpreadsheet Module
Now that all of the images and object image masks have been defined and saved for analysis, you must now ask CellProfiler to export the measurements you wish to view in FCS Express. For this example, we will export all measurements. If you would like to export only certain parameters please see the export selected measurements section of the CellProfiler Export tutorials.
37. | Select the ExportToSpreadsheet module. |
38. | Uncheck the Prepend the output file name to the data file names? box. |
39. | Uncheck Export all measurements, using default file names?. |
40. | Choose Image from the Data to export drop-down list. |
41. | Uncheck Use the object name for the file name? box. |
42. | Set the file name as Image.cptoc. |
43. | Click on the Add another data set button. |
44. | Uncheck the Use the object name for the file name? box. |
45. | Choose Cells from the second Data to export drop-down list. |
46. | Uncheck the Use the object name for the file name? box. |
47. | Set the file name as cells.cpout. |
48. | Repeat steps 43-47 for "nuclei" and set the file name as nuclei.cpout. |
The ExportToSpreadsheet module options should look like Figure T24.60 when you are done.
Note 1: on file extensions: ".cptoc" stands for CellProfiler Table of Contents and ".cpout" stands for CellProfiler Output. The "Image.cptoc" file stores information about the location and number of images for all objects processed in the pipeline, while the separate "Nuclei.cpout" and "Cells.cpout" store the actual raw data associated with individual objects and analysis. There should be a separate ".cpout" file defined for each object mask defined in CellProfiler. Only one "Image.cptoc" file is needed.
Note 2:The name of your .cpout file must begin with the name of the object data you are exporting and may only be include the object name and regular expressions. For example: the file names nuclei.cpout and nuclei_<regular express>.cpout will result in a proper export while dataset1nuclei.cpout or <regularexpression>_nuclei.cpout will resulting in a non-working export.
Figure T24.60 The ExportToSpreadsheet Module Set Up to Export image.cptoc, nuclei.cpout and cells.cpout.
49. | Select Analyze images to run the pipeline. The folder where your images are stored will now contain the cells.cpout, nuclei.cpout, and Image.cptoc files. There will also be a CellLabel and NucleiLabel image associated with every original image from the data set. |
In the next section, we will import and analyze the plate based multiple field location imaging data