read10x: Load 10X Genomics Data as Seurat Object

View source: R/Seurat.Utils.R

read10xR Documentation

Load 10X Genomics Data as Seurat Object

Description

Reads 10X Genomics dataset files (gzipped) including matrix, features, and barcodes, to a single expression matrix. This function handles the unzipping of these files, reads the data, and re-compresses the files back to their original gzipped format.

Usage

read10x(dir)

Arguments

dir

A character string specifying the path to the directory containing the 10X dataset files. This directory should contain matrix.mtx.gz, features.tsv.gz, and barcodes.tsv.gz files.

Details

This function facilitates the loading of 10X Genomics datasets into R for analysis with the Seurat package. It specifically caters to gzipped versions of the matrix.mtx, features.tsv, and barcodes.tsv files, automating their decompression, reading, and subsequent recompression. The function relies on Seurat's Read10X function for data reading and object construction.

Value

A Seurat object containing the single-cell RNA-seq data extracted from the provided 10X Genomics dataset.

Note

Ensure that the specified directory contains the required gzipped files. If the features.tsv.gz file is named differently (e.g., genes.tsv.gz), please rename it accordingly before running this function.

See Also

Read10X for the underlying function used to read the 10X data.

Examples

## Not run: 
if (interactive()) {
  # Replace `path_to_10x_data` with the path to your 10X data directory
  seuratObject <- read10x(dir = "path_to_10x_data")
  # `seuratObject` is now a Seurat object containing the loaded 10X data
}

## End(Not run)


vertesy/Seurat.utils documentation built on Dec. 4, 2024, 5:20 p.m.