Module: ExportToSpreadsheet

Export To Spreadsheet exports measurements into one or more files that can be opened in Excel or other spreadsheet programs.
This module will convert the measurements to a comma-, tab-, or other character-delimited text format and save them to the hard drive in one or several files, as requested.

Using metadata tags for output

ExportToSpreadsheet can write out separate files for groups of images based on their metadata tags. This is controlled by the directory and file names that you enter. For instance, you might have applied two treatments to each of your samples and labeled them with the metadata names "Treatment1" and "Treatment2", and you might want to create separate files for each combination of treatments, storing all measurements with a given "Treatment1" in separate directories. You can do this by specifying metadata tags for the folder name and file name: Here's an example table of the files that would be generated:

Treatment1Treatment2Path
1M_NaCl20uM_DMSO1M_NaCl/20uM_DMSO.csv
1M_NaCl40uM_DMSO1M_NaCl/40uM_DMSO.csv
2M_NaCl20uM_DMSO2M_NaCl/20uM_DMSO.csv
2M_NaCl40uM_DMSO2M_NaCl/40uM_DMSO.csv

Available measurements

For details on the nomenclature used by CellProfiler for the exported measurements, see Help > General Help > How Measurements Are Named.

See also ExportToDatabase.

Settings:

Select the column delimiter

Select the delimiter to use, i.e., the character that separates columns in a file. The two default choices are tab and comma, but you can type in any single character delimiter you would prefer. Be sure that the delimiter you choose is not a character that is present within your data (for example, in file names).

Add image metadata columns to your object data file?

" Image_Metadata_" columns are normally exported in the Image data file, but if you select Yes, they will also be exported with the Object data file(s).

Limit output to a size that is allowed in Excel?

If your output has more than 256 columns, select Yes will open a window allowing you to select the columns you'd like to export. If your output exceeds 65,000 rows, you can still open the CSV in Excel, but not all rows will be visible.

Select the measurements to export

Select Yes to provide a button that allows you to select which measurements you want to export. This is useful if you know exactly what measurements you want included in the final spreadheet(s).

Calculate the per-image mean values for object measurements?

Select Yes for ExportToSpreadsheet to calculate population statistics over all the objects in each image and save that value as an aggregate measurement in the Image file. For instance, if you are measuring the area of the Nuclei objects and you check the box for this option, ExportToSpreadsheet will create a column in the Image file called "Mean_Nuclei_AreaShape_Area".

You may not want to use ExportToSpreadsheet to calculate these measurements if your pipeline generates a large number of per-object measurements; doing so might exceed Excel's limits on the number of columns (256).

Output file location

This setting lets you choose the folder for the output files. You can choose among the following options which are common to all file input/output modules:

Elsewhere and the two sub-folder options all require you to enter an additional path name. You can use an absolute path (such as "C:\imagedir\image.tif" on a PC) or a relative path to specify the file location relative to a directory):

For Elsewhere..., Default Input Folder sub-folder and Default Output Folder sub-folder, if you have metadata associated with your images via Metadata module, you can name the folder using metadata tags. You can insert a previously defined metadata tag by either using:

The inserted metadata tag will appear in green. To change a previously inserted metadata tag, navigate the cursor to just before the tag and either:
For instance, if you have a metadata tag named "Plate", you can create a per-plate folder by selecting one of the subfolder options and then specifying the subfolder name as "\g<Plate>". The module will substitute the metadata values for the current image set for any metadata tags in the folder name. Please see the Metadata module for more details on metadata collection and usage.

Create a GenePattern GCT file?

Select Yes to create a GCT file compatible with GenePattern. The GCT file format is a tab-delimited text file format that describes a gene expression dataset; the specifics of the format are described here. By converting your measurements into a GCT file, you can make use of GenePattern's data visualization and clustering methods.

Each row in the GCT file represents (ordinarily) a gene and each column represents a sample (in this case, a per-image set of measurements). In addition to any other spreadsheets desired, enabling this option will produce a GCT file with the extension .gct, prepended with the text selection above. If per-image aggregate measurements are requested above, those measurements are included in the GCT file as well.

Select source of sample row name

(Used only if a GenePattern file is requested)
The first column of the GCT file is the unique identifier for each sample, which is ordinarily the gene name. This information may be specified in one of two ways:

Select the image to use as the identifier

(Used only if a GenePattern file is requested and image filename is used to name each row)
Select which image whose filename will be used to identify each sample row.

Select the metadata to use as the identifier

(Used only if a GenePattern file is requested and metadata is used to name each row)
Choose the measurement that corresponds to the identifier, such as metadata from the Metadata module. Please see the Metadata module for more details on metadata collection and usage.

Export all measurement types?

Select Yes to export every category of measurement. ExportToSpreadsheet will create one data file for each object produced in the pipeline, as well as per-image, per-experiment and object relationships, if relevant. See Help > Using Your Output > How Measurements are Named for more details on the various measurement types. The module will use the object name as the file name, optionally prepending the output file name if specified above.

Select No if you want to do either (or both) of two things:

Press button to select measurements to export

(Used only when selecting the columns of measurements to export)
This setting controls the columns to be exported. Press the button and check the measurements or categories to export.

Representation of Nan/Inf

This setting controls the output for numeric fields if the calculated value is infinite (Inf) or undefined (NaN). CellProfiler will produce Inf or NaN values under certain rare circumstances, for instance when calculating the mean intensity of an object within a masked region of an image.

Add a prefix to file names?

This setting lets you choose whether or not to add a prefix to each of the .CSV filenames produced by ExportToSpreadsheet. A prefix may be useful if you use the same directory for the results of more than one pipeline; you can specify a different prefix in each pipeline. Select Yes to add a prefix to each file name (e.g. "MyExpt_Images.csv"). Select No to use filenames without prefixes (e.g. "Images.csv").

Filename prefix:

(Used only if "Add a prefix to file names?" is Yes) The text you enter here is prepended to the names of each file produced by ExportToSpreadsheet.

Overwrite without warning?

This setting either prevents or allows overwriting of old .CSV files by ExportToSpreadsheet without confirmation. Select Yes to overwrite without warning any .CSV file that already exists. Select No to prompt before overwriting when running CellProfiler in the GUI and to fail when running headless.

Data to export

(Used only when "Export all measurements?" is set to "No")
Choose Image, Experiment, Object relationships or an object name from the list. ExportToSpreadsheet will write out a file of measurements for the given category. See Help > Using Your Output > How Measurements are Named for more details on the various measurement types.

Combine these object measurements with those of the previous object?

(Used only when "Export all measurements?" is set to "No")
Select Yes to create a file composed of measurements made on this object and the one directly above it.

Select No to create separate files for this and the previous object.

File name

(Used only when "Export all measurements?" is set to "No")
Enter a file name for the named objects' measurements. ExportToSpreadsheet will prepend the name of the measurements file to this if you asked to do so above. If you have metadata associated with your images, this setting will also substitute metadata tags if desired. You can insert a previously defined metadata tag by either using: The inserted metadata tag will appear in green. To change a previously inserted metadata tag, navigate the cursor to just before the tag and either: Please see the Metadata module for more details on metadata collection and usage.

Use the object name for the file name?

(Used only when "Export all measurements?" is set to "No")
Select Yes to use the object name as selected above to generate a file name for the spreadsheet. For example, if you selected Image, above and have not checked the Prepend output file name option, your output file will be named "Image.csv".

Select No to name the file yourself.