SCE-accessors {CATALYST} | R Documentation

## `SingleCellExperiment` accessors

### Description

Various wrappers to conviniently access slots in a `SingleCellExperiment` created with `prepData`, and that are used frequently during differential analysis.

### Usage

    ## S4 method for signature 'SingleCellExperiment'
    ei(x)

    ## S4 method for signature 'SingleCellExperiment'
    n_cells(x)

    ## S4 method for signature 'SingleCellExperiment'
    channels(x)

    ## S4 method for signature 'SingleCellExperiment'
    marker_classes(x)

    ## S4 method for signature 'SingleCellExperiment'
    type_markers(x)

    ## S4 method for signature 'SingleCellExperiment'
    state_markers(x)

    ## S4 method for signature 'SingleCellExperiment'
    sample_ids(x)

    ## S4 method for signature 'SingleCellExperiment,missing'
    cluster_ids(x, k = NULL)

    ## S4 method for signature 'SingleCellExperiment,character'
    cluster_ids(x, k = NULL)

    ## S4 method for signature 'SingleCellExperiment'
    cluster_codes(x)

    ## S4 method for signature 'SingleCellExperiment'
    delta_area(x)

### Arguments

`x` | a `SingleCellExperiment`.
`k` | character string specifying the clustering to extract. Valid values are `names(cluster_codes(x))`.

### Value

`ei`

  extracts the experimental design table.

`n_cells`

  extracts the number of events measured per sample.

`channels`

  extracts the original FCS file's channel names.

`marker_classes`

  extracts marker class assignments ("type", "state", "none").

`type_markers`

  extracts the antigens used for clustering.

`state_markers`

  extracts antigens that were not used for clustering.

`sample_ids`

  extracts the sample IDs as specified in the metadata-table.

`cluster_ids`

  extracts the numeric vector of cluster IDs as inferred by `FlowSOM`.

`cluster_codes`

  extracts a `data.frame` containing cluster codes for the `FlowSOM` clustering, the `ConsensusClusterPlus` metaclustering, and all mergings done through `mergeClusters`.

`delta_area`

  extracts the delta area plot stored in the SCE's `metadata` by `cluster`

### Author(s)

Helena L Crowell helena.crowell@uzh.ch

### Examples

    # construct SCE & run clustering
    data(PBMC_fs, PBMC_panel, PBMC_md)
    sce <- prepData(PBMC_fs, PBMC_panel, PBMC_md)
    sce <- cluster(sce)

    # view experimental design table
    ei(sce)

    # quick-access sample & cluster assignments
    plot(table(sample_ids(sce)))
    plot(table(cluster_ids(sce)))

    # access specific clustering resolution
    table(cluster_ids(sce, k = "meta8"))

    # access marker information
    channels(sce)
    marker_classes(sce)
    type_markers(sce)
    state_markers(sce)

    # get cluster ID correspondece between 2 clusterings
    old_ids <- seq_len(20)
    m <- match(old_ids, cluster_codes(sce)$`meta20`)
    new_ids <- cluster_codes(sce)$`meta12`[m]
    data.frame(old_ids, new_ids)

    # view delta area plot (relative change in area
    # under CDF curve vs. the number of clusters 'k')
    delta_area(sce)

[Package CATALYST version 1.18.1 Index]