SegmentedCellExperiment: The SegmentedCellExperiment class

Description Usage Arguments Value Examples

View source: R/SegmentedCellExperiment-class.R

Description

The SegmentedCellExperiment class

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
SegmentedCellExperiment(
  cellData,
  cellProfiler = FALSE,
  spatialCoords = NULL,
  cellTypeString = NULL,
  intensityString = NULL,
  morphologyString = NULL,
  cellIDString = NULL,
  imageCellIDString = NULL,
  imageIDString = NULL
)

Arguments

cellData

A data frame that contains at least the columns x and y giving the location of each cell.

cellProfiler

A logical indicating that cellData is in a format similar to what cellProfiler outputs.

spatialCoords

The column names corresponding to spatial coordinates. eg. x, y, z...

cellTypeString

The name of the column that contains cell type calls.

intensityString

A string which can be used to identify the columns which contain marker intensities. (This needs to be extended to take the column names themselves.)

morphologyString

A string which can be used to identify the columns which contains morphology information.

cellIDString

The column name for cellID.

imageCellIDString

The column name for imageCellID.

imageIDString

The column name for imageIDString

Value

A SegmentedCellExperiment object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
### Something that resembles cellProfiler data

set.seed(51773)

n = 10

cells <- data.frame(row.names = seq_len(n))
cells$ObjectNumber <- seq_len(n)
cells$ImageNumber <- rep(1:2,c(n/2,n/2))
cells$AreaShape_Center_X <- runif(n)
cells$AreaShape_Center_Y <- runif(n)
cells$AreaShape_round <- rexp(n)
cells$AreaShape_diameter <- rexp(n, 2)
cells$Intensity_Mean_CD8 <- rexp(n, 10)
cells$Intensity_Mean_CD4 <- rexp(n, 10)

cellExp <- SegmentedCellExperiment(cells, cellProfiler = TRUE)

### Cluster cell types
intensities <- intensity(cellExp)
kM <- kmeans(intensities,2)
cellType(cellExp) <- paste('cluster',kM$cluster, sep = '')
location(cellExp)

ellispatrick/SegmentedCellExperiment documentation built on Feb. 24, 2020, 3:14 p.m.