writeMatrixFiles {TooManyCellsR}R Documentation

Write a Matrix to a folder.

Description

This function will write a Matrix from the Matrix library to a temporary directory containing matrix.mtx, genes.tsv, barcodes.tsv, and optionally a labels.csv file.

Usage

writeMatrixFiles(mat, labels = NULL)

Arguments

mat

The input Matrix with gene row names and cell barcode column names.

labels

The input labels data frame with item (cell barcodes) and label (whatever labels you want to give them, such as tissue of origin, celltype, etc.) columns. Optional.

Value

None

Examples

input <- system.file("extdata", "mat.csv", package="TooManyCellsR")
df = read.csv(input, row.names = 1, header = TRUE)
mat = Matrix::Matrix(as.matrix(df), sparse = TRUE)
writeMatrixFiles(mat)

[Package TooManyCellsR version 0.1.1.0 Index]