swh:1:snp:0da231f3ffdb3226650880f1b61d5d5cdcbd749b
Tip revision: 656fc8b562d53e5d0cedda9e09d9dda81e8c00e9 authored by David Collins on 29 February 2024, 13:44:33 UTC
Merge pull request #8550 from satijalab/develop
Merge pull request #8550 from satijalab/develop
Tip revision: 656fc8b
ReadMtx.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/preprocessing.R
\name{ReadMtx}
\alias{ReadMtx}
\title{Load in data from remote or local mtx files}
\usage{
ReadMtx(
mtx,
cells,
features,
cell.column = 1,
feature.column = 2,
cell.sep = "\\t",
feature.sep = "\\t",
skip.cell = 0,
skip.feature = 0,
mtx.transpose = FALSE,
unique.features = TRUE,
strip.suffix = FALSE
)
}
\arguments{
\item{mtx}{Name or remote URL of the mtx file}
\item{cells}{Name or remote URL of the cells/barcodes file}
\item{features}{Name or remote URL of the features/genes file}
\item{cell.column}{Specify which column of cells file to use for cell names; default is 1}
\item{feature.column}{Specify which column of features files to use for feature/gene names; default is 2}
\item{cell.sep}{Specify the delimiter in the cell name file}
\item{feature.sep}{Specify the delimiter in the feature name file}
\item{skip.cell}{Number of lines to skip in the cells file before beginning to read cell names}
\item{skip.feature}{Number of lines to skip in the features file before beginning to gene names}
\item{mtx.transpose}{Transpose the matrix after reading in}
\item{unique.features}{Make feature names unique (default TRUE)}
\item{strip.suffix}{Remove trailing "-1" if present in all cell barcodes.}
}
\value{
A sparse matrix containing the expression data.
}
\description{
Enables easy loading of sparse data matrices
}
\examples{
\dontrun{
# For local files:
expression_matrix <- ReadMtx(
mtx = "count_matrix.mtx.gz", features = "features.tsv.gz",
cells = "barcodes.tsv.gz"
)
seurat_object <- CreateSeuratObject(counts = expression_matrix)
# For remote files:
expression_matrix <- ReadMtx(mtx = "http://localhost/matrix.mtx",
cells = "http://localhost/barcodes.tsv",
features = "http://localhost/genes.tsv")
seurat_object <- CreateSeuratObject(counts = data)
}
}
\concept{preprocessing}