Package 'eds'

Title: eds: Low-level reader for Alevin EDS format
Description: This packages provides a single function, readEDS. This is a low-level utility for reading in Alevin EDS format into R. This function is not designed for end-users but instead the package is predominantly for simplifying package dependency graph for other Bioconductor packages.
Authors: Avi Srivastava [aut, cre], Michael Love [aut, ctb]
Maintainer: Avi Srivastava <[email protected]>
License: GPL-2
Version: 1.7.0
Built: 2024-07-13 05:19:06 UTC
Source: https://github.com/bioc/eds

Help Index


A low-level utility function for quickly reading in Alevin EDS format

Description

This provides a simple utility for reading in EDS format. Note that most users will prefer to use tximport or tximeta. This function and package exist in order to simplify the dependency graph for other packages.

Usage

readEDS(numOfGenes, numOfOriginalCells, countMatFilename, tierImport = FALSE)

Arguments

numOfGenes

number of genes

numOfOriginalCells

number of cells

countMatFilename

pointer to the EDS file, quants_mat.gz

tierImport

whether the countMatFilename refers to a quants tier file

Value

a genes x cells sparse matrix, of the class dgCMatrix

Examples

# point to files
dir0 <- system.file("extdata",package="tximportData")
samps <- list.files(file.path(dir0, "alevin"))
dir <- file.path(dir0,"alevin",samps[3],"alevin")
quant.mat.file <- file.path(dir, "quants_mat.gz")
barcode.file <- file.path(dir, "quants_mat_rows.txt")
gene.file <- file.path(dir, "quants_mat_cols.txt")

# readEDS() requires knowing the number of cells and genes
cell.names <- readLines(barcode.file)
gene.names <- readLines(gene.file)
num.cells <- length(cell.names)
num.genes <- length(gene.names)

# reading in the sparse matrix
mat <- readEDS(numOfGenes=num.genes,
               numOfOriginalCells=num.cells,
               countMatFilename=quant.mat.file)