R: Get and set object keys

Key {SeuratObject} | R Documentation

## Get and set object keys

### Description

Get and set object keys

### Usage

    Key(object, ...)

    Key(object, ...) <- value

    Keys(object, ...)

    ## S3 method for class 'Assay'
    Key(object, ...)

    ## S3 replacement method for class 'Assay'
    Key(object, ...) <- value

    ## S3 method for class 'DimReduc'
    Key(object, ...)

    ## S3 replacement method for class 'DimReduc'
    Key(object, ...) <- value

    ## S3 method for class 'Seurat'
    Key(object, ...)

    ## S3 method for class 'Seurat'
    Keys(object, ...)

### Arguments

`object` | An object
`...` | Arguments passed to other methods
`value` | Key value

### Value

`Key`: the object key

`Key<-`: `object` with an updated key

`Keys`: a named vector of keys of sub-objects

### Examples

    # Get an Assay key
    Key(pbmc_small[["RNA"]])

    # Set the key for an Assay
    Key(pbmc_small[["RNA"]]) <- "newkey_"
    Key(pbmc_small[["RNA"]])

    # Get a DimReduc key
    Key(object = pbmc_small[["pca"]])

    # Set the key for DimReduc
    Key(object = pbmc_small[["pca"]]) <- "newkey2_"
    Key(object = pbmc_small[["pca"]])

    # Show all keys associated with a Seurat object
    Key(object = pbmc_small)
    Keys(object = pbmc_small)

[Package SeuratObject version 4.1.0 Index]