Accessors: Accessors for SegmentedCellExperiment

Description Usage Arguments Value Descriptions Examples

Description

Methods to access various components of the 'SegmentedCellExperiment' object.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
location(x, imageID = NULL, bind = TRUE)

location(x, imageID = NULL) <- value

intensity(x, imageID = NULL, bind = TRUE)

intensity(x, imageID = NULL) <- value

morphology(x, imageID = NULL, bind = TRUE)

morphology(x, imageID = NULL) <- value

phenotype(x, imageID = NULL, bind = TRUE, expand = FALSE)

phenotype(x, imageID = NULL) <- value

imageID(x, imageID = NULL)

cellID(x, imageID = NULL)

cellID(x) <- value

imageCellID(x, imageID = NULL)

imageCellID(x) <- value

cellType(x, imageID = NULL)

cellType(x, imageID = NULL) <- value

Arguments

x

A 'SegmentedCellExperiment' object.

imageID

A vector of imageIDs to specifically extract.

bind

When false outputs a list of DataFrames split by imageID

expand

Used to expand the phenotype information from per image to per cell.

value

The relevant information used to replace.

Value

DataFrame or a list of DataFrames

Descriptions

'location':

Retrieves the DataFrame containing 'x' and 'y' coordinates of each cell as well as 'cellID', 'imageID' and 'cellType'. imageID can be used to select specific images and bind=FALSE outputs the information as a list split by imageID.

'morphology':

Retrieves the DataFrame containing morphology information.

'intensity':

Retrieves the DataFrame containing intensity of gene or protein markers.

'phenotype':

Retrieves the DataFrame containing the phenotype information. Using expand = TRUE will produce a DataFrame with the number of rows equal to the number of cells.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
### 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, imageID = 1)

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