Skip to contents

Class representing a local SpatialExperiment object in a Vitessce dataset.

Details

SpatialExperiment object wrapper class

Super class

vitessceR::AbstractWrapper -> SPEWrapper

Public fields

obj

The object to wrap.

img_sample_id

The sample_id for the image of interest.

img_image_id

The image_id for the image of interest.

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.

img_filename

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

Methods

Inherited methods


Method new()

Create a wrapper around a Seurat object.

Usage

SPEWrapper$new(
  obj,
  sample_id = NA,
  image_id = 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.

sample_id

The sample_id for the image of interest.

image_id

The image_id for the image of interest.

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 SPEWrapper object.


Method check_obj()

Check that the object is valid

Usage

SPEWrapper$check_obj()

Returns

Success or failure.


Method get_zarr_path()

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

Usage

SPEWrapper$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

SPEWrapper$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 get_img_path()

Get the path to the image Zarr store, relative to the current directory.

Usage

SPEWrapper$get_img_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_img_url()

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

Usage

SPEWrapper$get_img_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

SPEWrapper$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

SPEWrapper$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

SPEWrapper$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

SPEWrapper$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 make_raster_file_def_creator()

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

Usage

SPEWrapper$make_raster_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

SPEWrapper$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

obj <- get_spe_obj()
w <- SPEWrapper$new(
  obj,
  sample_id = "sample1",
  image_id = "image1"
)