snapatac2.read_10x_mtx#

snapatac2.read_10x_mtx(path, file=None, prefix=None)[source]#

Read 10x-Genomics-formatted mtx directory.

Parameters:
  • path (Path) –

    Path to directory for .mtx and .tsv files. The directory should contain three files:

    1. count matrix: “matrix.mtx” or “matrix.mtx.gz”.

    2. features: “genes.tsv”, or “genes.tsv.gz”, or “features.tsv”, or “features.tsv.gz”.

    3. barcodes: “barcodes.tsv”, or “barcodes.tsv.gz”.

  • file (Optional[Path]) – File name of the “.h5ad” file used to save the AnnData object. If None, an in-memory AnnData object is returned.

  • prefix (Optional[str]) – 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, then the prefix is patientA_.

Returns:

An AnnData object.

Return type:

AnnData