Top-level package for stLearn.
API¶
Import stLearn as:
import stlearn as st
Wrapper functions: wrapper¶
|
Read Visium data from 10X (wrap read_visium from scanpy) |
|
Read Old Spatial Transcriptomics data |
|
Read Slide-seq data |
|
Read MERFISH data |
|
Read SeqFish data |
|
|
|
Add: add¶
|
Adding image data to the Anndata object |
|
Adding spatial information into the Anndata object |
|
Parsing the old spaital transcriptomics data |
|
Add significant Ligand-Receptor pairs into AnnData object |
|
Add label transfer results into AnnData object |
|
Adding annotation for cluster |
|
Adding label transfered from Seurat |
|
Adding binary mask image to the Anndata object |
|
Parsing the old spaital transcriptomics data |
|
Adding label transfered from Seurat |
Preprocessing: pp¶
|
Wrap function scanpy.pp.filter_genes |
|
Wrap function of scanpy.pp.log1p Copyright (c) 2017 F. |
|
Wrap function from scanpy.pp.log1p Normalize counts per cell. |
|
Wrap function of scanpy.pp.scale |
|
Compute a neighborhood graph of observations [McInnes18]. |
|
Tiling H&E images to small tiles based on spot spatial location |
|
Extract latent morphological features from H&E images using pre-trained convolutional neural network base |
Embedding: em¶
|
Wrap function scanpy.pp.pca Principal component analysis [Pedregosa11]. |
|
Wrap function scanpy.pp.umap Embed the neighborhood graph using UMAP [McInnes18]. |
|
FastICA: a fast algorithm for Independent Component Analysis. |
|
Factor Analysis (FA) A simple linear generative model with Gaussian latent variables. |
|
Diffusion Maps [Coifman05] [Haghverdi15] [Wolf18]. |
Spatial: spatial¶
|
Perform local clustering by using DBSCAN. |
|
Perform pseudotime analysis. |
Perform pseudo-time-space analysis with global level. |
|
Perform pseudo-time-space analysis with local level. |
|
Compare transition markers between two clades |
|
Transition markers detection of a clade. |
|
Transition markers detection of a branch. |
|
SME normalisation: Using spot location information and tissue morphological features to correct spot gene expression |
|
using spatial location (S), tissue morphological feature (M) and gene expression (E) information to impute missing values |
|
using spatial location (S), tissue morphological feature (M) and gene expression (E) information to impute gap between spots and increase resolution for gene detection |
|
using spatial location (S), tissue morphological feature (M) and gene expression (E) information to normalize data. |
Tools: tl¶
|
Perform kmeans clustering for spatial transcriptomics data |
|
Wrap function scanpy.tl.louvain Cluster cells into subgroups [Blondel08] [Levine15] [Traag17]. |
|
Calculate the proportion of known ligand-receptor co-expression among the neighbouring spots or within spots :param adata: :type adata: AnnData The data object to scan :param use_lr: :type use_lr: str object to keep the result (default: adata.uns[‘cci_lr’]) :param distance: :type distance: float Distance to determine the neighbours (default: closest), distance=0 means within spot |
|
Count the cell type densities :param adata: :type adata: AnnData The data object including the cell types to count :param use_clustering: :type use_clustering: The cell type results to use in counting :param use_het: :type use_het: The stoarge place for result :param distance: :type distance: int Distance to determine the neighbours (default is the nearest neighbour), distance=0 means within spot |
|
Generate screening grids across the tissue sample :param adata: :type adata: AnnData The data object to generate grids on :param num_row: :type num_row: int Number of rows :param num_col: :type num_col: int Number of columns :param radius: :type radius: int Radius to determine neighbours (default: 1, nearest) |
|
Count the cell type densities :param adata: :type adata: AnnData The data object including the cell types to count :param num_row: :type num_row: int Number of grids on height :param num_col: :type num_col: int Number of grids on width :param use_clustering: :type use_clustering: The cell type results to use in counting :param use_het: :type use_het: The stoarge place for result :param radius: :type radius: int Distance to determine the neighbour grids (default: 1=nearest), radius=0 means within grid |
|
Merge results from cell type heterogeneity and L-R clustering :param adata: :type adata: AnnData The data object including the cell types to count :param use_lr: :type use_lr: str CCI LR scores :param use_het: :type use_het: str CCI HET scores |
|
Permutation test for merged result :param adata: :type adata: AnnData The data object including the cell types to count :param n_pairs: :type n_pairs: int Number of gene pairs to run permutation test (default: 1000) :param distance: :type distance: int Distance between spots (default: 30) :param use_lr: :type use_lr: str LR cluster used for permutation test (default: ‘lr_neighbours_louvain_max’) :param use_het: :type use_het: str cell type diversity counts used for permutation test (default ‘het’) |
Plot: pl¶
|
|
|
|
|
|
|
|
|
|
|
|
|
A wrap function to plot all the non-spatial plot from scanpy. |
|
Clustering plot for sptial transcriptomics data. |
|
QC plot for sptial transcriptomics data. |
|
|
|
|
|
Cell diversity plot for sptial transcriptomics data. |
|
mask plot for sptial transcriptomics data. |
|
Global trajectory inference plot (Only DPT). |
|
Local spatial trajectory inference plot. |
|
Hierarchical tree plot represent for the global spatial trajectory inference. |
Plot transition marker. |
|
|
Differential expression between transition markers. |
Tools: datasets¶
|