scanpy.read_10x_mtx
- scanpy.read_10x_mtx(path, var_names='gene_symbols', make_unique=True, cache=False, cache_compression=Empty.token, gex_only=True, *, prefix=None)
Read 10x-Genomics-formatted mtx directory.
- Parameters:
- path : Union[Path, str]
Path to directory for
.mtxand.tsvfiles, e.g. ‘./filtered_gene_bc_matrices/hg19/’.- var_names : Literal[‘gene_symbols’, ‘gene_ids’] (default:
'gene_symbols') The variables index.
- make_unique : bool (default:
True) Whether to make the variables index unique by appending ‘-1’, ‘-2’ etc. or not.
- cache : bool (default:
False) If
False, read from source, ifTrue, read from fast ‘h5ad’ cache.- cache_compression : Union[Literal[‘gzip’, ‘lzf’], None, Empty] (default:
<Empty.token: 0>) See the h5py Filter pipeline. (Default:
settings.cache_compression)- gex_only : bool (default:
True) Only keep ‘Gene Expression’ data and ignore other feature types, e.g. ‘Antibody Capture’, ‘CRISPR Guide Capture’, or ‘Custom’
- prefix : str | None (default:
None) Any prefix before
matrix.mtx,genes.tsvandbarcodes.tsv. For instance, if the files are namedpatientA_matrix.mtx,patientA_genes.tsvandpatientA_barcodes.tsvthe prefix ispatientA_. (Default: no prefix)
- Return type:
AnnData
- Returns:
: An
AnnDataobject