sainsc.GridCounts
- class sainsc.GridCounts(counts, *, resolution=None, n_threads=None)
Object holding each gene as count data in a sparse 2D-grid.
- Parameters:
counts (dict[str, csr_array | csr_matrix | csc_array | csc_matrix]) – Gene counts.
resolution (float, optional) – Resolution as nm / pixel.
n_threads (int, optional) – Number of threads used for processing. If None or 0 this will default to the number of logical CPUs.
- Raises:
ValueError – If genes in counts do not all have the same shape.
Attributes
Shape of the count arrays. |
Properties
Number of threads used for processing. |
|
Resolution in nm / pixel. |
Methods
Convert to a dataframe with 'gene', 'x', 'y', and 'count' column. |
|
|
Crop the field of view for all genes. |
|
Filter genes by minimum and maximum count thresholds. |
|
Filter all genes with a binary mask. |
|
Initialize from dataframe. |
Number of counts per gene. |
|
|
Get all available genes. |
|
Get the counts for a gene. |
Counts per pixel. |
|
|
Keep selected genes. |