read_data: Read data

View source: R/read_data.R

read_dataR Documentation

Read data

Description

Automatically infer the format of a single-cell dataset on disk and infer how to read it into R.

Usage

read_data(
  path,
  filetype = "guess",
  custom_reader = NULL,
  as_sparse = TRUE,
  verbose = TRUE,
  ...
)

Arguments

path

Path to saved single-cell data file, or a directory containing the data files. If path is already an R object, it will be returned directly.

filetype

The type of file trying to be read in, made explicit by the user. "guess" (default) will simply infer the most likely file type.

custom_reader

A user-supplied function to read in the data with.

as_sparse

Convert to a sparseMatrix.

verbose

Print messages.

...

Additional argument passed to the filetype-specific reader functions.

Value

An single-cell data object. The object class that the data gets imported as depends on file type.

Examples

library(Seurat)
obj <- example_obj("loom")
obj2 <- read_data(obj$filename)

bschilder/scKirby documentation built on Oct. 2, 2024, 10:16 p.m.