Skip to contents

General wrapper function that can be used to pull out any embedding stored in the class. This function is used for the single cell-related classes and methods.

Usage

get_embedding(x, embd_name, ...)

## S7 method for class <bixverse::MetaCells>
get_embedding(x, embd_name, ...)

# S3 method for class 'ScCache'
get_embedding(x, embd_name, ...)

## S7 method for class <bixverse::SingleCells>
get_embedding(x, embd_name, ...)

## S7 method for class <bixverse::SingleCellsSubset>
get_embedding(x, embd_name, ...)

Arguments

x

An object to get embedding from

embd_name

String. The name of the embedding to return. The function will throw an error if the embedding does not exist.

...

Other parameters.

Value

Get the specified embeddings from the object (if found).

Examples

# any stored embedding, by name
sc <- demo_single_cells()
dim(get_embedding(sc, "pca"))
#> [1] 500  10

unlink(sc@dir_data, recursive = TRUE, force = TRUE)