Learn R Programming

TooManyCellsR (version 0.1.1.0)

writeMatrixFiles: 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

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab