sainsc.io.read_StereoSeq_bins
- sainsc.io.read_StereoSeq_bins(filepath, bin_size=50, *, spatialdata=False, resolution=None, gene_name=False, exon_count=False, sep='\t', n_threads=None, **kwargs)
Read a Stereo-seq GEM file into bins.
- Parameters:
bin_size (int, optional) – Defines the size of bins along both dimensions e.g 50 will results in bins of size 50x50.
spatialdata (bool, optional) – If True will load the data as a SpatialData object else as an AnnData object.
resolution (float, optional) – Center-to-center distance of Stere-seq beads in nm, if None it will try to detect it from the chip definition in the file header if one exists.
gene_name (bool) – If True will use the ‘geneName’ column otherwise the ‘geneID’ column is used as gene identifier.
exon_count (bool) – If True will use the ‘ExonCount’ column otherwise the ‘MIDCount’ column is used as counts.
sep (str, optional) – Separator used in
polars.read_csv().n_threads (int, optional) – Number of threads used for reading file and processing. If None or 0 this will default to the number of available CPUs.
kwargs – Other keyword arguments will be passed to
polars.read_csv().
- Returns:
AnnData or SpatialData object of the bins with coordinates stored in
anndata.AnnData.obsmwith the key ‘spatial’.- Return type:
- Raises:
ModuleNotFoundError – If spatialdata is set to True but the package is not installed.