Get and set object keys

Key(object, ...)

Keys(object, ...)

Key(object, ...) <- value

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

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

# S3 method for Assay5
Key(object, ...)

# S3 method for Assay5
Key(object, ...) <- value

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

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

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

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

Arguments

object

An object

...

Arguments passed to other methods

value

Key value

Value

Key: the object key

Keys: a named vector of keys of sub-objects

Key<-: object with an updated key

Examples

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

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

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

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

# Show all keys associated with a Seurat object
Key(object = pbmc_small)
#>  meta.data        RNA        pca       tsne 
#>      "md_"  "newkey_" "newkey2_"    "tSNE_" 
Keys(object = pbmc_small)
#>  meta.data        RNA        pca       tsne 
#>      "md_"  "newkey_" "newkey2_"    "tSNE_"