API#
Import SPArrOW as:
import sparrow as sp
IO#
I/O.
|
Read MERSCOPE data from Vizgen. |
|
Read a 10X Genomics Xenium dataset into a SpatialData object. |
|
Read 10x Genomics Visium HD formatted dataset. |
|
Reads transcript information from a file with each row listing the x and y coordinates, along with the gene name. |
|
Reads and adds Resolve transcript information to a SpatialData object. |
|
Reads and adds merscope transcript information to a SpatialData object. |
|
Reads and adds Stereoseq transcript information to a SpatialData object. |
|
Convert input images or arrays into a SpatialData object with the image added as an image layer with name |
Image#
Operations on image and labels layers.
|
Add an image layer to a SpatialData object. |
|
Add a labels layer to a SpatialData object. |
|
Function corrects for the tiling effect that occurs in some image data (e.g. resolve data). |
|
Enhance the contrast of an image in a SpatialData object. |
|
Normalize the intensity of an image layer in a SpatialData object using specified percentiles. |
|
Apply min max filtering to an image in a SpatialData object using dask (using |
|
Apply Gaussian filtering to an image in a SpatialData object using dask. |
|
Calculate the transcript density using gaussian filter and add it to the provided spatial data. |
|
Combines specific channels within an image layer of a SpatialData object. |
|
Segment images using a provided model and add segmentation results (labels layer and shapes layer) to the SpatialData object. |
|
Segment images using a |
|
Perform cell segmentation using the Cellpose model. |
|
Perform cell segmentation using the Baysor algorithm. |
|
Adds a grid-based labels layer to the SpatialData object using either a hexagonal or square grid. |
|
Expand cells in labels layer |
|
Align two labels layers. |
|
Filter labels in labels layer |
|
Merges two labels layers within a SpatialData object based on a specified threshold. |
|
Merge labels layers using nuclei segmentation. |
|
Given a shapes layer in a SpatialData object, corresponding masks are created, and added as a labels layer to the SpatialData object. |
|
Map to original. |
Shape#
Operations on shapes (polygons) layers.
|
Vectorize a labels layer. |
|
Add a shapes layer to a SpatialData object. |
|
Filter shapes in a SpatialData object. |
|
Create Voronoi boundaries from the shapes layer of the provided SpatialData object. |
Table#
Operations on table (AnnData object) layers.
|
Add a table layer to a SpatialData object. |
|
Allocates transcripts to cells via provided |
|
Allocates intensity values from a specified image layer to corresponding cells in a SpatialData object and returns an updated SpatialData object augmented with a table layer ( |
|
Preprocess a table (AnnData) attribute of a SpatialData object for transcriptomics data. |
|
Preprocess a table (AnnData) attribute of a SpatialData object for proteomics data. |
|
Returns the updated SpatialData object. |
|
Applies leiden clustering on the |
|
Applies KMeans clustering on the |
|
The function loads marker genes from a CSV file and scores cells for each cell type using those markers using scanpy's |
|
Iterative annotation algorithm. |
|
Correct celltype expression in |
|
Re-calculates annotations, potentially following corrections to the list of celltypes, or after a manual update of the assigned scores per cell type via e.g. |
|
Calculate the nhood enrichment using squidpy via |
|
Enhances a SpatialData object with region property features calculated from the specified labels layer, updating its table attribute ( |
Points#
Operations on points (Dask DataFrame object) layers.
|
Add a points layer to a SpatialData object. |
Plotting#
Plotting functions.
General plots#
|
Plot an image based on given parameters. |
|
Plots a SpatialData object. |
|
Plot a labels layer (masks) based on given parameters. |
|
Visualizes the effect of tiling correction. |
|
Visualize the correction performed per tile using a flatfield image. |
|
Visualize obtained shapes layer (i.e. segmentation mask boundaries) from a SpatialData object. |
Proteomics plots#
|
Plot the signal to noise ratio. |
|
Plot the signal to noise ratio. |
|
|
|
|
|
|
|
|
|
|
|
Transcriptomics plots#
|
Produce a sanity plot to visualize segmentation masks, and/or transcripts on top of an image. |
|
Analyse and visualize the proportion of genes that could not be assigned to a cell during allocation step. |
|
Visualize the transcript density layer. |
|
Function plots the size of the nucleus/cell related to the counts. |
|
Visualize clusters. |
|
Function generates following plots: |
|
Generate plots that allow assessing the "cleanliness" or accuracy of the cell clustering: |
|
Plot the neighborhood enrichment across cell-type annotations. |
Utils#
Utility functions.
|
Query the labels layers of a SpatialData object and the corresponding instances it annotates in |
|
Helper class to calulate aggregated 'sum', 'mean', 'var', 'kurtosis', 'skew', 'area', 'min', 'max' 'quantiles', 'center of mass', 'radii' or 'principal_axes' of image and labels using Dask. |
Datasets#
Dataset loaders.
Example transcriptomics dataset |
|
|
Example transcriptomics dataset |
|
Get the Pooch registry |
Get the Pooch SpatialData registry |