bioalpha.singlecell.read_10x_mtx
- bioalpha.singlecell.read_10x_mtx(path: Path | str, var_names: Literal['gene_symbols', 'gene_ids'] = 'gene_symbols', make_unique: bool = True, gex_only: bool = True, *, prefix: str | None = None) AnnData
Fast read
10x-Genomics-formatted mtxdirectory.- 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.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, default =None) – Any prefix beforematrix.mtx,genes.tsvandbarcodes.tsv(matrix.mtx.gz,features.tsv.gzandbarcodes.tsv.gzfor Cell Ranger v3 or later). For instance, if the files are namedpatientA_matrix.mtx,patientA_genes.tsvandpatientA_barcodes.tsvthe prefix ispatientA_. (Default: no prefix)
- Returns:
adata – The annotated data matrix of shape
n_obsxn_vars. Rows correspond to cells and columns to genes.- Return type:
AnnData