TENxFile: TENxFile constructor function

View source: R/TENxFile-class.R

TENxFileR Documentation

TENxFile constructor function

Description

The TENxFile constructor function serves as the auto-recognizer function for 10X files. It can import several different file extensions, namely:

    * H5 - on-disk HDF5
    * MTX - matrix market
    * .tar.gz - compressed tarball

Usage

TENxFile(resource, extension, ...)

Arguments

resource

character(1) The path to the file

extension

character(1) The file extension for the given resource. It can usually be obtained from the file path. An override can be provided especially for ExperimentHub resources where the file extension is removed.

...

Additional inputs to the low level class generator functions

Details

Note that the example below includes the use of a large ~ 4 GB ExperimentHub resource obtained from the 10X website.

Value

A subclass of TENxFile according to the input file extension

Examples

if (interactive()) {

    ## from ExperimentHub
    hub <- ExperimentHub::ExperimentHub()
    fname <- hub[["EH1039"]]
    TENxFile(fname, extension = "h5", group = "mm10", version = "2")
    TENxFile(fname, extension = "h5", group = "mm10", version = "2") |>
        metadata()

}

LiNk-NY/TENxIO documentation built on Nov. 16, 2024, 7:10 p.m.