From 13be60b8b4d8abeb597d4ccee01982d5d5167ee2 Mon Sep 17 00:00:00 2001
From: Mark Keller <7525285+keller-mark@users.noreply.github.com>
Date: Mon, 2 Oct 2023 14:09:59 -0400
Subject: [PATCH] Update docs
---
NAMESPACE | 1 +
R/config.R | 11 ++
R/wrappers.R | 39 ++++
R/wrappers_anndata.R | 77 ++++++--
R/wrappers_csv.R | 47 +++--
man/AbstractWrapper.Rd | 116 +++++++++++
man/{SeuratWrapper.Rd => AnnDataWrapper.Rd} | 96 +++++++--
man/Component.Rd | 4 +-
man/CoordinationType.Rd | 4 +-
man/CsvWrapper.Rd | 208 ++++++++++++++++++++
man/DataType.Rd | 2 +-
man/FileType.Rd | 3 +-
man/MultiImageWrapper.Rd | 2 +
man/OmeTiffWrapper.Rd | 2 +
man/VitessceConfig.Rd | 34 ++--
man/VitessceConfigCoordinationScope.Rd | 2 +
man/VitessceConfigDataset.Rd | 14 +-
man/VitessceConfigDatasetFile.Rd | 2 +
man/VitessceConfigServerRangeRoute.Rd | 84 +++++++-
man/export_to_files.Rd | 2 +-
man/hconcat.Rd | 4 +-
man/vconcat.Rd | 4 +-
man/vitessce_widget.Rd | 2 +-
vignettes/shiny.Rmd | 17 +-
24 files changed, 692 insertions(+), 85 deletions(-)
rename man/{SeuratWrapper.Rd => AnnDataWrapper.Rd} (65%)
create mode 100644 man/CsvWrapper.Rd
diff --git a/NAMESPACE b/NAMESPACE
index 8988f2e..52db099 100644
--- a/NAMESPACE
+++ b/NAMESPACE
@@ -4,6 +4,7 @@ export(AbstractWrapper)
export(AnnDataWrapper)
export(Component)
export(CoordinationType)
+export(CsvWrapper)
export(DataType)
export(FileType)
export(MultiImageWrapper)
diff --git a/R/config.R b/R/config.R
index f43ebd9..03aa68c 100644
--- a/R/config.R
+++ b/R/config.R
@@ -60,6 +60,7 @@ VitessceConfigDatasetFile <- R6::R6Class("VitessceConfigDatasetFile",
#' @param data_type A data type for the file.
#' @param file_type A file type for the file.
#' @param options A list of options to include for the file.
+ #' @param coordination_values A list of coordination values to include in the file definition.
#' @return A new `VitessceConfigDatasetFile` object.
initialize = function(url = NA, file_type = NA, options = NA, coordination_values = NA, data_type = NA) {
private$file <- obj_list()
@@ -103,6 +104,7 @@ VitessceConfigDataset <- R6::R6Class("VitessceConfigDataset",
#' Create a new dataset object.
#' @param uid A unique identifier string for the dataset.
#' @param name A name for the dataset
+ #' @param base_dir A directory which local files are configured relative to.
#' @return A new `VitessceConfigDataset` object.
initialize = function(uid, name, base_dir = NA) {
self$dataset <- list(
@@ -113,9 +115,15 @@ VitessceConfigDataset <- R6::R6Class("VitessceConfigDataset",
private$objs <- list()
self$base_dir <- base_dir
},
+ #' @description
+ #' Get the dataset name.
+ #' @return The name as a string.
get_name = function() {
return(self$dataset[['name']])
},
+ #' @description
+ #' Get the dataset UID.
+ #' @return The uid as a string.
get_uid = function() {
return(self$dataset[['uid']])
},
@@ -231,6 +239,7 @@ VitessceConfigCoordinationScope <- R6::R6Class("VitessceConfigCoordinationScope"
#' Create a new coordination scope object.
#' @param c_type A coordination type name.
#' @param c_scope A coordination scope name.
+ #' @param c_value An initial value for the coordination scope.
#' @return A new `VitessceConfigCoordinationScope` object.
initialize = function(c_type, c_scope, c_value = NA) {
self$c_type <- c_type
@@ -374,6 +383,7 @@ VitessceConfigView <- R6::R6Class("VitessceConfigView",
}
invisible(self)
},
+ #' @description
use_coordination_by_dict = function(scopes) {
# TODO
invisible(self)
@@ -429,6 +439,7 @@ VitessceConfig <- R6::R6Class("VitessceConfig",
base_dir = NULL,
#' @description
#' Create a new config object.
+ #' @param schema_version The Vitessce config schema version to use.
#' @param name A name for the config.
#' @param description A description for the config.
#' @return A new `VitessceConfig` object.
diff --git a/R/wrappers.R b/R/wrappers.R
index 2da7232..34681aa 100644
--- a/R/wrappers.R
+++ b/R/wrappers.R
@@ -111,16 +111,42 @@ AbstractWrapper <- R6::R6Class("AbstractWrapper",
)
return(route)
},
+ #' @description
+ #' Construct a URL to a local directory.
+ #'
+ #' @param base_url The base URL on which the web server is serving.
+ #' @param dataset_uid The ID for this dataset.
+ #' @param obj_i The index of this data object within the dataset.
+ #' @param local_dir_path The path to the local directory.
+ #' @param local_dir_uid A unique identifier for this local directory in this dataset.
+ #' @return A string for the URL.
get_local_dir_url = function(base_url, dataset_uid, obj_i, local_dir_path, local_dir_uid) {
if(!self$is_remote && !is.na(self$base_dir)) {
return(self$get_url_simple(base_url, file_path_to_url_path(local_dir_path, prepend_slash = FALSE)))
}
return(self$get_url(base_url, dataset_uid, obj_i, local_dir_uid))
},
+ #' @description
+ #' Construct a URL to a local file.
+ #'
+ #' @param base_url The base URL on which the web server is serving.
+ #' @param dataset_uid The ID for this dataset.
+ #' @param obj_i The index of this data object within the dataset.
+ #' @param local_file_path The path to the local file.
+ #' @param local_file_uid A unique identifier for this local file in this dataset.
+ #' @return A string for the URL.
get_local_file_url = function(base_url, dataset_uid, obj_i, local_file_path, local_file_uid) {
# Same logic as get_local_dir_url
return(self$get_local_dir_url(base_url, dataset_uid, obj_i, local_file_path, local_file_uid))
},
+ #' @description
+ #' Create a web server route for this object.
+ #'
+ #' @param dataset_uid The ID for this dataset.
+ #' @param obj_i The index of this data object within the dataset.
+ #' @param local_dir_path The path to the local directory.
+ #' @param local_dir_uid A unique identifier for this local directory in this dataset.
+ #' @return A new `VitessceConfigServerStaticRoute` instance.
get_local_dir_route = function(dataset_uid, obj_i, local_dir_path, local_dir_uid) {
if(!self$is_remote) {
if(is.na(self$base_dir)) {
@@ -137,6 +163,14 @@ AbstractWrapper <- R6::R6Class("AbstractWrapper",
}
return(list())
},
+ #' @description
+ #' Create a web server route for this object.
+ #'
+ #' @param dataset_uid The ID for this dataset.
+ #' @param obj_i The index of this data object within the dataset.
+ #' @param local_file_path The path to the local file.
+ #' @param local_file_uid A unique identifier for this local file in this dataset.
+ #' @return A new `VitessceConfigServerFileRoute` instance.
get_local_file_route = function(dataset_uid, obj_i, local_file_path, local_file_uid) {
if(!self$is_remote) {
if(is.na(self$base_dir)) {
@@ -166,6 +200,11 @@ AbstractWrapper <- R6::R6Class("AbstractWrapper",
retval <- paste0(base_url, self$get_route_str(dataset_uid, obj_i, ...))
return(retval)
},
+ #' @description
+ #' Construct a URL.
+ #' @param base_url The base URL on which the web server is serving.
+ #' @param suffix The suffix to append to the base URL.
+ #' @return A URL as a string like {base_url}/{suffix}
get_url_simple = function(base_url, suffix) {
return(paste0(base_url, "/", suffix))
},
diff --git a/R/wrappers_anndata.R b/R/wrappers_anndata.R
index a455c37..62bb58c 100644
--- a/R/wrappers_anndata.R
+++ b/R/wrappers_anndata.R
@@ -1,18 +1,11 @@
-#' Seurat object wrapper class
-#' @title SeuratWrapper Class
+#' AnnData object wrapper class
+#' @title AnnDataWrapper Class
#' @docType class
#' @description
-#' Class representing a local Seurat object in a Vitessce dataset.
+#' Class representing an AnnData object (saved to a Zarr store) in a Vitessce dataset.
#'
-#' @rdname SeuratWrapper
+#' @rdname AnnDataWrapper
#' @export
-#' @examples
-#' obj <- get_seurat_obj()
-#' w <- SeuratWrapper$new(
-#' obj,
-#' cell_embeddings = c("pca"),
-#' cell_embedding_names = c("PCA")
-#' )
AnnDataWrapper <- R6::R6Class("AnnDataWrapper",
inherit = AbstractWrapper,
public = list(
@@ -25,30 +18,77 @@ AnnDataWrapper <- R6::R6Class("AnnDataWrapper",
#' @field local_dir_uid The path to the local zarr store.
#' @keywords internal
local_dir_uid = NULL,
-
-
+ #' @field obs_feature_matrix_path The path to the observation-by-feature matrix within the Zarr store.
+ #' @keywords internal
obs_feature_matrix_path=NULL,
+ #' @field feature_filter_path The path to the a column of adata.var within the Zarr store.
+ #' Use this if obs_feature_matrix_path points to a subset of adata.X (relative to the full adata.var).
+ #' @keywords internal
feature_filter_path=NULL,
+ #' @field initial_feature_filter_path The path to the a column of adata.var within the Zarr store.
+ #' Use this to load a subset of the matrix at obs_feature_matrix_path initially.
+ #' @keywords internal
initial_feature_filter_path=NULL,
+ #' @field obs_set_paths A list of paths to the observation sets within the Zarr store.
+ #' @keywords internal
obs_set_paths=NULL,
+ #' @field obs_set_names A list of names for the observation sets.
+ #' @keywords internal
obs_set_names=NULL,
+ #' @field obs_locations_path The path to the observation locations within the Zarr store.
+ #' @keywords internal
obs_locations_path=NULL,
+ #' @field obs_segmentations_path The path to the observation segmentations within the Zarr store.
+ #' @keywords internal
obs_segmentations_path=NULL,
+ #' @field obs_embedding_paths A list of paths to the observation embeddings within the Zarr store.
+ #' @keywords internal
obs_embedding_paths=NULL,
+ #' @field obs_embedding_names A list of names for the observation embeddings.
+ #' @keywords internal
obs_embedding_names=NULL,
+ #' @field obs_embedding_dims A list of dimensions for the observation embeddings.
+ #' @keywords internal
obs_embedding_dims=NULL,
- request_init=NULL,
+ #' @field feature_labels_path The path to the feature labels within the Zarr store.
+ #' @keywords internal
feature_labels_path=NULL,
+ #' @field obs_labels_path The path to the observation labels within the Zarr store.
+ #' @keywords internal
obs_labels_path=NULL,
+ #' @field obs_labels_paths A list of paths to the observation labels within the Zarr store.
+ #' @keywords internal
obs_labels_paths=NULL,
+ #' @field obs_labels_names A list of names for the observation labels.
+ #' @keywords internal
obs_labels_names=NULL,
+ #' @field coordination_values A list of coordination values for the file definition.
+ #' @keywords internal
coordination_values=NULL,
-
+ #' @field request_init A list of requestInit options for the Zarr store.
+ #' @keywords internal
+ request_init=NULL,
#' @description
#' Create a wrapper around an AnnData object saved to a Zarr store.
#' @param adata_path The path to a local Zarr store.
+ #' @param adata_url The URL to a remote Zarr store.
+ #' @param obs_feature_matrix_path The path to the observation-by-feature matrix within the Zarr store.
+ #' @param feature_filter_path The path to the a column of adata.var within the Zarr store. Use this if obs_feature_matrix_path points to a subset of adata.X (relative to the full adata.var).
+ #' @param initial_feature_filter_path The path to the a column of adata.var within the Zarr store. Use this to load a subset of the matrix at obs_feature_matrix_path initially.
+ #' @param obs_set_paths A list of paths to the observation sets within the Zarr store.
+ #' @param obs_set_names A list of names for the observation sets.
+ #' @param obs_locations_path The path to the observation locations within the Zarr store.
+ #' @param obs_segmentations_path The path to the observation segmentations within the Zarr store.
+ #' @param obs_embedding_paths A list of paths to the observation embeddings within the Zarr store.
+ #' @param obs_embedding_names A list of names for the observation embeddings.
+ #' @param obs_embedding_dims A list of dimensions for the observation embeddings.
+ #' @param request_init A list of requestInit options for the Zarr store.
+ #' @param feature_labels_path The path to the feature labels within the Zarr store.
+ #' @param obs_labels_paths A list of paths to the observation labels within the Zarr store.
+ #' @param obs_labels_names A list of names for the observation labels.
+ #' @param coordination_values A list of coordination values for the file definition.
#' @param ... Parameters inherited from `AbstractWrapper`.
- #' @return A new `SeuratWrapper` object.
+ #' @return A new `AnnDataWrapper` object.
initialize = function(adata_path = NA, adata_url = NA, obs_feature_matrix_path = NA, feature_filter_path = NA, initial_feature_filter_path = NA, obs_set_paths = NA, obs_set_names = NA, obs_locations_path = NA, obs_segmentations_path = NA, obs_embedding_paths = NA, obs_embedding_names = NA, obs_embedding_dims = NA, request_init = NA, feature_labels_path = NA, obs_labels_path = NA, coordination_values = NA, obs_labels_paths = NA, obs_labels_names = NA, ...) {
super$initialize(...)
self$adata_path <- adata_path
@@ -91,6 +131,7 @@ AnnDataWrapper <- R6::R6Class("AnnDataWrapper",
#' Create the JSON output files, web server routes, and file definition creators.
#' @param dataset_uid The ID for this dataset.
#' @param obj_i The index of this data object within the dataset.
+ #' @param base_dir A base directory for local data.
convert_and_save = function(dataset_uid, obj_i, base_dir = NA) {
if(self$is_remote) {
super$convert_and_save(dataset_uid, obj_i, base_dir = base_dir)
@@ -108,6 +149,10 @@ AnnDataWrapper <- R6::R6Class("AnnDataWrapper",
self$routes <- append(self$routes, route)
}
},
+ #' @description
+ #' Get a list of server route objects.
+ #' @param dataset_uid The ID for this dataset.
+ #' @param obj_i The index of this data object within the dataset.
make_routes = function(dataset_uid, obj_i) {
return(self$get_local_dir_route(dataset_uid, obj_i, self$adata_path, self$local_dir_uid))
},
diff --git a/R/wrappers_csv.R b/R/wrappers_csv.R
index 67d8bbd..40ab324 100644
--- a/R/wrappers_csv.R
+++ b/R/wrappers_csv.R
@@ -1,42 +1,46 @@
-#' Seurat object wrapper class
-#' @title SeuratWrapper Class
+#' CSV file wrapper class
+#' @title CsvWrapper Class
#' @docType class
#' @description
-#' Class representing a local Seurat object in a Vitessce dataset.
+#' Class representing a CSV file in a Vitessce dataset.
#'
-#' @rdname SeuratWrapper
+#' @rdname CsvWrapper
#' @export
-#' @examples
-#' obj <- get_seurat_obj()
-#' w <- SeuratWrapper$new(
-#' obj,
-#' cell_embeddings = c("pca"),
-#' cell_embedding_names = c("PCA")
-#' )
CsvWrapper <- R6::R6Class("CsvWrapper",
inherit = AbstractWrapper,
public = list(
- #' @field adata_path The object to wrap.
+ #' @field csv_path The object to wrap.
#' @keywords internal
csv_path = NULL,
- #' @field adata_url The object to wrap.
+ #' @field csv_url The object to wrap.
#' @keywords internal
csv_url = NULL,
- #' @field local_dir_uid The path to the local zarr store.
+ #' @field local_csv_uid The path to the local zarr store.
#' @keywords internal
local_csv_uid = NULL,
-
+ #' @field data_type The Vitessce data type for this file.
+ #' @keywords internal
data_type = NULL,
+ #' @field options A list of options to pass to the Vitessce file definition.
+ #' @keywords internal
options=NULL,
+ #' @field coordination_values A list of coordination values to pass to the Vitessce file definition.
+ #' @keywords internal
coordination_values=NULL,
+ #' @field request_init A list of requestInit values to pass to fetch when loading the CSV over HTTP.
+ #' @keywords internal
request_init = NULL,
-
#' @description
- #' Create a wrapper around an AnnData object saved to a Zarr store.
- #' @param adata_path The path to a local Zarr store.
+ #' Create a wrapper around a CSV file.
+ #' @param csv_path The path to a local CSV file.
+ #' @param csv_url The URL to a remote CSV file.
+ #' @param data_type The Vitessce data type for this file.
+ #' @param options A list of options to pass to the Vitessce file definition.
+ #' @param coordination_values A list of coordination values to pass to the Vitessce file definition.
+ #' @param request_init A list of requestInit values to pass to fetch when loading the CSV over HTTP.
#' @param ... Parameters inherited from `AbstractWrapper`.
- #' @return A new `SeuratWrapper` object.
+ #' @return A new `CsvWrapper` object.
initialize = function(csv_path = NA, csv_url = NA, data_type = NA, options = NA, coordination_values = NA, request_init = NA, ...) {
super$initialize(...)
self$csv_path <- csv_path
@@ -71,6 +75,7 @@ CsvWrapper <- R6::R6Class("CsvWrapper",
#' Create the JSON output files, web server routes, and file definition creators.
#' @param dataset_uid The ID for this dataset.
#' @param obj_i The index of this data object within the dataset.
+ #' @param base_dir A base directory for local data.
convert_and_save = function(dataset_uid, obj_i, base_dir = NA) {
if(self$is_remote) {
super$convert_and_save(dataset_uid, obj_i, base_dir = base_dir)
@@ -88,6 +93,10 @@ CsvWrapper <- R6::R6Class("CsvWrapper",
self$routes <- append(self$routes, route)
}
},
+ #' @description
+ #' Get a list of server route objects.
+ #' @param dataset_uid The ID for this dataset.
+ #' @param obj_i The index of this data object within the dataset.
make_routes = function(dataset_uid, obj_i) {
return(self$get_local_file_route(dataset_uid, obj_i, self$csv_path, self$local_csv_uid))
},
diff --git a/man/AbstractWrapper.Rd b/man/AbstractWrapper.Rd
index 6f57f3e..b4d561a 100644
--- a/man/AbstractWrapper.Rd
+++ b/man/AbstractWrapper.Rd
@@ -37,7 +37,9 @@ Abstract dataset object wrapper class
\item \href{#method-AbstractWrapper-get_file_defs}{\code{AbstractWrapper$get_file_defs()}}
\item \href{#method-AbstractWrapper-get_out_dir_route}{\code{AbstractWrapper$get_out_dir_route()}}
\item \href{#method-AbstractWrapper-get_local_dir_url}{\code{AbstractWrapper$get_local_dir_url()}}
+\item \href{#method-AbstractWrapper-get_local_file_url}{\code{AbstractWrapper$get_local_file_url()}}
\item \href{#method-AbstractWrapper-get_local_dir_route}{\code{AbstractWrapper$get_local_dir_route()}}
+\item \href{#method-AbstractWrapper-get_local_file_route}{\code{AbstractWrapper$get_local_file_route()}}
\item \href{#method-AbstractWrapper-get_url}{\code{AbstractWrapper$get_url()}}
\item \href{#method-AbstractWrapper-get_url_simple}{\code{AbstractWrapper$get_url_simple()}}
\item \href{#method-AbstractWrapper-get_route_str}{\code{AbstractWrapper$get_route_str()}}
@@ -151,6 +153,7 @@ A new \code{VitessceConfigServerStaticRoute} instance.
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-AbstractWrapper-get_local_dir_url}{}}}
\subsection{Method \code{get_local_dir_url()}}{
+Construct a URL to a local directory.
\subsection{Usage}{
\if{html}{\out{
}}\preformatted{AbstractWrapper$get_local_dir_url(
base_url,
@@ -161,11 +164,64 @@ A new \code{VitessceConfigServerStaticRoute} instance.
)}\if{html}{\out{
}}
}
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{base_url}}{The base URL on which the web server is serving.}
+
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+
+\item{\code{local_dir_path}}{The path to the local directory.}
+
+\item{\code{local_dir_uid}}{A unique identifier for this local directory in this dataset.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A string for the URL.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-AbstractWrapper-get_local_file_url}{}}}
+\subsection{Method \code{get_local_file_url()}}{
+Construct a URL to a local file.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{AbstractWrapper$get_local_file_url(
+ base_url,
+ dataset_uid,
+ obj_i,
+ local_file_path,
+ local_file_uid
+)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{base_url}}{The base URL on which the web server is serving.}
+
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+
+\item{\code{local_file_path}}{The path to the local file.}
+
+\item{\code{local_file_uid}}{A unique identifier for this local file in this dataset.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A string for the URL.
+}
}
\if{html}{\out{
}}
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-AbstractWrapper-get_local_dir_route}{}}}
\subsection{Method \code{get_local_dir_route()}}{
+Create a web server route for this object.
\subsection{Usage}{
\if{html}{\out{}}\preformatted{AbstractWrapper$get_local_dir_route(
dataset_uid,
@@ -175,6 +231,53 @@ A new \code{VitessceConfigServerStaticRoute} instance.
)}\if{html}{\out{
}}
}
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+
+\item{\code{local_dir_path}}{The path to the local directory.}
+
+\item{\code{local_dir_uid}}{A unique identifier for this local directory in this dataset.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A new \code{VitessceConfigServerStaticRoute} instance.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-AbstractWrapper-get_local_file_route}{}}}
+\subsection{Method \code{get_local_file_route()}}{
+Create a web server route for this object.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{AbstractWrapper$get_local_file_route(
+ dataset_uid,
+ obj_i,
+ local_file_path,
+ local_file_uid
+)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+
+\item{\code{local_file_path}}{The path to the local file.}
+
+\item{\code{local_file_uid}}{A unique identifier for this local file in this dataset.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A new \code{VitessceConfigServerFileRoute} instance.
+}
}
\if{html}{\out{
}}
\if{html}{\out{}}
@@ -206,10 +309,23 @@ A URL as a string.
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-AbstractWrapper-get_url_simple}{}}}
\subsection{Method \code{get_url_simple()}}{
+Construct a URL.
\subsection{Usage}{
\if{html}{\out{}}\preformatted{AbstractWrapper$get_url_simple(base_url, suffix)}\if{html}{\out{
}}
}
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{base_url}}{The base URL on which the web server is serving.}
+
+\item{\code{suffix}}{The suffix to append to the base URL.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A URL as a string like {base_url}/{suffix}
+}
}
\if{html}{\out{
}}
\if{html}{\out{}}
diff --git a/man/SeuratWrapper.Rd b/man/AnnDataWrapper.Rd
similarity index 65%
rename from man/SeuratWrapper.Rd
rename to man/AnnDataWrapper.Rd
index 139b693..886ffbe 100644
--- a/man/SeuratWrapper.Rd
+++ b/man/AnnDataWrapper.Rd
@@ -3,20 +3,12 @@
\docType{class}
\name{AnnDataWrapper}
\alias{AnnDataWrapper}
-\title{SeuratWrapper Class}
+\title{AnnDataWrapper Class}
\description{
-Class representing a local Seurat object in a Vitessce dataset.
+Class representing an AnnData object (saved to a Zarr store) in a Vitessce dataset.
}
\details{
-Seurat object wrapper class
-}
-\examples{
-obj <- get_seurat_obj()
-w <- SeuratWrapper$new(
- obj,
- cell_embeddings = c("pca"),
- cell_embedding_names = c("PCA")
-)
+AnnData object wrapper class
}
\keyword{internal}
\section{Super class}{
@@ -30,6 +22,40 @@ w <- SeuratWrapper$new(
\item{\code{adata_url}}{The object to wrap.}
\item{\code{local_dir_uid}}{The path to the local zarr store.}
+
+\item{\code{obs_feature_matrix_path}}{The path to the observation-by-feature matrix within the Zarr store.}
+
+\item{\code{feature_filter_path}}{The path to the a column of adata.var within the Zarr store.
+Use this if obs_feature_matrix_path points to a subset of adata.X (relative to the full adata.var).}
+
+\item{\code{initial_feature_filter_path}}{The path to the a column of adata.var within the Zarr store.
+Use this to load a subset of the matrix at obs_feature_matrix_path initially.}
+
+\item{\code{obs_set_paths}}{A list of paths to the observation sets within the Zarr store.}
+
+\item{\code{obs_set_names}}{A list of names for the observation sets.}
+
+\item{\code{obs_locations_path}}{The path to the observation locations within the Zarr store.}
+
+\item{\code{obs_segmentations_path}}{The path to the observation segmentations within the Zarr store.}
+
+\item{\code{obs_embedding_paths}}{A list of paths to the observation embeddings within the Zarr store.}
+
+\item{\code{obs_embedding_names}}{A list of names for the observation embeddings.}
+
+\item{\code{obs_embedding_dims}}{A list of dimensions for the observation embeddings.}
+
+\item{\code{feature_labels_path}}{The path to the feature labels within the Zarr store.}
+
+\item{\code{obs_labels_path}}{The path to the observation labels within the Zarr store.}
+
+\item{\code{obs_labels_paths}}{A list of paths to the observation labels within the Zarr store.}
+
+\item{\code{obs_labels_names}}{A list of names for the observation labels.}
+
+\item{\code{coordination_values}}{A list of coordination values for the file definition.}
+
+\item{\code{request_init}}{A list of requestInit options for the Zarr store.}
}
\if{html}{\out{}}
}
@@ -51,6 +77,8 @@ w <- SeuratWrapper$new(
vitessceR::AbstractWrapper$get_file_defs()
vitessceR::AbstractWrapper$get_local_dir_route()
vitessceR::AbstractWrapper$get_local_dir_url()
+vitessceR::AbstractWrapper$get_local_file_route()
+vitessceR::AbstractWrapper$get_local_file_url()
vitessceR::AbstractWrapper$get_out_dir()
vitessceR::AbstractWrapper$get_out_dir_route()
vitessceR::AbstractWrapper$get_route_str()
@@ -94,12 +122,44 @@ Create a wrapper around an AnnData object saved to a Zarr store.
\describe{
\item{\code{adata_path}}{The path to a local Zarr store.}
+\item{\code{adata_url}}{The URL to a remote Zarr store.}
+
+\item{\code{obs_feature_matrix_path}}{The path to the observation-by-feature matrix within the Zarr store.}
+
+\item{\code{feature_filter_path}}{The path to the a column of adata.var within the Zarr store. Use this if obs_feature_matrix_path points to a subset of adata.X (relative to the full adata.var).}
+
+\item{\code{initial_feature_filter_path}}{The path to the a column of adata.var within the Zarr store. Use this to load a subset of the matrix at obs_feature_matrix_path initially.}
+
+\item{\code{obs_set_paths}}{A list of paths to the observation sets within the Zarr store.}
+
+\item{\code{obs_set_names}}{A list of names for the observation sets.}
+
+\item{\code{obs_locations_path}}{The path to the observation locations within the Zarr store.}
+
+\item{\code{obs_segmentations_path}}{The path to the observation segmentations within the Zarr store.}
+
+\item{\code{obs_embedding_paths}}{A list of paths to the observation embeddings within the Zarr store.}
+
+\item{\code{obs_embedding_names}}{A list of names for the observation embeddings.}
+
+\item{\code{obs_embedding_dims}}{A list of dimensions for the observation embeddings.}
+
+\item{\code{request_init}}{A list of requestInit options for the Zarr store.}
+
+\item{\code{feature_labels_path}}{The path to the feature labels within the Zarr store.}
+
+\item{\code{coordination_values}}{A list of coordination values for the file definition.}
+
+\item{\code{obs_labels_paths}}{A list of paths to the observation labels within the Zarr store.}
+
+\item{\code{obs_labels_names}}{A list of names for the observation labels.}
+
\item{\code{...}}{Parameters inherited from \code{AbstractWrapper}.}
}
\if{html}{\out{}}
}
\subsection{Returns}{
-A new \code{SeuratWrapper} object.
+A new \code{AnnDataWrapper} object.
}
}
\if{html}{\out{
}}
@@ -117,6 +177,8 @@ Create the JSON output files, web server routes, and file definition creators.
\item{\code{dataset_uid}}{The ID for this dataset.}
\item{\code{obj_i}}{The index of this data object within the dataset.}
+
+\item{\code{base_dir}}{A base directory for local data.}
}
\if{html}{\out{}}
}
@@ -125,10 +187,20 @@ Create the JSON output files, web server routes, and file definition creators.
\if{html}{\out{}}
\if{latex}{\out{\hypertarget{method-AnnDataWrapper-make_routes}{}}}
\subsection{Method \code{make_routes()}}{
+Get a list of server route objects.
\subsection{Usage}{
\if{html}{\out{}}\preformatted{AnnDataWrapper$make_routes(dataset_uid, obj_i)}\if{html}{\out{
}}
}
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+}
+\if{html}{\out{
}}
+}
}
\if{html}{\out{
}}
\if{html}{\out{}}
diff --git a/man/Component.Rd b/man/Component.Rd
index 36ce25e..2b6f396 100644
--- a/man/Component.Rd
+++ b/man/Component.Rd
@@ -5,7 +5,7 @@
\alias{Component}
\title{Enumeration of Component values}
\format{
-An object of class \code{list} of length 10.
+An object of class \code{list} of length 12.
}
\usage{
Component
@@ -26,7 +26,7 @@ valid string constant values representing components.
}
}
\examples{
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")
description <- vc$add_view(dataset, Component$DESCRIPTION)
vc$layout(description)
diff --git a/man/CoordinationType.Rd b/man/CoordinationType.Rd
index 9619756..bc6716b 100644
--- a/man/CoordinationType.Rd
+++ b/man/CoordinationType.Rd
@@ -5,7 +5,7 @@
\alias{CoordinationType}
\title{Enumeration of Coordination Type values}
\format{
-An object of class \code{list} of length 34.
+An object of class \code{list} of length 35.
}
\usage{
CoordinationType
@@ -50,7 +50,7 @@ in the coordination space.
}
}
\examples{
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ref_dataset <- vc$add_dataset("Reference")
qry_dataset <- vc$add_dataset("Query")
ref_plot <- vc$add_view(ref_dataset, Component$SCATTERPLOT, mapping = "umap")
diff --git a/man/CsvWrapper.Rd b/man/CsvWrapper.Rd
new file mode 100644
index 0000000..d28c90f
--- /dev/null
+++ b/man/CsvWrapper.Rd
@@ -0,0 +1,208 @@
+% Generated by roxygen2: do not edit by hand
+% Please edit documentation in R/wrappers_csv.R
+\docType{class}
+\name{CsvWrapper}
+\alias{CsvWrapper}
+\title{CsvWrapper Class}
+\description{
+Class representing a CSV file in a Vitessce dataset.
+}
+\details{
+CSV file wrapper class
+}
+\keyword{internal}
+\section{Super class}{
+\code{\link[vitessceR:AbstractWrapper]{vitessceR::AbstractWrapper}} -> \code{CsvWrapper}
+}
+\section{Public fields}{
+\if{html}{\out{}}
+\describe{
+\item{\code{csv_path}}{The object to wrap.}
+
+\item{\code{csv_url}}{The object to wrap.}
+
+\item{\code{local_csv_uid}}{The path to the local zarr store.}
+
+\item{\code{data_type}}{The Vitessce data type for this file.}
+
+\item{\code{options}}{A list of options to pass to the Vitessce file definition.}
+
+\item{\code{coordination_values}}{A list of coordination values to pass to the Vitessce file definition.}
+
+\item{\code{request_init}}{A list of requestInit values to pass to fetch when loading the CSV over HTTP.}
+}
+\if{html}{\out{
}}
+}
+\section{Methods}{
+\subsection{Public methods}{
+\itemize{
+\item \href{#method-CsvWrapper-new}{\code{CsvWrapper$new()}}
+\item \href{#method-CsvWrapper-convert_and_save}{\code{CsvWrapper$convert_and_save()}}
+\item \href{#method-CsvWrapper-make_routes}{\code{CsvWrapper$make_routes()}}
+\item \href{#method-CsvWrapper-get_csv_url}{\code{CsvWrapper$get_csv_url()}}
+\item \href{#method-CsvWrapper-make_file_def_creator}{\code{CsvWrapper$make_file_def_creator()}}
+\item \href{#method-CsvWrapper-clone}{\code{CsvWrapper$clone()}}
+}
+}
+\if{html}{\out{
+Inherited methods
+
+
+}}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-CsvWrapper-new}{}}}
+\subsection{Method \code{new()}}{
+Create a wrapper around a CSV file.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{CsvWrapper$new(
+ csv_path = NA,
+ csv_url = NA,
+ data_type = NA,
+ options = NA,
+ coordination_values = NA,
+ request_init = NA,
+ ...
+)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{csv_path}}{The path to a local CSV file.}
+
+\item{\code{csv_url}}{The URL to a remote CSV file.}
+
+\item{\code{data_type}}{The Vitessce data type for this file.}
+
+\item{\code{options}}{A list of options to pass to the Vitessce file definition.}
+
+\item{\code{coordination_values}}{A list of coordination values to pass to the Vitessce file definition.}
+
+\item{\code{request_init}}{A list of requestInit values to pass to fetch when loading the CSV over HTTP.}
+
+\item{\code{...}}{Parameters inherited from \code{AbstractWrapper}.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A new \code{CsvWrapper} object.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-CsvWrapper-convert_and_save}{}}}
+\subsection{Method \code{convert_and_save()}}{
+Create the JSON output files, web server routes, and file definition creators.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{CsvWrapper$convert_and_save(dataset_uid, obj_i, base_dir = NA)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+
+\item{\code{base_dir}}{A base directory for local data.}
+}
+\if{html}{\out{
}}
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-CsvWrapper-make_routes}{}}}
+\subsection{Method \code{make_routes()}}{
+Get a list of server route objects.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{CsvWrapper$make_routes(dataset_uid, obj_i)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+}
+\if{html}{\out{
}}
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-CsvWrapper-get_csv_url}{}}}
+\subsection{Method \code{get_csv_url()}}{
+Get the URL to the Zarr store, to fill in the file URL in the file definitions.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{CsvWrapper$get_csv_url(base_url, dataset_uid, obj_i)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{base_url}}{The base URL, on which the route will be served.}
+
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A URL as a string.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-CsvWrapper-make_file_def_creator}{}}}
+\subsection{Method \code{make_file_def_creator()}}{
+Make the file definition creator function for the cells data type.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{CsvWrapper$make_file_def_creator(dataset_uid, obj_i)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{dataset_uid}}{The ID for this dataset.}
+
+\item{\code{obj_i}}{The index of this data object within the dataset.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A file definition creator function which takes a \code{base_url} parameter.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{}}
+\if{latex}{\out{\hypertarget{method-CsvWrapper-clone}{}}}
+\subsection{Method \code{clone()}}{
+The objects of this class are cloneable with this method.
+\subsection{Usage}{
+\if{html}{\out{}}\preformatted{CsvWrapper$clone(deep = FALSE)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{}}
+\describe{
+\item{\code{deep}}{Whether to make a deep clone.}
+}
+\if{html}{\out{
}}
+}
+}
+}
diff --git a/man/DataType.Rd b/man/DataType.Rd
index a5be5e9..0e94a6b 100644
--- a/man/DataType.Rd
+++ b/man/DataType.Rd
@@ -25,7 +25,7 @@ for dataset files.
}
\examples{
base_url <- "http://localhost:8000/"
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")$add_file(
url = paste0(base_url, "cells.json"),
data_type = DataType$CELLS,
diff --git a/man/FileType.Rd b/man/FileType.Rd
index c5810d3..1989981 100644
--- a/man/FileType.Rd
+++ b/man/FileType.Rd
@@ -26,10 +26,9 @@ for dataset files.
}
\examples{
base_url <- "http://localhost:8000/"
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")$add_file(
url = paste0(base_url, "cells.json"),
- data_type = DataType$CELLS,
file_type = FileType$CELLS_JSON
)
}
diff --git a/man/MultiImageWrapper.Rd b/man/MultiImageWrapper.Rd
index 64a65f0..c39b129 100644
--- a/man/MultiImageWrapper.Rd
+++ b/man/MultiImageWrapper.Rd
@@ -40,6 +40,8 @@ Image wrapper class
vitessceR::AbstractWrapper$get_file_defs()
vitessceR::AbstractWrapper$get_local_dir_route()
vitessceR::AbstractWrapper$get_local_dir_url()
+vitessceR::AbstractWrapper$get_local_file_route()
+vitessceR::AbstractWrapper$get_local_file_url()
vitessceR::AbstractWrapper$get_out_dir()
vitessceR::AbstractWrapper$get_out_dir_route()
vitessceR::AbstractWrapper$get_route_str()
diff --git a/man/OmeTiffWrapper.Rd b/man/OmeTiffWrapper.Rd
index 3a8bf3e..fbf71ce 100644
--- a/man/OmeTiffWrapper.Rd
+++ b/man/OmeTiffWrapper.Rd
@@ -52,6 +52,8 @@ this image (see http://www.opengl-tutorial.org/beginners-tutorials/tutorial-3-ma
vitessceR::AbstractWrapper$get_file_defs()
vitessceR::AbstractWrapper$get_local_dir_route()
vitessceR::AbstractWrapper$get_local_dir_url()
+vitessceR::AbstractWrapper$get_local_file_route()
+vitessceR::AbstractWrapper$get_local_file_url()
vitessceR::AbstractWrapper$get_out_dir()
vitessceR::AbstractWrapper$get_out_dir_route()
vitessceR::AbstractWrapper$get_route_str()
diff --git a/man/VitessceConfig.Rd b/man/VitessceConfig.Rd
index 6642e5c..9dbcaf0 100644
--- a/man/VitessceConfig.Rd
+++ b/man/VitessceConfig.Rd
@@ -16,14 +16,14 @@ VitessceConfig
## Method `VitessceConfig$add_dataset`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
## ------------------------------------------------
## Method `VitessceConfig$add_view`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, "spatial")
@@ -31,7 +31,7 @@ spatial <- vc$add_view(ds, "spatial")
## Method `VitessceConfig$add_coordination`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, "spatial")
c_scopes <- vc$add_coordination(c("spatialZoom", "spatialTargetX"))
@@ -41,7 +41,7 @@ spatial$use_coordination(c_scopes)
## Method `VitessceConfig$layout`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, "spatial")
scatterplot <- vc$add_view(ds, "scatterplot")
@@ -50,7 +50,7 @@ scatterplot <- vc$add_view(ds, "scatterplot")
## Method `VitessceConfig$link_views`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ref_dataset <- vc$add_dataset("Reference")
qry_dataset <- vc$add_dataset("Query")
ref_plot <- vc$add_view(ref_dataset, Component$SCATTERPLOT, mapping = "umap")
@@ -65,7 +65,7 @@ vc$link_views(
## Method `VitessceConfig$to_list`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
vc_list <- vc$to_list(base_url = "http://localhost:8000")
@@ -73,7 +73,7 @@ vc_list <- vc$to_list(base_url = "http://localhost:8000")
## Method `VitessceConfig$widget`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")
description <- vc$add_view(dataset, Component$DESCRIPTION)
vc$layout(description)
@@ -83,7 +83,7 @@ vc$widget()
## Method `VitessceConfig$export`
## ------------------------------------------------
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")
description <- vc$add_view(dataset, Component$DESCRIPTION)
vc$layout(description)
@@ -129,6 +129,8 @@ Create a new config object.
\subsection{Arguments}{
\if{html}{\out{}}
\describe{
+\item{\code{schema_version}}{The Vitessce config schema version to use.}
+
\item{\code{name}}{A name for the config.}
\item{\code{description}}{A description for the config.}
@@ -162,7 +164,7 @@ A new \code{VitessceConfigDataset} object.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
}
\if{html}{\out{
}}
@@ -211,7 +213,7 @@ A new \code{VitessceConfigView} object.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, "spatial")
}
@@ -241,7 +243,7 @@ A list of new \code{VitessceConfigCoordinationScope} objects.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, "spatial")
c_scopes <- vc$add_coordination(c("spatialZoom", "spatialTargetX"))
@@ -300,7 +302,7 @@ Self, to allow chaining.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, "spatial")
scatterplot <- vc$add_view(ds, "scatterplot")
@@ -341,7 +343,7 @@ Self, to allow chaining.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ref_dataset <- vc$add_dataset("Reference")
qry_dataset <- vc$add_dataset("Query")
ref_plot <- vc$add_view(ref_dataset, Component$SCATTERPLOT, mapping = "umap")
@@ -378,7 +380,7 @@ A \code{list} that can be serialized to JSON.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
vc_list <- vc$to_list(base_url = "http://localhost:8000")
}
@@ -437,7 +439,7 @@ The Vitessce htmlwidget.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")
description <- vc$add_view(dataset, Component$DESCRIPTION)
vc$layout(description)
@@ -475,7 +477,7 @@ The Vitessce configuration as a list, with the \code{base_url} filled in.
}
\subsection{Examples}{
\if{html}{\out{
}}
-\preformatted{vc <- VitessceConfig$new("My config")
+\preformatted{vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")
description <- vc$add_view(dataset, Component$DESCRIPTION)
vc$layout(description)
diff --git a/man/VitessceConfigCoordinationScope.Rd b/man/VitessceConfigCoordinationScope.Rd
index 00def26..cb7d30a 100644
--- a/man/VitessceConfigCoordinationScope.Rd
+++ b/man/VitessceConfigCoordinationScope.Rd
@@ -45,6 +45,8 @@ Create a new coordination scope object.
\item{\code{c_type}}{A coordination type name.}
\item{\code{c_scope}}{A coordination scope name.}
+
+\item{\code{c_value}}{An initial value for the coordination scope.}
}
\if{html}{\out{
}}
}
diff --git a/man/VitessceConfigDataset.Rd b/man/VitessceConfigDataset.Rd
index 884a4d0..5a44219 100644
--- a/man/VitessceConfigDataset.Rd
+++ b/man/VitessceConfigDataset.Rd
@@ -17,7 +17,7 @@ Dataset in a VitessceConfig
## ------------------------------------------------
base_url <- "http://localhost:8000/"
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")$add_file(
url = paste0(base_url, "cells.json"),
data_type = DataType$CELLS,
@@ -61,6 +61,8 @@ Create a new dataset object.
\item{\code{uid}}{A unique identifier string for the dataset.}
\item{\code{name}}{A name for the dataset}
+
+\item{\code{base_dir}}{A directory which local files are configured relative to.}
}
\if{html}{\out{
}}
}
@@ -72,19 +74,27 @@ A new \code{VitessceConfigDataset} object.
\if{html}{\out{
}}
\if{latex}{\out{\hypertarget{method-VitessceConfigDataset-get_name}{}}}
\subsection{Method \code{get_name()}}{
+Get the dataset name.
\subsection{Usage}{
\if{html}{\out{
}}\preformatted{VitessceConfigDataset$get_name()}\if{html}{\out{
}}
}
+\subsection{Returns}{
+The name as a string.
+}
}
\if{html}{\out{
}}
\if{html}{\out{
}}
\if{latex}{\out{\hypertarget{method-VitessceConfigDataset-get_uid}{}}}
\subsection{Method \code{get_uid()}}{
+Get the dataset UID.
\subsection{Usage}{
\if{html}{\out{
}}\preformatted{VitessceConfigDataset$get_uid()}\if{html}{\out{
}}
}
+\subsection{Returns}{
+The uid as a string.
+}
}
\if{html}{\out{
}}
\if{html}{\out{
}}
@@ -120,7 +130,7 @@ Invisible self, to allow chaining.
\subsection{Examples}{
\if{html}{\out{
}}
\preformatted{base_url <- "http://localhost:8000/"
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")$add_file(
url = paste0(base_url, "cells.json"),
data_type = DataType$CELLS,
diff --git a/man/VitessceConfigDatasetFile.Rd b/man/VitessceConfigDatasetFile.Rd
index ab42ed0..7c28c50 100644
--- a/man/VitessceConfigDatasetFile.Rd
+++ b/man/VitessceConfigDatasetFile.Rd
@@ -42,6 +42,8 @@ Create a new dataset file object.
\item{\code{options}}{A list of options to include for the file.}
+\item{\code{coordination_values}}{A list of coordination values to include in the file definition.}
+
\item{\code{data_type}}{A data type for the file.}
}
\if{html}{\out{
}}
diff --git a/man/VitessceConfigServerRangeRoute.Rd b/man/VitessceConfigServerRangeRoute.Rd
index 1a68d77..b023a08 100644
--- a/man/VitessceConfigServerRangeRoute.Rd
+++ b/man/VitessceConfigServerRangeRoute.Rd
@@ -1,11 +1,16 @@
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/server.R
-\name{VitessceConfigServerRangeRoute}
+\name{VitessceConfigServerFileRoute}
+\alias{VitessceConfigServerFileRoute}
\alias{VitessceConfigServerRangeRoute}
\title{Class representing a local web server route for a file which needs to support range requests.}
\description{
Class representing a local web server route for a file which needs to support range requests.
+Class representing a local web server route for a file which needs to support range requests.
+
+Class representing a local web server route for a file which needs to support range requests.
+
Class representing a local web server route for a file which needs to support range requests.
}
\keyword{internal}
@@ -14,6 +19,83 @@ Class representing a local web server route for a file which needs to support ra
\describe{
\item{\code{path}}{The path on which the web server should respond to requests using this callback.}
+\item{\code{file_path}}{The file to serve.}
+}
+\if{html}{\out{
}}
+}
+\section{Methods}{
+\subsection{Public methods}{
+\itemize{
+\item \href{#method-VitessceConfigServerFileRoute-new}{\code{VitessceConfigServerFileRoute$new()}}
+\item \href{#method-VitessceConfigServerFileRoute-create_handlers}{\code{VitessceConfigServerFileRoute$create_handlers()}}
+\item \href{#method-VitessceConfigServerFileRoute-clone}{\code{VitessceConfigServerFileRoute$clone()}}
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{
}}
+\if{latex}{\out{\hypertarget{method-VitessceConfigServerFileRoute-new}{}}}
+\subsection{Method \code{new()}}{
+Create a new server route wrapper object.
+\subsection{Usage}{
+\if{html}{\out{
}}\preformatted{VitessceConfigServerFileRoute$new(path, file_path)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{
}}
+\describe{
+\item{\code{path}}{The route path.}
+
+\item{\code{file_path}}{The file to serve on this route.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+A new \code{VitessceConfigServerRangeRoute} object.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{
}}
+\if{latex}{\out{\hypertarget{method-VitessceConfigServerFileRoute-create_handlers}{}}}
+\subsection{Method \code{create_handlers()}}{
+Add handler functions to the Plumber server object to respond on this route.
+\subsection{Usage}{
+\if{html}{\out{
}}\preformatted{VitessceConfigServerFileRoute$create_handlers(pr_server)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{
}}
+\describe{
+\item{\code{pr_server}}{The server instance.}
+}
+\if{html}{\out{
}}
+}
+\subsection{Returns}{
+The modified server instance.
+}
+}
+\if{html}{\out{
}}
+\if{html}{\out{
}}
+\if{latex}{\out{\hypertarget{method-VitessceConfigServerFileRoute-clone}{}}}
+\subsection{Method \code{clone()}}{
+The objects of this class are cloneable with this method.
+\subsection{Usage}{
+\if{html}{\out{
}}\preformatted{VitessceConfigServerFileRoute$clone(deep = FALSE)}\if{html}{\out{
}}
+}
+
+\subsection{Arguments}{
+\if{html}{\out{
}}
+\describe{
+\item{\code{deep}}{Whether to make a deep clone.}
+}
+\if{html}{\out{
}}
+}
+}
+}
+\section{Public fields}{
+\if{html}{\out{
}}
+\describe{
+\item{\code{path}}{The path on which the web server should respond to requests using this callback.}
+
\item{\code{file_path}}{The file to serve.}
}
\if{html}{\out{
}}
diff --git a/man/export_to_files.Rd b/man/export_to_files.Rd
index 2f157fb..99adbfa 100644
--- a/man/export_to_files.Rd
+++ b/man/export_to_files.Rd
@@ -23,7 +23,7 @@ A helper function to export files associated with a particular Vitessce configur
We do not recommend calling this function directly. Instead, use the \code{export()} function on a \code{VitessceConfig} instance.
}
\examples{
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
dataset <- vc$add_dataset("My dataset")
description <- vc$add_view(dataset, Component$DESCRIPTION)
vc$layout(description)
diff --git a/man/hconcat.Rd b/man/hconcat.Rd
index b3011e8..e1e3ede 100644
--- a/man/hconcat.Rd
+++ b/man/hconcat.Rd
@@ -16,10 +16,10 @@ A \code{VitessceConfigViewHConcat} object.
A helper function to construct a new \code{VitessceConfigViewHConcat} object based on multiple views.
}
\examples{
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, Component$SPATIAL)
-gene_list <- vc$add_view(ds, Component$GENES)
+gene_list <- vc$add_view(ds, Component$FEATURE_LIST)
vc$layout(hconcat(spatial, gene_list))
vc$widget()
}
diff --git a/man/vconcat.Rd b/man/vconcat.Rd
index fede6f8..609438c 100644
--- a/man/vconcat.Rd
+++ b/man/vconcat.Rd
@@ -16,10 +16,10 @@ A \code{VitessceConfigViewVConcat} object.
A helper function to construct a new \code{VitessceConfigViewVConcat} object based on multiple views.
}
\examples{
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
ds <- vc$add_dataset("My dataset")
spatial <- vc$add_view(ds, Component$SPATIAL)
-gene_list <- vc$add_view(ds, Component$GENES)
+gene_list <- vc$add_view(ds, Component$FEATURE_LIST)
vc$layout(vconcat(spatial, gene_list))
vc$widget()
}
diff --git a/man/vitessce_widget.Rd b/man/vitessce_widget.Rd
index 7a61965..0ec9ac0 100644
--- a/man/vitessce_widget.Rd
+++ b/man/vitessce_widget.Rd
@@ -49,6 +49,6 @@ recommend calling the \code{widget()} method on the \code{VitessceConfig}
instance.
}
\examples{
-vc <- VitessceConfig$new("My config")
+vc <- VitessceConfig$new(schema_version = "1.0.16", name = "My config")
vc$widget()
}
diff --git a/vignettes/shiny.Rmd b/vignettes/shiny.Rmd
index 3b3bbc9..f536662 100644
--- a/vignettes/shiny.Rmd
+++ b/vignettes/shiny.Rmd
@@ -14,6 +14,7 @@ First, install the dependencies:
install.packages("shiny")
install.packages("devtools")
devtools::install_github("satijalab/seurat-data")
+devtools::install_github("vitessce/vitessceAnalysisR")
```
Next, create an output element in the UI with `vitessce_output` and a corresponding server response with `render_vitessce`.
@@ -23,17 +24,21 @@ The value for the `output_id` parameter in the `vitessce_output` function should
```r
library(shiny)
library(vitessceR)
+library(vitessceAnalysisR)
library(SeuratData)
SeuratData::InstallData("pbmc3k")
data("pbmc3k.final")
force(pbmc3k.final)
-w <- SeuratWrapper$new(
- pbmc3k.final,
- cell_embeddings = c("pca", "umap"),
- cell_embedding_names = c("PCA", "UMAP"),
- cell_set_metas = c("seurat_annotations", "seurat_clusters")
+adata_path <- file.path("data", "seurat", "pbmc3k.final.h5ad.zarr")
+vitessceAnalysisR::seurat_to_anndata_zarr(pbmc3k.final, adata_path)
+
+w <- AnnDataWrapper$new(
+ adata_path=adata_path,
+ obs_embedding_paths = c("obsm/X_pca", "obsm/X_umap"),
+ obs_embedding_names = c("PCA", "UMAP"),
+ obs_set_paths = c("obs/seurat_annotations", "obs/seurat_clusters")
)
ui <- fluidPage(
@@ -48,7 +53,7 @@ server <- function(input, output, session) {
dataset <- dataset$add_object(w)
scatterplot <- vc$add_view(dataset, Component$SCATTERPLOT, mapping = "PCA")
vc$layout(scatterplot)
- vc$widget()
+ vc$widget(theme="light")
})
}