Skip to content

Commit 7cdf361

Browse files
committed
📌 v0.2.1 release
1 parent 53d6b29 commit 7cdf361

31 files changed

+3497
-2185
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
# ignore the special file
2-
**.ipynb linguist-vendored
2+
**.ipynb linguist-vendored
3+
**.R linguist-vendored
4+
** .Rprofile linguist-vendored

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ jobs:
3030
sudo apt install -y libxml2-utils pandoc
3131
curl -sSL https://install.python-poetry.org | python3 -
3232
pip install --upgrade pip
33-
pip install -e ".[torch]"
34-
pip install -e ".[pyg,docs,dev]"
33+
pip install -e ".[docs, dev]"
34+
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
3535
3636
- name: Build documentation
3737
run: |

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@ jobs:
2121
run: |
2222
curl -sSL https://install.python-poetry.org | python3 -
2323
pip install --upgrade pip
24-
pip install -e ".[torch]"
25-
pip install -e ".[pyg,docs,dev]"
24+
pip install -e ".[docs, dev]"
25+
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
26+
2627
2728
- name: Build package
2829
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*.arrow
1919
*Weights
2020
*.sqlite
21+
*.svg
22+
*.gz
23+
*.whl
2124

2225
# folder
2326
**/conda/

README.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,33 @@ docker pull huhansan666666/slat:latest
4646
> **Note**
4747
> Installing `scSLAT` within a new [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) is recommended.
4848
49-
First, we create a clean environment and install `scSLAT` from PyPI. We need install dependency `torch` before install `pyg`.
49+
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.
5050

5151
> **Warning**
5252
> old NVIDIA driver may raise error, please update NVIDIA driver to the latest version.
5353
5454
```bash
5555
conda create -n scSLAT python=3.8 -y && conda activate scSLAT
56-
pip install "scSLAT[torch]"
57-
pip install "scSLAT[pyg]"
56+
pip install scSLAT
57+
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
5858
```
5959

