saveDataset: Save a dataset to disk

View source: R/saveDataset.R

saveDatasetR Documentation

Save a dataset to disk

Description

Save a single-cell dataset to disk, usually in preparation for upload.

Usage

saveDataset(x, path, metadata)

Arguments

x

A SummarizedExperiment or one of its subclasses.

path

String containing the path to a new directory in which to save x. Any existing directory is removed before saving x.

metadata

Named list containing metadata for this dataset, see the schema returned by fetchMetadataSchema(). Note that the applications.takane property will be automatically added by this function and does not have to be supplied.

Value

x and its metadata are saved into path, and NULL is invisibly returned.

Author(s)

Aaron Lun

See Also

https://github.com/ArtifactDB/bioconductor-metadata-index, on the expected schema for the metadata.

polishDataset, to polish x before saving it.

uploadDirectory, to upload the saved contents.

Examples

library(SingleCellExperiment)
sce <- SingleCellExperiment(list(counts=matrix(rpois(1000, lambda=1), 100, 10)))
rownames(sce) <- sprintf("GENE_%i", seq_len(nrow(sce)))
colnames(sce) <- head(LETTERS, 10)

meta <- list(
    title="My dataset",
    description="This is my dataset",
    taxonomy_id="10090",
    genome="GRCh38",
    sources=list(list(provider="GEO", id="GSE12345")),
    maintainer_name="Shizuka Mogami",
    maintainer_email="mogami.shizuka@765pro.com"
)

tmp <- tempfile()
saveDataset(sce, tmp, meta)
list.files(tmp, recursive=TRUE)
alabaster.base::readObject(tmp)


LTLA/scRNAseq documentation built on April 24, 2024, 5:58 p.m.