Skip to contents

Class representing a local Seurat object in a Vitessce dataset.

Details

Seurat object wrapper class

Super class

vitessceR::AbstractWrapper -> SeuratWrapper

Public fields

obj

The object to wrap.

assay

The assay name in the Seurat object.

cell_embeddings

The keys in the Seurat object's reductions/cell.embeddings to use for creating dimensionality reduction mappings.

cell_embedding_names

Names to use for creating dimensionality reduction mappings.

cell_embedding_dims

The dimension indices to use for creating dimensionality reduction mappings.

cell_set_metas

The keys in the Seurat object's meta.data to use for creating cell sets.

cell_set_meta_names

The keys in the Seurat object's meta.data to use for cell set names mapped to new names.

cell_set_meta_scores

The keys in the Seurat object's meta.data to use for cell set names mapped to keys for scores.

zarr_folder

The name for the folder at the root of the zarr store.

Methods

Inherited methods


Method new()

Create a wrapper around a Seurat object.

Usage

SeuratWrapper$new(
  obj,
  assay = NA,
  cell_embeddings = NA,
  cell_embedding_names = NA,
  cell_embedding_dims = NA,
  cell_set_metas = NA,
  cell_set_meta_names = NA,
  cell_set_meta_scores = NA,
  ...
)

Arguments

obj

The object to wrap.

assay

The assay name under the assays part of the Seurat object.

cell_embeddings

The keys in the Seurat object's reductions/cell.embeddings to use for creating dimensionality reduction plots.

cell_embedding_names

Names to use for creating dimensionality reduction plots.

cell_embedding_dims

An array of dimension indices to use for each cell_embedding.

cell_set_metas

An optional list of keys in the object's meta.data list to use for creating cell sets.

cell_set_meta_names

If cell_set_metas is provided, this list can also be provided to set new names to replace the keys in the interface.

cell_set_meta_scores

If cell_set_metas is provided, this list can also be provided to map between meta.data keys for set annotations and keys for annotation scores.

...

Parameters inherited from AbstractWrapper.

Returns

A new SeuratWrapper object.


Method check_obj()

Check that the object is valid

Usage

SeuratWrapper$check_obj()

Returns

Success or failure.


Method get_zarr_path()

Get the path to the zarr store, relative to the current directory.

Usage

SeuratWrapper$get_zarr_path(dataset_uid, obj_i)

Arguments

dataset_uid

The ID for this dataset.

obj_i

The index of this data object within the dataset.

Returns

A path as a string.


Method get_zarr_url()

Get the URL to the Zarr store, to fill in the file URL in the file definitions.

Usage

SeuratWrapper$get_zarr_url(base_url, dataset_uid, obj_i)

Arguments

base_url

The base URL, on which the route will be served.

dataset_uid

The ID for this dataset.

obj_i

The index of this data object within the dataset.

Returns

A URL as a string.


Method convert_and_save()

Create the JSON output files, web server routes, and file definition creators.

Usage

SeuratWrapper$convert_and_save(dataset_uid, obj_i)

Arguments

dataset_uid

The ID for this dataset.

obj_i

The index of this data object within the dataset.


Method make_cells_file_def_creator()

Make the file definition creator function for the cells data type.

Usage

SeuratWrapper$make_cells_file_def_creator(dataset_uid, obj_i)

Arguments

dataset_uid

The ID for this dataset.

obj_i

The index of this data object within the dataset.

Returns

A file definition creator function which takes a base_url parameter.


Method make_cell_sets_file_def_creator()

Make the file definition creator function for the cell sets data type.

Usage

SeuratWrapper$make_cell_sets_file_def_creator(dataset_uid, obj_i)

Arguments

dataset_uid

The ID for this dataset.

obj_i

The index of this data object within the dataset.

Returns

A file definition creator function which takes a base_url parameter.


Method make_expression_matrix_file_def_creator()

Make the file definition creator function for the expression matrix data type.

Usage

SeuratWrapper$make_expression_matrix_file_def_creator(dataset_uid, obj_i)

Arguments

dataset_uid

The ID for this dataset.

obj_i

The index of this data object within the dataset.

Returns

A file definition creator function which takes a base_url parameter.


Method clone()

The objects of this class are cloneable with this method.

Usage

SeuratWrapper$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

obj <- get_seurat_obj()
#> Found more than one class "SpatialImage" in cache; using the first, from namespace 'SpatialExperiment'
#> Also defined by ‘SeuratObject’
#> Warning: Input parameters result in NA values for initial cell identities. Setting all initial idents to the project name
w <- SeuratWrapper$new(
  obj,
  cell_embeddings = c("pca"),
  cell_embedding_names = c("PCA")
)
#> Warning: Specified cell_embeddings not all present in Seurat object reductions slot.