Package 'alabaster.mae'

Title: Load and Save MultiAssayExperiments
Description: Save MultiAssayExperiments into file artifacts, and load them back into memory. This is a more portable alternative to serialization of such objects into RDS files. Each artifact is associated with metadata for further interpretation; downstream applications can enrich this metadata with context-specific properties.
Authors: Aaron Lun [aut, cre]
Maintainer: Aaron Lun <[email protected]>
License: MIT + file LICENSE
Version: 1.5.0
Built: 2024-07-20 05:26:43 UTC
Source: https://github.com/bioc/alabaster.mae

Help Index


Read a MultiAssayExperiment from disk

Description

Read a MultiAssayExperiment from its on-disk representation. This is usually not directly called by users, but is instead called by dispatch in readObject.

Usage

readMultiAssayExperiment(path, metadata, ...)

Arguments

path

String containing a path to a directory, itself created using the stageObject method for MultiAssayExperiment objects.

metadata

Named list of metadata for this object, see readObjectFile for details.

...

Further arguments passed to internal altReadObject calls.

Value

A MultiAssayExperiment object.

Author(s)

Aaron Lun

Examples

library(SummarizedExperiment)

# Mocking up an MAE
mat <- matrix(rnorm(1000), ncol=10)
colnames(mat) <- letters[1:10]
rownames(mat) <- sprintf("GENE_%i", seq_len(nrow(mat)))
se <- SummarizedExperiment(list(counts=mat))

library(MultiAssayExperiment)
mae <- MultiAssayExperiment(list(gene=se))

# Staging it:
tmp <- tempfile()
dir.create(tmp)
info <- stageObject(mae, tmp, "dataset")

# Loading it back in:
loadMultiAssayExperiment(info, tmp)

Save a MultiAssayExperiment

Description

Save a MultiAssayExperiment to its on-disk representation.

Usage

## S4 method for signature 'MultiAssayExperiment'
saveObject(x, path, ...)

Arguments

x

A MultiAssayExperiment object or one of its subclasses.

path

String containing the path to a directory in which to save x.

...

Further arguments to pass to specific methods.

Value

The contents of x are saved into a path, and NULL is invisibly returned.

Author(s)

Aaron Lun

Examples

# Mocking up an MAE
mat <- matrix(rnorm(1000), ncol=10)
colnames(mat) <- letters[1:10]
rownames(mat) <- sprintf("GENE_%i", seq_len(nrow(mat)))

library(SummarizedExperiment)
se <- SummarizedExperiment(list(counts=mat))

library(MultiAssayExperiment)
mae <- MultiAssayExperiment(list(gene=se))

# Saving it:
tmp <- tempfile()
saveObject(mae, tmp)