Skip to contents

Class representing a local Giotto object in a Vitessce dataset.

Details

Giotto object wrapper class

Super class

vitessceR::AbstractWrapper -> GiottoWrapper

Public fields

obj

The object to wrap.

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

GiottoWrapper$new(
  obj,
  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.

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


Method check_obj()

Check that the object is valid

Usage

GiottoWrapper$check_obj()

Returns

Success or failure.


Method get_zarr_path()

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

Usage

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

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

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

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

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

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

GiottoWrapper$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

obj <- get_giotto_obj()
#> Consider to install these (optional) packages to run all possible Giotto commands for spatial analyses:  scran MAST smfishHmrf trendsceek SPARK multinet RTriangle FactoMiner
#>  Giotto does not automatically install all these packages as they are not absolutely required and this reduces the number of dependencies
#>  no external python path or giotto environment was specified, will check if a default python path is available 
#> 
#>  A default python path was found:  /usr/bin/python3  and will be used
#> 
#>  If this is not the correct python path, either
#> 
#>  1. use installGiottoEnvironment() to install a local miniconda python environment along with required modules 
#> 
#>  2. provide an existing python path to python_path to use your own python path which has all modules installed 
#> Warning: module: pandas was not found with python path: /usr/bin/python3
#> Warning: module: igraph was not found with python path: /usr/bin/python3
#> Warning: module: leidenalg was not found with python path: /usr/bin/python3
#> Warning: module: community was not found with python path: /usr/bin/python3
#> Warning: module: networkx was not found with python path: /usr/bin/python3
#> Warning: module: sklearn was not found with python path: /usr/bin/python3
w <- GiottoWrapper$new(
  obj,
  cell_embeddings = c("pca"),
  cell_embedding_names = c("PCA")
)
#> Warning: Specified cell_embeddings not all present in Giotto object dimension_reduction