scanpy.read_10x_mtx

scanpy.read_10x_mtx(path, var_names='gene_symbols', make_unique=True, cache=False, cache_compression=<Empty.token: 0>, gex_only=True, *, prefix=None)

Read 10x-Genomics-formatted mtx directory.

Parameters
path : Path | strUnion[Path, str]

Path to directory for .mtx and .tsv files, e.g. ‘./filtered_gene_bc_matrices/hg19/’.

var_names : {‘gene_symbols’, ‘gene_ids’}Literal[‘gene_symbols’, ‘gene_ids’] (default: 'gene_symbols')

The variables index.

make_unique : boolbool (default: True)

Whether to make the variables index unique by appending ‘-1’, ‘-2’ etc. or not.

cache : boolbool (default: False)

If False, read from source, if True, read from fast ‘h5ad’ cache.

cache_compression : {‘gzip’, ‘lzf’} | None | EmptyUnion[Literal[‘gzip’, ‘lzf’], None, Empty] (default: <Empty.token: 0>)

See the h5py Filter pipeline. (Default: settings.cache_compression)

gex_only : boolbool (default: True)

Only keep ‘Gene Expression’ data and ignore other feature types, e.g. ‘Antibody Capture’, ‘CRISPR Guide Capture’, or ‘Custom’

prefix : str | NoneOptional[str] (default: None)

Any prefix before matrix.mtx, genes.tsv and barcodes.tsv. For instance, if the files are named patientA_matrix.mtx, patientA_genes.tsv and patientA_barcodes.tsv the prefix is patientA_. (Default: no prefix)

Return type

AnnDataAnnData

Returns

An AnnData object