meta {dittoSeq} | R Documentation

## Returns the values of a meta.data for all cells/samples

### Description

Returns the values of a meta.data for all cells/samples

### Usage

    meta(meta, object, adjustment = NULL, adj.fxn = NULL)

### Arguments

`meta` | String, the name of the "metadata" slot to grab. OR "ident" to retireve the clustering of a Seurat `object`.
`object` | A Seurat, SingleCellExperiment, or SummarizedExperiment object.
`adjustment` | A recognized string indicating whether numeric metadata should be used directly (default) versus adjusted to be "z-score": scaled with the scale() function to produce a relative-to-mean z-score representation "relative.to.max": divided by the maximum expression value to give percent of max values between [0,1] Ignored if the target metadata is not numeric.
`adj.fxn` | A function which takes a vector (of metadata values) and returns a vector of the same length. For example, `function(x) {log2(x)}` or `as.factor`

### Details

Retrieves the values of a metadata slot from `object`, or the clustering slot if `meta = "ident"` and the `object` is a Seurat.

If `adjustment` or `adj.fxn` are provided, then these requested adjustments are applied to these values (`adjustment` first). Note: Alterations via `adjustment` are only applied when metadata is numeric, but `adj.fxn` alterations are applied to metadata of any type.

Lastly, outputs these values are named as the cells'/samples' names.

### Value

A named vector.

### Author(s)

Daniel Bunis

### See Also

`metaLevels` for returning just the unique discrete identities that exist within a metadata slot

`getMetas` for returning all metadata slots of an `object`

`isMeta` for testing whether something is the name of a metadata slot

### Examples

    example(importDittoBulk, echo = FALSE)
    meta("groups", object = myRNA)

    myRNA$numbers <- seq_len(ncol(myRNA))
    meta("numbers", myRNA, adjustment = "z-score")
    meta("numbers", myRNA, adj.fxn = as.factor)
    meta("numbers", myRNA, adj.fxn = function(x) {log2(x)})

[Package dittoSeq version 1.6.0 Index]