60-
> **Note**
61-
> Some dependencies such as `torch-scatter` need to compile from source, which may take a long time. Please refer our solution to accelerate the install [here](https://slat.readthedocs.io/en/latest/install.html)
62-
6360
### Development version
6461
For development purpose, clone this repo and install:
6562

6663
```bash
6764
git clone git@github.com:gao-lab/SLAT.git
6865
cd SLAT
69-
pip install -e ".[torch]"
70-
pip install -e ".[pyg,dev,doc]"
66+
pip install -e ".[dev,docs]"
67+
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
7168
```
7269

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

7673

7774
## Reproduce manuscript results
78-
1. Please follow the [`env/README.md`](env/README.md) to install all dependencies. Please checkout the repository to v0.2.0 before install `scSLAT`:
79-
2. Download and pre-process data follow the [`data/README.md`](data/README.md)
75+
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`.
76+
2. Download and pre-process data follow the [`data/README.md`](data/README.md).
8077
3. Whole benchmark and evaluation procedure can be found in [`/benchmark`](benchmark/README.md) and [`/evaluation`](evaluation/README.md), respectively.
8178
4. Every case study is recorded in the [`/case`](case/README.md) directory in the form of jupyter notebook.

benchmark/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ results*/
44
split/
55
multi/
66
results_bak/
7-
figures/
7+
figures/
8+
hetero/

benchmark/analysis/3d_analysis.ipynb

Lines changed: 157 additions & 16 deletions
Large diffs are not rendered by default.

benchmark/analysis/benchmark_analysis.ipynb

Lines changed: 23 additions & 23 deletions
Large diffs are not rendered by default.

benchmark/analysis/celltype_region_analysis.ipynb

Lines changed: 262 additions & 7 deletions
Large diffs are not rendered by default.

benchmark/analysis/neighbor_celltype.ipynb

Lines changed: 61 additions & 46 deletions
Large diffs are not rendered by default.

benchmark/analysis/scalability_analysis.ipynb

Lines changed: 863 additions & 69 deletions
Large diffs are not rendered by default.

benchmark/analysis/split_analysis.ipynb

Lines changed: 288 additions & 12 deletions
Large diffs are not rendered by default.

case/mouse_development/11.5-12.5.ipynb

Lines changed: 238 additions & 814 deletions
Large diffs are not rendered by default.

case/mouse_development/Dupliecate.ipynb

Lines changed: 414 additions & 0 deletions
Large diffs are not rendered by default.

case/spatial_cross_platform/SLAT.ipynb

Lines changed: 115 additions & 42 deletions
Large diffs are not rendered by default.

case/sptatial_multi-omics/3.SLAT_alignment.ipynb

Lines changed: 28 additions & 16 deletions
Large diffs are not rendered by default.

case/visium_xenium/STAGATE.ipynb

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,19 @@
7979
"language": "python",
8080
"name": "stagate_pyg"
8181
},
82-
"orig_nbformat": 4
82+
"language_info": {
83+
"codemirror_mode": {
84+
"name": "ipython",
85+
"version": 3
86+
},
87+
"file_extension": ".py",
88+
"mimetype": "text/x-python",
89+
"name": "python",
90+
"nbconvert_exporter": "python",
91+
"pygments_lexer": "ipython3",
92+
"version": "3.8.13"
93+
}
8394
},
8495
"nbformat": 4,
85-
"nbformat_minor": 2
96+
"nbformat_minor": 4
8697
}

case/visium_xenium/Volcano_plot.ipynb

Lines changed: 230 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,230 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 1,
6+
"id": "7eef7d2f-cc7f-4ab7-bd03-c242ea7ad280",
7+
"metadata": {},
8+
"outputs": [
9+
{
10+
"name": "stderr",
11+
"output_type": "stream",
12+
"text": [
13+
"Loading required package: ggplot2\n",
14+
"\n",
15+
"Loading required package: ggrepel\n",
16+
"\n",
17+
"Registered S3 methods overwritten by 'ggalt':\n",
18+
" method from \n",
19+
" grid.draw.absoluteGrob ggplot2\n",
20+
" grobHeight.absoluteGrob ggplot2\n",
21+
" grobWidth.absoluteGrob ggplot2\n",
22+
" grobX.absoluteGrob ggplot2\n",
23+
" grobY.absoluteGrob ggplot2\n",
24+
"\n",
25+
"── \u001b[1mAttaching packages\u001b[22m ─────────────────────────────────────────────────────────────────────────────── tidyverse 1.3.2 ──\n",
26+
"\u001b[32m✔\u001b[39m \u001b[34mtibble \u001b[39m 3.1.8 \u001b[32m✔\u001b[39m \u001b[34mdplyr \u001b[39m 1.0.10\n",
27+
"\u001b[32m✔\u001b[39m \u001b[34mtidyr \u001b[39m 1.2.1 \u001b[32m✔\u001b[39m \u001b[34mstringr\u001b[39m 1.5.0 \n",
28+
"\u001b[32m✔\u001b[39m \u001b[34mreadr \u001b[39m 2.1.3 \u001b[32m✔\u001b[39m \u001b[34mforcats\u001b[39m 0.5.2 \n",
29+
"\u001b[32m✔\u001b[39m \u001b[34mpurrr \u001b[39m 1.0.0 \n",
30+
"── \u001b[1mConflicts\u001b[22m ────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──\n",
31+
"\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mfilter()\u001b[39m masks \u001b[34mstats\u001b[39m::filter()\n",
32+
"\u001b[31m✖\u001b[39m \u001b[34mdplyr\u001b[39m::\u001b[32mlag()\u001b[39m masks \u001b[34mstats\u001b[39m::lag()\n"
33+
]
34+
}
35+
],
36+
"source": [
37+
"setwd('../../')\n",
38+
"source('.Rprofile')\n",
39+
"setwd('./case/visium_xenium')\n",
40+
"\n",
41+
"library(EnhancedVolcano)\n",
42+
"library(tidyverse)"
43+
]
44+
},
45+
{
46+
"cell_type": "code",
47+
"execution_count": 2,
48+
"id": "e2d0b05f-f1bf-49d0-bd83-3d5d1df4b600",
49+
"metadata": {},
50+
"outputs": [
51+
{
52+
"name": "stderr",
53+
"output_type": "stream",
54+
"text": [
55+
"\u001b[1m\u001b[22mNew names:\n",
56+
"\u001b[36m•\u001b[39m `` -> `...1`\n",
57+
"\u001b[1mRows: \u001b[22m\u001b[34m18056\u001b[39m \u001b[1mColumns: \u001b[22m\u001b[34m9\u001b[39m\n",
58+
"\u001b[36m──\u001b[39m \u001b[1mColumn specification\u001b[22m \u001b[36m────────────────────────────────────────────────────────────────────────────────────────────────\u001b[39m\n",
59+
"\u001b[1mDelimiter:\u001b[22m \",\"\n",
60+
"\u001b[31mchr\u001b[39m (2): No_name, Yes_name\n",
61+
"\u001b[32mdbl\u001b[39m (7): ...1, No_pval, No_logf, No_scor, Yes_pval, Yes_logf, Yes_scor\n",
62+
"\n",
63+
"\u001b[36mℹ\u001b[39m Use `spec()` to retrieve the full column specification for this data.\n",
64+
"\u001b[36mℹ\u001b[39m Specify the column types or set `show_col_types = FALSE` to quiet this message.\n",
65+
"Warning message:\n",
66+
"“Setting row names on a tibble is deprecated.”\n"
67+
]
68+
}
69+
],
70+
"source": [
71+
"hvg <- read_csv('../../data/visium/breast/hvg_align.csv')\n",
72+
"hvg <- hvg[,c('Yes_name','Yes_pval','Yes_logf','Yes_scor')]\n",
73+
"rownames(hvg) <- hvg[['Yes_name']]\n",
74+
"colnames(hvg) <- c('Name','adj.Pval','logFC2','Score')"
75+
]
76+
},
77+
{
78+
"cell_type": "code",
79+
"execution_count": 4,
80+
"id": "d6f16112-c341-4bb3-8145-61cc9b83f946",
81+
"metadata": {},
82+
"outputs": [],
83+
"source": [
84+
"# top 25\n",
85+
"top25 <- hvg %>% filter(logFC2 > 1.5 & adj.Pval < 0.05) %>% arrange(-Score) %>% head(25) \n",
86+
"top25 <- as.vector(top25$Name)"
87+
]
88+
},
89+
{
90+
"cell_type": "code",
91+
"execution_count": 5,
92+
"id": "760219ac-3db1-4e5b-a8c9-4df9c57df114",
93+
"metadata": {
94+
"tags": []
95+
},
96+
"outputs": [
97+
{
98+
"data": {
99+
"text/html": [
100+
"<style>\n",
101+
".list-inline {list-style: none; margin:0; padding: 0}\n",
102+
".list-inline>li {display: inline-block}\n",
103+
".list-inline>li:not(:last-child)::after {content: \"\\00b7\"; padding: 0 .5ex}\n",
104+
"</style>\n",
105+
"<ol class=list-inline><li>'STC2'</li><li>'TRH'</li><li>'CACNG4'</li><li>'TMEM47'</li><li>'MUCL1'</li><li>'RIMS4'</li><li>'AFF3'</li><li>'CPB1'</li><li>'MAGED2'</li><li>'STARD10'</li><li>'NOS1AP'</li><li>'NEK10'</li><li>'LDLRAD3'</li><li>'PHGR1'</li><li>'MAPT'</li><li>'EREG'</li><li>'IFI27'</li><li>'LAMA3'</li><li>'SULT2B1'</li><li>'TBC1D9'</li><li>'ADCY1'</li><li>'KIAA1324'</li><li>'AUTS2'</li><li>'FAM3B'</li><li>'MCCC2'</li></ol>\n"
106+
],
107+
"text/latex": [
108+
"\\begin{enumerate*}\n",
109+
"\\item 'STC2'\n",
110+
"\\item 'TRH'\n",
111+
"\\item 'CACNG4'\n",
112+
"\\item 'TMEM47'\n",
113+
"\\item 'MUCL1'\n",
114+
"\\item 'RIMS4'\n",
115+
"\\item 'AFF3'\n",
116+
"\\item 'CPB1'\n",
117+
"\\item 'MAGED2'\n",
118+
"\\item 'STARD10'\n",
119+
"\\item 'NOS1AP'\n",
120+
"\\item 'NEK10'\n",
121+
"\\item 'LDLRAD3'\n",
122+
"\\item 'PHGR1'\n",
123+
"\\item 'MAPT'\n",
124+
"\\item 'EREG'\n",
125+
"\\item 'IFI27'\n",
126+
"\\item 'LAMA3'\n",
127+
"\\item 'SULT2B1'\n",
128+
"\\item 'TBC1D9'\n",
129+
"\\item 'ADCY1'\n",
130+
"\\item 'KIAA1324'\n",
131+
"\\item 'AUTS2'\n",
132+
"\\item 'FAM3B'\n",
133+
"\\item 'MCCC2'\n",
134+
"\\end{enumerate*}\n"
135+
],
136+
"text/markdown": [
137+
"1. 'STC2'\n",
138+
"2. 'TRH'\n",
139+
"3. 'CACNG4'\n",
140+
"4. 'TMEM47'\n",
141+
"5. 'MUCL1'\n",
142+
"6. 'RIMS4'\n",
143+
"7. 'AFF3'\n",
144+
"8. 'CPB1'\n",
145+
"9. 'MAGED2'\n",
146+
"10. 'STARD10'\n",
147+
"11. 'NOS1AP'\n",
148+
"12. 'NEK10'\n",
149+
"13. 'LDLRAD3'\n",
150+
"14. 'PHGR1'\n",
151+
"15. 'MAPT'\n",
152+
"16. 'EREG'\n",
153+
"17. 'IFI27'\n",
154+
"18. 'LAMA3'\n",
155+
"19. 'SULT2B1'\n",
156+
"20. 'TBC1D9'\n",
157+
"21. 'ADCY1'\n",
158+
"22. 'KIAA1324'\n",
159+
"23. 'AUTS2'\n",
160+
"24. 'FAM3B'\n",
161+
"25. 'MCCC2'\n",
162+
"\n",
163+
"\n"
164+
],
165+
"text/plain": [
166+
" [1] \"STC2\" \"TRH\" \"CACNG4\" \"TMEM47\" \"MUCL1\" \"RIMS4\" \n",
167+
" [7] \"AFF3\" \"CPB1\" \"MAGED2\" \"STARD10\" \"NOS1AP\" \"NEK10\" \n",
168+
"[13] \"LDLRAD3\" \"PHGR1\" \"MAPT\" \"EREG\" \"IFI27\" \"LAMA3\" \n",
169+
"[19] \"SULT2B1\" \"TBC1D9\" \"ADCY1\" \"KIAA1324\" \"AUTS2\" \"FAM3B\" \n",
170+
"[25] \"MCCC2\" "
171+
]
172+
},
173+
"metadata": {},
174+
"output_type": "display_data"
175+
}
176+
],
177+
"source": [
178+
"top25"
179+
]
180+
},
181+
{
182+
"cell_type": "code",
183+
"execution_count": 21,
184+
"id": "af31222e-4ef7-4b41-a7e3-da4db650aa06",
185+
"metadata": {},
186+
"outputs": [],
187+
"source": [
188+
"options(repr.plot.width=13, repr.plot.height=12)\n",
189+
"p1 <- EnhancedVolcano(hvg, lab = rownames(hvg), x = 'logFC2', y= 'adj.Pval', xlim = c(-6,6), ylim = c(0,6), FCcutoff = 1.5, pCutoff = 0.05, labSize =7,axisLabSize =24,\n",
190+
" colAlpha = 1,\n",
191+
" xlab = 'log2 fold change', ylab = 'log10 adjust P.value',\n",
192+
" # selectLab = top25,\n",
193+
" # col = c(\"grey30\", \"grey30\", \"grey30\", \"red2\"),\n",
194+
" # drawConnectors = TRUE,\n",
195+
" title = '', subtitle ='',\n",
196+
" pointSize = c(ifelse((hvg$\"logFC2\">1.5 |hvg$\"logFC2\"< -1.5) & hvg$\"adj.Pval\"<0.05 , 2.5, 1.5)),\n",
197+
" legendLabels =c('NS','log2FC only','adj.P only','Significant'),\n",
198+
" legendPosition = 'right',\n",
199+
" legendLabSize = 22)"
200+
]
201+
},
202+
{
203+
"cell_type": "code",
204+
"execution_count": 24,
205+
"id": "a0cd6eb7-9738-42a6-9cec-74a7efee1afb",
206+
"metadata": {},
207+
"outputs": [],
208+
"source": [
209+
"ggsave('./volcano.svg',p1, width = 13, height = 12)"
210+
]
211+
}
212+
],
213+
"metadata": {
214+
"kernelspec": {
215+
"display_name": "slat_r",
216+
"language": "R",
217+
"name": "slat_r"
218+
},
219+
"language_info": {
220+
"codemirror_mode": "r",
221+
"file_extension": ".r",
222+
"mimetype": "text/x-r-source",
223+
"name": "R",
224+
"pygments_lexer": "r",
225+
"version": "4.1.3"
226+
}
227+
},
228+
"nbformat": 4,
229+
"nbformat_minor": 5
230+
}

0 commit comments

Comments
 (0)