Skip to contents

This function reads CellProfiler data into R. It is built exclusively for use with worm image data saved as a .rda file.

Usage

readXpress(
  filedir,
  rdafile,
  design = FALSE,
  px_per_um = 3.2937,
  length_thresh = 98.811,
  doseR = F
)

Arguments

filedir

The project directory or directories with CellProfiler data. Provide a full path to the directory or a vector of project directory paths. Each directory must have a cellprofiler-nf output .rda file in a sub-folder named cp_data.

rdafile

The specific .rda file name in the cp_data directory to read. If multiple project directories are supplied to filedir, then include the .rda files for each project in the same order of the directories given in filedir.

design

Logical parameter, if TRUE then a design file will be joined to data. The design file should be located in a sub-folder of the filedir named design. If FALSE no design file will be joined.

px_per_um

The number of pixels per micron (um) for the images. This conversion factor will vary for different objectives or microscopes. The default is set for the AndersenLab imageXpress nano 2X objective at 3.2937 pixels per micron (um). Please enter another conversion factor if necessary.

length_thresh

An object length threshold in um used to filter objects from the data. The default setting is 98.811 um. This is the standard threshold used for the AndersenLab images taken with the imageXpress nano. Please adjust only if necessary.

doseR

Logical, is this dose response data? The default, doseR = FALSE, expects control data to be recorded in the design file a particular way. Specifically, the drug and diluent variables should be identical for controls, e.g, drug = DMSO, diluent = DMSO, concentration_um = 0. If doseR = TRUE, the controls are expected to be coded differently, .e.g, drug = ABZ, diluent = DMSO, concentration_um = 0. Warning messages are produced if the controls do not fit expectations, but try to ensure the controls are coded properly without relying this function to catch all edge cases.

Value

A list including two elements 1) A data frame that contains all CellProfiler model outputs as well as experimental treatments if a design file is used. If multiple project directories and .rda files are supplied, they will be joined together. 2) A data frame the contains the complete design file read from the project directory or directories. This data frame is useful for checking the completeness of the data after filtering steps are completed.