Read 10X Genomics Files
Reads 10X Genomics files containing single-cell RNA-seq UMI counts in Matrix Market format.
read10X(mtx = NULL, genes = NULL, barcodes = NULL, path = ".", DGEList = TRUE)
mtx |
name of |
genes |
name of file containing gene IDs and names. Defaults to |
barcodes |
optional name of file containing barcodes. Defaults to |
path |
character string giving the directory containing the files. Defaults to the current working directory. |
DGEList |
logical. If |
This function reads output files created by the 10X Genomics Cellranger pipeline, see
https://support.10xgenomics.com/single-cell-gene-expression/software/pipelines/latest/output/matrices.
The UMI counts are assembled into an integer matrix in R with accompanying gene IDs and gene symbols.
The results are returned as either a DGEList
or an ordinary list.
The files mtx
, genes
and barcodes
can be provided in either gzipped or unzipped versions.
This function creates an ordinary matrix of counts.
To read the counts instead into a sparse matrix format, the read10xResults
function in the scater package is an alternative.
Either a DGEList
object (if DGEList=TRUE
) or an ordinary list with the following components:
counts |
matrix of counts. |
genes |
data.frame counting gene symbols. |
samples |
data.frame containing information about each cell. This will be omitted if |
The only difference between the DGEList
or list formats is that the DGEList
adds some extra columns to the samples
data.frame.
Gordon Smyth
read10xResults
in the scater package.
## Not run: GEO <- "ftp://ftp.ncbi.nlm.nih.gov/geo/samples/GSM2510nnn/GSM2510617/suppl/" GEOmtx <- paste0(GEO,"GSM2510617_P7-matrix.mtx.gz") GEOgenes <- paste0(GEO,"GSM2510617_P7-genes.tsv.gz") download.file(GEOmtx,"matrix.mtx.gz") download.file(GEOgenes,"genes.tsv.gz") y <- read10X("matrix.mtx.gz", "genes.tsv.gz") ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.