Package 'SpaMTPData'

Title: Experiment Data Resources for SpaMTP Workflows
Description: Provides lightweight, version-aware access to spatial metabolomics and multi-omics experiment data used in SpaMTP workflows. Resources cover mouse brain, mouse urinary bladder, simulated single-cell multi-omics, annotation-refinement, and human brain examples. Large files are retrieved through ExperimentHub or verified source-URL caches rather than stored in the package repository. A small deterministic synthetic SpatialExperiment with a paired transcriptome supports offline examples and interoperability tests. Native SpatialExperiment datasets are available in a separate resource release; historical archival objects retain their original representations. Conversion and analysis are handled by the SpaMTP software package. Native experimental files share a Zenodo version family with SpaMTPdb without coupling the packages at runtime.
Authors: Tianyao Lu [aut, cre], Andrew Causer [aut], Quan Nguyen [aut]
Maintainer: Tianyao Lu <[email protected]>
License: MIT + file LICENSE
Version: 0.99.5
Built: 2026-11-09 09:32:33 UTC
Source: https://github.com/bioc/SpaMTPData

Help Index


Retrieve a SpaMTP experiment resource

Description

Returns the representation actually stored in the published file; no implicit conversion is performed. Release ⁠1.1.0⁠, selected by default, supplies seven native SpatialExperiment datasets. Use version = "1.0.0" to request a historical release explicitly. Registry entries with requires_conversion = TRUE are historical Seurat objects. Convert these explicitly at the SpaMTP workflow boundary, or use spaMTPExampleData() for a small native example that needs neither Seurat nor network access. Local files and a verified download cache are checked before any Hub query. Existing immutable files retain their original classes and checksums. Loaded native experiments additionally carry metadata(x)$SpaMTPData with registry provenance and species, enabling analysis packages to check annotation compatibility. Assays, row names and coordinates are preserved. Provenance is also carried by nested altExp() experiments so that species checks survive extracting a paired transcriptome. Explicit species metadata already declared by a child experiment is retained rather than relabelled.

Usage

spaMTPData(
  resource,
  version = "latest",
  local_dir = NULL,
  hub = NULL,
  metadata = FALSE,
  offline = FALSE,
  fallback_url = TRUE,
  cache_dir = NULL,
  timeout = 1800,
  retries = 3L,
  verify = TRUE
)

Arguments

resource

Resource name; see spaMTPDataResources().

version

Data release version or "latest".

local_dir

Optional directory containing downloaded source files.

hub

Optional pre-created ExperimentHub object.

metadata

Return only the registry row.

offline

If TRUE, use local files or a verified cache only; never query ExperimentHub or the source URL.

fallback_url

If TRUE, use the immutable source URL when the resource has not yet been ingested into ExperimentHub.

cache_dir

Cache directory for source-URL downloads. Defaults to the platform-specific user cache returned by tools::R_user_dir().

timeout

Download timeout in seconds for the source-URL fallback.

retries

Number of verified download attempts.

verify

Verify local files against the published size and checksum. Set to FALSE only for intentional development fixtures. Downloaded and cached files are always verified; loaded object classes are always checked.

Value

The requested experiment object or local file path. With metadata = TRUE, returns one registry row.

Examples

spaMTPData("mouse_brain_dhb_striatum", metadata = TRUE)

Alias for explicit SpaMTPData resource retrieval

Description

Alias for explicit SpaMTPData resource retrieval

Usage

spaMTPDataResource(
  resource,
  version = "latest",
  local_dir = NULL,
  hub = NULL,
  metadata = FALSE,
  offline = FALSE,
  fallback_url = TRUE,
  cache_dir = NULL,
  timeout = 1800,
  retries = 3L,
  verify = TRUE
)

Arguments

resource

Resource name; see spaMTPDataResources().

version

Data release version or "latest".

local_dir

Optional directory containing downloaded source files.

hub

Optional pre-created ExperimentHub object.

metadata

Return only the registry row.

offline

If TRUE, use local files or a verified cache only; never query ExperimentHub or the source URL.

fallback_url

If TRUE, use the immutable source URL when the resource has not yet been ingested into ExperimentHub.

cache_dir

Cache directory for source-URL downloads. Defaults to the platform-specific user cache returned by tools::R_user_dir().

timeout

Download timeout in seconds for the source-URL fallback.

retries

Number of verified download attempts.

verify

Verify local files against the published size and checksum. Set to FALSE only for intentional development fixtures. Downloaded and cached files are always verified; loaded object classes are always checked.

Value

The value returned by spaMTPData().

Examples

spaMTPDataResource("mouse_brain_dhb_striatum", metadata = TRUE)

List SpaMTP experiment resources

Description

List SpaMTP experiment resources

Usage

spaMTPDataResources(version = NULL, category = NULL)

Arguments

version

Data release version. NULL returns all versions.

category

Optional resource category.

Value

A data frame describing the registered resources.

Examples

spaMTPDataResources()

Report the available SpaMTPData releases

Description

Report the available SpaMTPData releases

Usage

spaMTPDataVersion()

Value

A character vector of data releases, newest first.

Examples

spaMTPDataVersion()

Construct a small native spatial multi-omics example

Description

A deterministic, synthetic example for tutorials and interoperability tests. This is not a biological dataset or a downloaded ExperimentHub resource. The primary experiment contains six m/z features measured at twelve pixels; an optional paired transcriptome has five genes at the same pixels. All data use existing Bioconductor containers and public accessors. Neither SpaMTP nor Seurat is required to construct or inspect the example.

Usage

spaMTPExampleData(paired = TRUE)

Arguments

paired

Include a transcriptome in altExp(x, "transcriptome").

Value

A SpatialExperiment with intensities in assay(x, "counts"), m/z values in rowData(x), regions in colData(x), pixel x/y coordinates in spatialCoords(x) and synthetic-data provenance in metadata(x).

Examples

spe <- spaMTPExampleData()
SummarizedExperiment::assayNames(spe)
SummarizedExperiment::rowData(spe)$mz
SpatialExperiment::spatialCoords(spe)
SingleCellExperiment::altExpNames(spe)