sainsc.LazyKDE
- class sainsc.LazyKDE(counts, *, n_threads=None)
Class to analyze kernel density estimates (KDE) for large number of genes.
The KDE of the genes will be calculated when needed to avoid storing large volumes of data in memory.
- Parameters:
counts (GridCounts) – Gene counts.
n_threads (int, optional) – Number of threads used for reading and processing file. If None this will default to the number of available CPUs.
Attributes
Spatial gene counts. |
Properties
Assignment score for each pixel. |
|
Map of pixels that are assigned as background. |
|
Cell-type map of cell-type indices. |
|
List of assigned celltypes. |
|
Cosine similarity for each pixel. |
|
List of genes. |
|
Map of the KDE of total mRNA. |
|
Coordinates of local maxima. |
|
Number of threads that will be used for computations. |
|
Resolution in nm / pixel. |
|
Shape of the sample. |
|
Map of the total mRNA. |
|
Map of the KDE of total mRNA. |
Methods
|
Calculate the cosine similarity with known cell-type signatures. |
Calculate kernel density estimate (KDE) for the total mRNA. |
|
Calculate kernel density estimate (KDE) for the total mRNA. |
|
|
Define pixels as background. |
|
Find the local maxima of the kernel density estimates. |
|
Construct a LazyKDE from a DataFrame. |
|
Set the kernel used for kernel density estimation (KDE) to gaussian. |
|
Calculate kernel density estimate (KDE). |
|
Load the gene expression (KDE) of the local maxima. |
|
Plot the kernel density estimate (KDE). |
|
Plot a histogram of the kernel density estimates. |
|
Plot the assignment score from cell-type assignment. |
|
Plot the cell-type annotation. |
|
Plot the cosine similarity from cell-type assignment. |
|
Plot the gene expression counts. |
|
Plot a histogram of the counts per gene. |
|
Plot the local kernel density estimate maxima. |