stLearn - A Spatial Transcriptomics Toolkit¶
stLearn is designed to comprehensively analyse Spatial Transcriptomics (ST) data to investigate complex biological processes within an undissociated tissue. ST is emerging as the “next generation” of single-cell RNA sequencing because it adds spatial and morphological context to the transcriptional profile of cells in an intact tissue section. However, existing ST analysis methods typically use the captured spatial and/or morphological data as a visualisation tool rather than as informative features for model development. We have developed an analysis method that exploits all three data types: Spatial distance, tissue Morphology, and gene Expression measurements (SME) from ST data. This combinatorial approach allows us to more accurately model underlying tissue biology, and allows researchers to address key questions in three major research areas: cell type identification, cell trajectory reconstruction, and the study of cell-cell interactions within an undissociated tissue sample.
Latest Additions¶
1.3.0 2026-02-24¶
Features
Removed interactive stLearn/embedded web application.
Removed louvain clustering.
Renamed methods and classes to follow lowercase standard.
1.2.2 2025-10-20¶
Features
Added support for Python 3.11 and 3.12.
Upgraded scanpy to 1.11 - clustering will be different.
Added more CCI tests.
Bugs
Fixed copy-paste error in louvain.py file.
1.1.5 2025-09-17¶
Features
Add Leiden clustering wrapper.
Fix documentation, refactor code in spatial.SME.
1.1.1 2025-07-07¶
Features
Support Python 3.10.x
Added quality checks black, ruff and mypy and fixed appropriate source code.
Copy parameters now work with the same semantics as scanpy.
Library upgrades for leidenalg, louvain, numba, numpy, scanpy, and tensorflow.
datasets.xenium_sge - loads Xenium data (and caches it) similar to scanpy.visium_sge.
Bug fixes
Xenium TIFF and cell positions are now aligned.
Consistent with type annotations - mainly missing None annotations.
pl.cluster_plot - Does not keep colours from previous runs when clustering.
pl.trajectory.pseudotime_plot - Fix typing of cluster values in .uns[“split_node”].
Removed datasets.example_bcba - Replaced with wrapper for scanpy.visium_sge.
Moved spatials directory to spatial, cleaned up pl and tl packages.
0.4.0 2022-02-03¶
Features
Upgrade stSME, PSTS and CCI analysis methods.
Add CCI analysis functions:
load_lrs(),grid(),run(),adj_pvals(),run_lr_go(),lr_summary(),lr_diagnostics(),lr_n_spots(),lr_go(),lr_result_plot(),lr_plot(),cci_check(),ccinet_plot(),lr_chord_plot(),lr_cci_map(),cci_map(),lr_plot_interactive(),spatialcci_plot_interactive()
0.3.2 2021-03-29¶
Features
Add interactive plotting functions:
gene_plot_interactive(),cluster_plot_interactive(),het_plot_interactive()Add basic unittest (will add more in the future).
Add ‘contour’ parameter to use contour plot in
gene_plot()andhet_plot().Add
convert_scanpy()to convert object from scanpy to stLearn.
Bug fixes
Refactor
gene_plot()Refactor
cluster_plot()Refactor
het_plot()Fixed issue with networkx object cannot write h5ad file.