parseImages: Parse Paired Microscopic Images

View source: R/parseImages.R

parseImagesR Documentation

Parse Paired Microscopic Images

Description

Identify nuclei by a DNA stain and measure the fluorescence intensity of the DNA and a second second fluorescent target image from paired images.

Usage

parseImages(
  nuc,
  tgt = NULL,
  nMask = NULL,
  cMask = FALSE,
  args.nMask = NULL,
  args.trimMask = NULL,
  args.cMask = NULL,
  equalize = FALSE,
  simplify = TRUE
)

Arguments

nuc

An Image object or list of such objects representing nuclear images. If the second argument (tgt) is NULL, this must be a list of length 2 containing nuclear and target images.

tgt

An Image object or list of fluorescent images corresponding to the nuclear images in nuc. If this argument is NULL, nuc is treated as a list of both image types.

nMask

An optional Image object or a list of these objects containing an integer Image mask identifying nuclei. If this value is NULL, the nuclear mask will be determined by nucMask with the arguments provided in args.nMask.

cMask

An optional Image object or a list of these objects containing an integer Image mask identifying regions of the target image in which to define cell boundaries. If TRUE, the nuclear mask will be used to generate an expanded mask with cellMask. This larger mask will be used to measure fluorescence intensity in the target image. If FALSE (default), the nuclear mask will be used to measure fluorescence intensities.

args.nMask

A list of arguments passed to nucMask. This argument is ignored if a nMask is provided.

args.trimMask

A list of arguments passed to trimMask. This argument is ignored if a nMask is provided. Otherwise, if NULL, trimMask will be called with default parameters. If FALSE, no trimming will be performed.

equalize

If the background varies significantly among the fluorescent target images (or among the frames of target images), when TRUE, this option adjusts the fluorescent target images to have a common background value with the default options in bnormalize and using the entire range of target images for the expected range.

simplify

Return a single data.frame of results if TRUE, otherwise return a list of data.frames for each member of the list.

Details

This function identifies cells by a DNA stain and measures the fluorescent intensity in both the DNA image and the paired fluorescent image. This is part of a suite of tools implemented with EBImage designed to determine viral titers from sets of fluorescent micrographs. The first argument to this function can be the result of the function getImages. Images provided to this function are paired where the first of each pair is a DNA image and the second is a fluorescent image of the viral antigen. Because individual cells are identified by the nuclear stain, it is often beneficial to collect overexposed DNA images.

These tools were developed to process fluorescent virus titers performed in multi-well plates and is designed to parse images collected at different multiplicities of infection or moi. The moi can be expressed as virions (VP) per cell or infectious units (IU) per cell or a unit of volume (ml, ul, nl) per cell. These details are added to output of this function with the mergePdata function. Images must be ordered with the nuclear (typically DAPI) image before the viral antigen image. Note that this sequence can be adjusted with which.images argument in the function getImages.

Images associated with each moi can be individual files in a single directory where each directory is named for the well such as A1, A2, etc. and the files within are identified as A1/file001.tif, A1/file002.tif, etc. The well identifier can be in upper or lower case and can contain leading zeros such as c0003/file12.tif/ The well identifier also can contain a leading alphanumeric prefix such as 1A2 or 02h012.

Alternatively, each group of images associated with a given moi can be a multi-layered tiff file where the sequence of images in the file is specified by the argument which.images.

A unique ID for each image can be created from a combination of frame and either tag, well or file. This can be useful if it is necessary to determine a separate background value for each pair of images.

  df$uid <- with(df, interaction(tag, frame))
    or if no prefix is used
  df$uid <- with(df, interaction(well, frame))
  df$uid <- with(df, interaction(file, frame))

Value

A data.frame (or list of data.frames) containing processed image data. Each data.frame will have the following variables:

frame

Image sequence within each level of well or file as an integer (1, 2, 3, ...)

xm, ym

Center of mass (in pixels) for nucleus.

area

Area of the mask (in pixels) used to calculate target mfi.

dna

Mean fluorescence intensity for DNA stain, typically not meaningful if the DNA image was over-exposed.

mfi

Mean fluorescence intensity for the target, measured with selected mask.

Results from data organized by well with a plate prefix will include:

tag

Harmonized, original well tag

prefix

From the plate prefix

All results organized by well will include:

well

Harmonized well identifier from the well.info function

row

Row identifier ("A", "B", "C", etc.) as a factor

column

Column number as a factor

Results from data organized as multi-layered tiff files (or stacks) will include:

file

The file name as a factor.

Examples

# Note that execution of these examples can be rather slow...
  path.by.folder <- system.file("extdata", "by_folder", package = "virustiter")
  images.by.folder <- getImages(path.by.folder)
  df.by.folder <- parseImages(images.by.folder)
  head(df.by.folder)

  path.by.stack <- system.file("extdata", "by_stack", package = "virustiter")
  images.by.stack <- getImages(path.by.stack)
  df.by.stack <- parseImages(images.by.stack)
  head(df.by.stack)

# plots
  opar <- par(mfrow = c(1,2))
  plot(log(mfi) ~ area, df.by.folder, main = "By Folder", las = 1)
  plot(log(mfi) ~ area, df.by.stack, main = "By Stack", las = 1)
  par(opar)


ornelles/virustiter documentation built on March 29, 2024, 8:30 p.m.