read_count_output: Read matrix along with barcode and gene names

View source: R/utils.R

read_count_outputR Documentation

Read matrix along with barcode and gene names

Description

This function takes in a directory and name and reads the mtx file, genes, and barcodes from the output of bustools to return a sparse matrix with column names and row names.

Usage

read_count_output(dir, name, tcc = FALSE)

Arguments

dir

Directory with the bustools count outputs.

name

The files in the output directory should be "name".mtx, "name".genes.txt, and "name".barcodes.txt.

tcc

Logical, whether the matrix of interest is a TCC matrix. Defaults to FALSE.

Value

A dgCMatrix with barcodes as column names and genes as row names.

Examples

# Internal toy data used for unit testing
toy_path <- system.file("testdata", package = "BUSpaRse")
m <- read_count_output(toy_path, name = "genes", tcc = FALSE)

lambdamoses/BUStoolsR documentation built on Aug. 28, 2022, 1:35 p.m.