Package 'SpaMTPdb'

Title: Versioned Annotation Resources for SpaMTP
Description: Provides lightweight, version-aware access to the annotation resources used by SpaMTP. Resources include pruned RaMP chemical, identifier, pathway, and pathway-topology tables, precomputed SMILES functional-group and ionisation features, and legacy metabolite reference tables, plus a separately versioned human gene identifier reference from fixed HGNC archives. RaMP resource files are hosted on Zenodo and described by AnnotationHub metadata rather than bundled in the package. Retrieved files are verified against recorded sizes and checksums and cached for reuse, and a local resource directory can be used for development and reproducible database builds. Maintainer recipes coordinate a shared Zenodo resource collection with SpaMTPData while preserving separate annotation and experiment registries and independent resource versions.
Authors: Tianyao Lu [aut, cre], Andrew Causer [aut], Quan Nguyen [aut]
Maintainer: Tianyao Lu <[email protected]>
License: MIT + file LICENSE
Version: 0.99.4
Built: 2026-09-24 05:10:29 UTC
Source: https://github.com/BiocStaging/SpaMTPdb

Help Index


Retrieve a coherent set of SpaMTP annotation resources

Description

Retrieve a coherent set of SpaMTP annotation resources

Usage

spaMTPdbBundle(resources = NULL, version = "latest", ...)

Arguments

resources

Character vector of resource names. By default, all core resources used by SpaMTP are returned.

version

Resource version or "latest".

...

Passed to spaMTPdbResource().

Value

A named list of resources from one database version.

Examples

spaMTPdbBundle(resources = "chem_props", metadata = TRUE)

Retrieve a versioned human gene identifier reference

Description

Retrieves a fixed HGNC quarterly archive, independently of the RaMP resource version. The archive contains approved symbols, previous and alias symbols, HGNC, Entrez, Ensembl and UniProt identifiers. It is an annotation resource; experiment data continue to be supplied by SpaMTPData.

Usage

spaMTPdbGeneReference(
  version = "latest",
  local_dir = NULL,
  metadata = FALSE,
  offline = FALSE,
  cache_dir = NULL,
  timeout = 1800,
  retries = 3L
)

Arguments

version

HGNC archive version or "latest", resolved only against the gene reference registry, independently of spaMTPdbVersion().

local_dir

Directory containing the archived TSV, optionally under a version subdirectory. Defaults to SpaMTPdb.gene_reference_dir or the SPAMTPDB_GENE_REFERENCE_DIR environment variable.

metadata

Return the version registry row without reading/downloading.

offline

Use local files or a verified cache only.

cache_dir

Download cache root; see spaMTPdbResource().

timeout

Download timeout in seconds.

retries

Number of verified download attempts.

Details

Files are resolved from a local directory, verified cache, then the official HGNC archive URL. Size and MD5 are checked before parsing. No live symbol queries or changing HGNC "current" downloads are used. The large reference file is not included in the installed package. This reference covers human genes and does not implement orthology mapping.

Value

A data frame with an attribute spamtp_gene_reference recording the HGNC version, organism, source URL and checksum; or a metadata row.

Examples

spaMTPdbGeneReference(metadata = TRUE)

Retrieve one SpaMTP annotation resource

Description

Resources are resolved in order: a staged local directory (local_dir, the SpaMTPdb.resource_dir option, or the SPAMTPDB_RESOURCE_DIR environment variable), a verified download cache, then the matching AnnotationHub record, and finally the immutable Zenodo source URL recorded in the resource manifest. Files retrieved from Zenodo and local files are verified against the recorded size and MD5 checksum. The verified download cache is usable with offline = TRUE.

Usage

spaMTPdbResource(
  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 spaMTPdbResources().

version

Resource version or "latest".

local_dir

Optional directory containing staged .rds resources.

hub

Optional pre-created AnnotationHub object.

metadata

Return the registry row without loading the resource.

offline

If TRUE, use local files or a verified cache only; never query AnnotationHub or Zenodo.

fallback_url

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

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 R object, or its registry row when metadata = TRUE.

Examples

spaMTPdbResource("chem_props", metadata = TRUE)

List SpaMTPdb resources

Description

List SpaMTPdb resources

Usage

spaMTPdbResources(version = NULL, category = NULL, default_only = FALSE)

Arguments

version

RaMP/SpaMTPdb resource version. NULL selects all versions.

category

Optional resource category.

default_only

Return only resources used by the default SpaMTP annotation and pathway pipelines.

Value

A data frame describing available resources.

Examples

spaMTPdbResources(default_only = TRUE)

Report the available SpaMTPdb versions

Description

Report the available SpaMTPdb versions

Usage

spaMTPdbVersion()

Value

A character vector of resource versions, newest first.

Examples

spaMTPdbVersion()