xread: Read an R Object Using 'qs' Package for Fast Decompression

View source: R/Seurat.Utils.R

xreadR Documentation

Read an R Object Using 'qs' Package for Fast Decompression

Description

This function reads an R object from a file saved in a format specific to the 'qs' package, which is designed for quick and efficient compression and decompression of R objects. It also times the read operation, providing feedback on the duration of the operation.

Usage

xread(
  file,
  nthreads = if (file.size(file) < 1e+07) 1 else 4,
  loadParamsAndAllGenes = TRUE,
  overwriteParams = FALSE,
  overwriteAllGenes = FALSE,
  set_m = TRUE,
  ...
)

Arguments

file

A character string specifying the path to the file where the R object is saved.

nthreads

The number of threads to use when reading the object, defaults to 4.

loadParamsAndAllGenes

Logical; if TRUE and if the object is a Seurat object, additional parameters are loaded from within it.

overwriteParams

Logical; if TRUE and if the object is a Seurat object, the parameters are overwritten.

overwriteAllGenes

Logical; if TRUE and if the object is a Seurat object, the all genes are overwritten.

set_m

Logical; if TRUE, the variable 'm', a list of @meta.data colnames, is assigned to the global environment.

...

Further arguments passed on to the 'qs::qread' function.

Value

The R object that was saved in the specified file.

Note

The function uses the 'qs' package for fast and efficient deserialization of objects and includes a timing feature from the 'tictoc' package.

See Also

qread for the underlying read function used.


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.