% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/AllClasses.R, R/segmentedCells-class.R
\docType{class}
\name{SegmentedCells-class}
\alias{SegmentedCells-class}
\alias{SegmentedCells}
\alias{SegmentedCells,SegmentedCells-method}
\title{The SegmentedCells class}
\usage{
SegmentedCells(
  cellData,
  cellProfiler = FALSE,
  spatialCoords = c("x", "y"),
  cellTypeString = "cellType",
  intensityString = "intensity_",
  morphologyString = "morphology_",
  phenotypeString = "phenotype_",
  cellIDString = "cellID",
  cellAnnotations = NULL,
  imageCellIDString = "imageCellID",
  imageIDString = "imageID",
  verbose = TRUE
)
}
\arguments{
\item{cellData}{A data frame that contains at least the columns x and y giving 
the location coordinates of each cell.}

\item{cellProfiler}{A logical indicating that cellData is in a format similar 
to what cellProfiler outputs.}

\item{spatialCoords}{The column names corresponding to spatial coordinates. 
eg. x, y, z...}

\item{cellTypeString}{The name of the column that contains cell type calls.}

\item{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.)}

\item{morphologyString}{A string which can be used to identify the columns 
which contains morphology information.}

\item{phenotypeString}{A string which can be used to identify the columns 
which contains phenotype information.}

\item{cellIDString}{The column name for cellID.}

\item{cellAnnotations}{A vector of variables that provide additional 
annotation of a cell.}

\item{imageCellIDString}{The column name for imageCellID.}

\item{imageIDString}{The column name for imageIDString.}

\item{verbose}{logical indicating whether to output messages.}
}
\value{
A SegmentedCells object
}
\description{
The SegmentedCells S4 class is for storing data from segmented
imaging cytometry and spatial omics data. It extends DataFrame and defines
methods that take advantage of DataFrame nesting to represent elements of
cell-based experiments with spatial orientation that are commonly
encountered. This object is able to store information on a cell's spatial
location, cellType, morphology, intensity of gene/protein markers as well as
image level phenotype information.
}
\examples{
### 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(seq_len(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 <- SegmentedCells(cells, cellProfiler = TRUE)

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

}
