Skip to contents

Write the counts matrix, features, barcodes, metadata, variable features and—optionally—reduction embeddings from a Seurat object in the 10X “3-file” layout.

Usage

make3file(seu, assay = "RNA", dir, get_reductions = TRUE)

Arguments

seu

A Seurat object.

assay

Which assay to export (default "RNA").

dir

Output directory (must already exist).

get_reductions

Logical; also export reduction embeddings (default TRUE).

Value

Invisibly returns NULL; called for its side effects.

Details

The function creates a sub-directory called 3file inside dir and writes:

  • matrix.mtx.gzCompressed Matrix Market file containing the counts matrix.

  • features.tsv.gzGene (feature) table.

  • barcodes.tsv.gzCell barcodes.

  • meta.csvCell-level metadata.

  • \<reduction\>_reduction.tsv.gzEmbeddings for each reduction (UMAP, PCA, …); written only when get_reductions = TRUE.

  • variablefeatures.tsv.gzVariable-gene list.

Examples

if (FALSE) { # \dontrun{
make3file(seu, assay = "RNA", dir = "out", get_reductions = FALSE)
} # }