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

Description Usage Arguments Details Value Examples

View source: R/saveVariantExperiment.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
saveVariantExperiment(
  ve,
  dir = tempdir(),
  replace = FALSE,
  fileFormat = NULL,
  compress = "LZMA_RA",
  chunk_size = 10000,
  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 rows) when reading GDSArray-based assays from input ve into memory and then write into a new gds file.

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

VariantExperiment documentation built on April 10, 2021, 6 p.m.