CyData-class {cydar} | R Documentation

## CyData class and methods

### Description

An overview of the CyData class and applicable methods.

### Usage

    ## S4 method for signature 'CyData'
    cellAssignments(x)

    ## S4 method for signature 'CyData'
    intensities(x)

    ## S4 method for signature 'CyData'
    markernames(object, mode=c("used", "all", "unused"))

    cellIntensities(x, mode=c("used", "all", "unused"))

    cellInformation(x)

    getCenterCell(x)

### Arguments

`x, object` | A CyData object.
`mode` | String specifying the types of markers that should be returned. By default, only the markers used for distance calculations are returned (i.e., set as `markers=` in `?prepareCellData`).

### Details

The CyData class is derived from the SummarizedExperiment class. It is intended to store the cell counts for each group of cells (rows) for each sample (columns). Groups are intended to be hyperspheres (see `countCells`) but could also be arbitrary clusters of cells. It also stores the median intensities for each group and the identity of cells in the groups, parallel to the rows.

CyData objects should not be created directly by users. The class has some strict validity conditions that are not easily satisfied by manual construction. It is strongly advised to rely on functions like `prepareCellData` and `countCells` to create the objects.

The subsetting and combining behaviour of CyData objects is mostly the same as that of SummarizedExperiment objects. The only difference is that any attempt to subset or combine by column will result in a warning. This is because the columns are usually not independent in contexts involving clustering cells across multiple samples. If a sample is to be removed, it is more appropriate to do so in the function that generates the CyData object (usually `prepareCellData`).

### Value

The `intensities` method returns a matrix of intensities for each group of cells (rows) and markers (columns).

The `cellAssignments` method returns a list of integer vectors, where each vector contains the identities of the cells in a group.

The `markernames` method returns a character vector of marker names, by default corresponding to the columns of the `intensities`. If `mode="unused"`, names of all unused markers are returned (i.e., not set as `markers=` in `?prepareCellData`). If `mode="all"`, names of all markers are returned.

The `cellIntensities` function returns a matrix of cell-level intensities for the specified markers. Rows correspond to markers while columns correspond to individual cells (not groups of cells, unlike `intensities`).

The `cellInformation` function returns a DataFrame of cell-level information, where each row corresponds to a column of the matrix from `cellIntensities`. It contains `sample`, an integer field specifying the sample of origin for each cell; and `row`, an integer field specifying the row of the sample-specific intensity matrix for that cell.

The `getCenterCell` function returns the index of the cell used at the center of each hypersphere. These indices correspond to columns of the `cellIntensities` output and rows of the `cellInformation` output.

### Author(s)

Aaron Lun

### Examples

    example(countCells, echo=FALSE)

    markernames(cnt)
    head(intensities(cnt))
    head(cellAssignments(cnt))

[Package cydar version 1.10.0 Index]