API#
Import SPArrOW as:
import sparrow as sp
IO#
I/O.
|
Convert input images or arrays into a SpatialData object with the image added as an image layer with name |
|
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 Vizgen transcript information to a SpatialData object. |
|
Reads and adds Stereoseq transcript information to a SpatialData object. |
Image#
Operations on image and labels layers.
|
Add an image layer to a SpatialData object. |
|
Add a labels layer to a SpatialData object. |
|
Apply a specified function to an image layer of 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 |
|
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. |
|
Apply a specified function to a labels layer in a SpatialData object. |
|
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. |
|
Preprocess image layers specified in |
|
Applies flowsom clustering on image layer(s) of a SpatialData object. |
Shape#
Operations on shapes (polygons) layers.
|
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 ( |
|
Calculates average intensity of each channel in |
|
Preprocesses spatial data for cell clustering. |
|
Prepares the data obtained from pixel clustering for cell clustering (see docstring of |
|
Calculation of weighted channel expression in the context of cell clustering. |
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. |
|
Plot shapes and/or images/labels from 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 spatial transcriptomics data 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 |
Datasets#
Dataset loaders.
|
Differs from |
|
Multisample blobs. |
|
Example pixie dataset. |
Example proteomics dataset |
|
Example proteomics dataset |
|
Example proteomics dataset LuCa-7color_[13860,52919]_1x1 from Perkin Elmer |
|
Example transcriptomics dataset |
|
|
Get the Pooch registry |
Get the Pooch SpatialData registry |