saveVariantExperiment: saveVariantExperiment Save all the assays in GDS format,...

View source: R/saveVariantExperiment.R

saveVariantExperimentR Documentation

saveVariantExperiment Save all the assays in GDS format, including in-memory assays. Delayed assays with delayed operations on them are realized while they are written to disk.

Description

saveVariantExperiment Save all the assays in GDS format, including in-memory assays. Delayed assays with delayed operations on them are realized while they are written to disk.

Usage

saveVariantExperiment(
  ve,
  dir = tempdir(),
  replace = FALSE,
  fileFormat = NULL,
  compress = "LZMA_RA",
  chunk_size = 1000,
  rowDataOnDisk = TRUE,
  colDataOnDisk = TRUE,
  verbose = FALSE
)

Arguments

ve

A SummarizedExperiment object, with the array data being ordinary array structure.

dir

The directory to save the gds format of the array data, and the newly generated SummarizedExperiment object with array data in GDSArray format. The default is temporary directory within the R session.

replace

Whether to replace the directory if it already exists. The default is FALSE.

fileFormat

File format for the output gds file. See details.

compress

the compression method for writing the gds file. The default is "LZMA_RA".

chunk_size

The chunk size (number of columns) when reading GDSArray-based assays from input ve into memory and then write into a new gds file. Default is 1000. Can be modified to smaller value if chunk data is too big (e.g., when number of rows are large).

rowDataOnDisk

whether to save the rowData as DelayedArray object. The default is TRUE.

colDataOnDisk

whether to save the colData as DelayedArray object. The default is TRUE.

verbose

whether to print the process messages. The default is FALSE.

Details

If the input SummarizedExperiment object has GDSArray-based assay data, there is no need to specify the argument fileFomat. Otherwise, it takes values of SEQ_ARRAY for sequencing data or SNP_ARRAY SNP array data.

Value

An VariantExperiment object with the new gdsfile() ve.gds as specified in dir argument.

Examples

gds <- SeqArray::seqExampleFileName("gds")
ve <- makeVariantExperimentFromGDS(gds)
gdsfile(ve)
ve1 <- subsetByOverlaps(ve, GRanges("22:1-48958933"))
ve1
gdsfile(ve1)
aa <- tempfile()
obj <- saveVariantExperiment(ve1, dir=aa, replace=TRUE)
obj
gdsfile(obj)

Bioconductor/VariantExperiment documentation built on Nov. 3, 2024, 8:11 a.m.