SpatialFlow is an open-source workflow/pipeline for analyzing spatial transcriptomics data.
It explore gene expression in tissue with spatial information.
Spatial transcriptomics is a growing field in biology. This project includes all basic and advanced steps — from loading data to generating results that can be used in research papers.
- Load and explore spatial transcriptomics data
- Do quality control (QC) and filtering
- Normalize and reduce dimensions (PCA, UMAP)
- Cluster spatial spots or cells
- Detect marker genes
- Map spatial domains
- Estimate cell types in mixed spots (deconvolution)
- Study cell-cell communication (ligand-receptor analysis)
- Run pathway analysis
- Visualize and save results
git clone https://github.com/rezwan-lab/spatialflow.git
cd spatialflowconda create -n spatialflow python=3.10conda activate spatialflowpip install -r requirements-spatialflow.txt
or use mamba
requirements-mamba.txt
pip install -e .import squidpy as sq
# Load the example Visium dataset
adata = sq.datasets.visium("V1_Human_Lymph_Node")
# Print basic information about the loaded dataset
print(f"AnnData object: {adata}")
print(f"Shape of data matrix: {adata.shape}")
print(f"Available layers: {list(adata.layers.keys())}")
print(f"Spatial coordinates available: {'spatial' in adata.obsm}")import squidpy as sq
# Load the example Visium dataset (human lymph node)
adata = sq.datasets.visium("V1_Human_Lymph_Node")
# Save the data for SpatialFlow
adata.write_h5ad("./V1_Human_Lymph_Node.h5ad")python -m spatialflow.cli init-config --output config.yaml
python -m spatialflow.cli init-config config.yamlpython -m spatialflow.cli --helppython examples/basic_workflow.py
#or
python examples/advanced_workflow.pypython -m spatialflow.cli run <.h5ad file path> --config config.yaml --output-dir spatialflow_outputpython -m spatialflow.cli visualize spatialflow_output/data/*.h5ad -o spatialflow_output/figuresDr. Rezwanuzzaman Laskar