Skip to content

Commit

Permalink
📝 Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
xiachenrui committed Dec 20, 2023
1 parent 5d3c59b commit 8d49e76
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 134 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
curl -sSL https://install.python-poetry.org | python3 -
pip install --upgrade pip
pip install -e ".[docs, dev]"
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
pip install pyg_lib torch_scatter==2.1.1 torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
- name: Build documentation
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ jobs:

- name: Install dependencies
run: |
sudo apt update
sudo apt install -y libxml2-utils pandoc
curl -sSL https://install.python-poetry.org | python3 -
pip install --upgrade pip
pip install -e ".[docs, dev]"
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
pip install pyg_lib torch_scatter==2.1.1 torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cpu.html
- name: Build package
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,21 @@
[![stars-badge](https://img.shields.io/github/stars/gao-lab/SLAT?logo=GitHub&color=yellow)](https://github.com/gao-lab/SLAT/stargazers)
[![DOI](http://img.shields.io/badge/DOI-10.1038-B31B1B.svg)](https://doi.org/10.1038/s41467-023-43105-5)
[![dev-badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/xiachenrui/bc835db052fde5bd731a09270b42006c/raw/slat_version.json)](https://gist.github.com/xiachenrui/bc835db052fde5bd731a09270b42006c)
[![build-badge](https://github.com/gao-lab/SLAT/actions/workflows/build.yml/badge.svg)](https://github.com/gao-lab/SLAT/actions/workflows/build.yml)
[![license-badge](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![docs-badge](https://readthedocs.org/projects/slat/badge/?version=latest)](https://slat.readthedocs.io/en/latest/?badge=latest)
[![pypi-badge](https://img.shields.io/pypi/v/scslat)](https://pypi.org/project/scslat)
<!-- [![conda-badge](https://anaconda.org/bioconda/<name>/badges/version.svg)](https://anaconda.org/bioconda/<name>) -->


# scSLAT: single cell spatial alignment tools
**scSLAT** package implements the **SLAT** (**S**patial **L**inked **A**lignment **T**ool) model to align single cell spatial omics data.

<div align="center">

[Installation](#Installation)[Tutorial](#Tutorial)[Publication](https://www.nature.com/articles/s41467-023-43105-5)

</div>

**scSLAT** package implements the **SLAT** (**S**patial **L**inked **A**lignment **T**ool) model to align single cell spatial omics data. For more details, please check out our [publication](https://www.nature.com/articles/s41467-023-43105-5).

![Model architecture](docs/_static/Model.png)

Expand Down Expand Up @@ -43,18 +51,19 @@ docker pull huhansan666666/slat:0.2.1
```

### PyPI
> **Note**
> [!NOTE]
> Installing `scSLAT` within a new [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) is recommended.
First, we create a clean environment and install `scSLAT` from PyPI. Then we also need install dependencies for `pyg` manually. We default install with CUDA 11.7. Please refer [here](https://pytorch-geometric.readthedocs.io/en/latest/install/installation.html#quick-start) for CPU version or different CUDA versions.

> **Warning**
> [!WARNING]
> old NVIDIA driver may raise error, please update NVIDIA driver to the latest version.
```bash
conda create -n scSLAT python=3.8 -y && conda activate scSLAT
pip install scSLAT
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu117.html
python -c "import torch; print(torch.__version__)"
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu117.html # replace torch and CUDA version to yours
```

### Development version
Expand All @@ -67,9 +76,6 @@ pip install -e ".[dev,docs]"
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.0.0+cu117.html
```

### Conda (Ongoing)
We plan to provide a conda package of `scSLAT` in the near future.


## Reproduce manuscript results
1. Please follow the [`env/README.md`](env/README.md) to install all dependencies. Please checkout the repository to v0.2.1 before install `scSLAT`.
Expand Down
16 changes: 8 additions & 8 deletions docs/tutorials.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

``SLAT`` has a wide range of application scenarios in spatial alignment, especially in heterogeneous alignment. We provide following tutorials for you to get started with it.

## Pre-match (Recommended)
We recommend you to pre-match your data before alignment, which can significantly improve the alignment performance.

```{eval-rst}
.. nbgallery::
tutorials/pre_match.ipynb
```

## Basic Usage

### Two slices alignment
Expand Down Expand Up @@ -29,12 +37,4 @@ In this tutorial, we focus on finding dynamic regions in embryo development via
.. nbgallery::
tutorials/cross_technology.ipynb
tutorials/times_series.ipynb
```

## Pre-match (Optional)
We show how does pre-match function work in this tutorial.

```{eval-rst}
.. nbgallery::
tutorials/pre_match.ipynb
```
210 changes: 99 additions & 111 deletions docs/tutorials/cross_technology.ipynb

Large diffs are not rendered by default.

16 changes: 12 additions & 4 deletions docs/tutorials/times_series.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,15 @@
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"Matplotlib created a temporary config/cache directory at /tmp/matplotlib-alvj89z4 because the default path (/home/xiacr/.cache/matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing.\n"
]
}
],
"source": [
"import os\n",
"\n",
Expand Down Expand Up @@ -48,8 +56,8 @@
"metadata": {},
"outputs": [],
"source": [
"adata1 = sc.read_h5ad('E115_Stereo.h5ad')\n",
"adata2 = sc.read_h5ad('E125_Stereo.h5ad')"
"adata1 = sc.read_h5ad('adata1.h5ad')\n",
"adata2 = sc.read_h5ad('adata2.h5ad')"
]
},
{
Expand Down Expand Up @@ -1674,7 +1682,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13 | packaged by conda-forge | (default, Mar 25 2022, 06:04:18) \n[GCC 10.3.0]"
"version": "3.8.0"
},
"toc-autonumbering": true,
"vscode": {
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "scSLAT"
packages = [{include = "scSLAT"}]
version = "0.2.1"
version = "0.2.2"
description = "A graph deep learning based tool to align single cell spatial omics data"
readme = "README.md"
license = "MIT"
Expand Down

0 comments on commit 8d49e76

Please sign in to comment.