API
Import SpaRED:
import spared
Datasets
|
Get a dataset from name. |
Filtering
|
Filter prediction genes by Moran's I. |
|
Perform complete filtering pipeline of a slide collection. |
Retrieve a slide from a collection of slides. |
|
|
Get list of slides from collection |
Gene Features
|
Compute the expression fraction for all genes. |
Compute the global expression fraction for all genes. |
|
|
Compute Moran's I statistic for each gene. |
Spot Features
Compute embeddings for patches. |
|
Compute predictions for patches. |
|
|
Compute dimensionality reductions and clusters |
|
Compute neighbors dictionary for an AnnData object. |
Layer Operations
|
Normalize expression using TPM normalization. |
|
Perform \(\log_2(x+1)\) transformation |
Perform batch correction with ComBat |
|
|
Get expression deltas from the mean. |
|
Add an artificial noisy layer. |
|
Perform complete processing pipeline. |
Denoising
|
Remove noise with adaptive median filter. |
|
Graph Operations
|
Get neighbor graphs for a single slide. |
Get positional encodings for a neighbor graph. |
|
|
Get graphs for all the slides in a dataset. |
Plotting
|
Plot all the whole slide images |
|
Plot heatmap of expression fraction |
|
Plot filtering histograms |
|
Plot random set of patches |
|
Plot the most or least auto-correlated genes |
Plot specific gene expression |
|
|
Plot clusters spatially |
|
Plot mean and std of all genes |
Plot dataset's general stats |
|
|
Plot mean and std of genes by data split |
|
Plot all quality control plots |
Dataloaders
Get dataloaders for pretraining an image encoder. |
|
|
Get dataloaders for the graphs of a dataset. |
Models
|
Metrics
|
This function receives 2 matrices of shapes (n_observations, n_variables) and computes the average Pearson correlation. |
|
This function receives 2 matrices of shapes (n_observations, n_variables) and computes the average R2 score. |
|
Get general regression metrics |