scfocus.utils.read_10x_files

scfocus.utils.read_10x_files(mtx_file, features_file, barcodes_file)[source]

Read 10x Genomics files (compressed or uncompressed) and return an AnnData object.

Parameters:
  • mtx_file (UploadedFile) – Matrix file (matrix.mtx or matrix.mtx.gz).

  • features_file (UploadedFile) – Features/genes file (features.tsv or features.tsv.gz).

  • barcodes_file (UploadedFile) – Barcodes file (barcodes.tsv or barcodes.tsv.gz).

Returns:

adata – Annotated data matrix if successful, None otherwise.

Return type:

anndata.AnnData or None

Notes

Files are temporarily saved to disk for processing with scanpy’s read_10x_mtx function. Temporary files are automatically cleaned up after reading.