R: Load in data from 10X

Description

Enables easy loading of sparse data matrices provided by 10X genomics.

Usage

Read10X(
  data.dir,
  gene.column = 2,
  cell.column = 1,
  unique.features = TRUE,
  strip.suffix = FALSE
)

Arguments

data.dir Directory containing the matrix.mtx, genes.tsv (or features.tsv), and barcodes.tsv files provided by 10X. A vector or named vector can be given in order to load several data directories. If a named vector is given, the cell barcode names will be prefixed with the name.
gene.column Specify which column of genes.tsv or features.tsv to use for gene names; default is 2
cell.column Specify which column of barcodes.tsv to use for cell names; default is 1
unique.features Make feature names unique (default TRUE)
strip.suffix Remove trailing “-1” if present in all cell barcodes.

Value

If features.csv indicates the data has multiple data types, a list containing a sparse matrix of the data from each type will be returned. Otherwise a sparse matrix containing the expression data will be returned.

Examples

## Not run: 
# For output from CellRanger < 3.0
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv, genes.tsv, and matrix.mtx
expression_matrix <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = expression_matrix)

# For output from CellRanger >= 3.0 with multiple data types
data_dir <- 'path/to/data/directory'
list.files(data_dir) # Should show barcodes.tsv.gz, features.tsv.gz, and matrix.mtx.gz
data <- Read10X(data.dir = data_dir)
seurat_object = CreateSeuratObject(counts = data$`Gene Expression`)
seurat_object[['Protein']] = CreateAssayObject(counts = data$`Antibody Capture`)

## End(Not run)

如若转载,请注明出处:https://www.ouq.net/2663.html

(0)
打赏 微信打赏,为服务器增加50M流量 微信打赏,为服务器增加50M流量 支付宝打赏,为服务器增加50M流量 支付宝打赏,为服务器增加50M流量
上一篇 12/27/2023
下一篇 01/03/2024

相关推荐

  • 从小鼠皮肤伤口分离巨噬细胞用于单细胞RNA测序

    了解组织修复中的巨噬细胞异质性是一个重大挑战。在这里,我们描述了一个协议,它结合了从皮肤伤口中分离免疫细胞和随后基于流式细胞仪的伤口巨噬细胞分拣和单细胞RNA测序。我们使用原始Smart-seq2协议的修改版来提高速度和准确性。该协议对于分…

    04/26/2022
    206
  • rconfig:在命令行管理 R 配置

    Configuration management using files (JSON, YAML, separated text), JSON strings, and command line arguments. Command lin…

    R 04/01/2022
    191
  • had non-zero exit status

    解决方案1:install.packages(‘*package_name’, dependencies = TRUE)

    Python 11/07/2020
    122
  • edgeR:RNAseq差异基因比较

    Empirical analysis of digital gene expression data in R 安装: source(“http://bioconductor.org/biocLite.R”)bioc…

    08/14/2020
    121
  • R:cnetplot的使用

    cnetplot用于Gene-Concept Network,将位于一个GO Terms下的基因用线连接起来。 cnetplot(x, showCategory = 5, foldChange = NULL, layout = “kk”, …

    R 05/16/2020
    675