spatialsnake 0.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- spatialsnake-0.0.1/LICENSE +9 -0
- spatialsnake-0.0.1/MANIFEST.in +12 -0
- spatialsnake-0.0.1/PKG-INFO +289 -0
- spatialsnake-0.0.1/README.md +201 -0
- spatialsnake-0.0.1/packages.txt +178 -0
- spatialsnake-0.0.1/pyproject.toml +43 -0
- spatialsnake-0.0.1/requirements-extended.txt +23 -0
- spatialsnake-0.0.1/requirements.txt +49 -0
- spatialsnake-0.0.1/setup.cfg +4 -0
- spatialsnake-0.0.1/setup.py +49 -0
- spatialsnake-0.0.1/spatialsnake/__init__.py +0 -0
- spatialsnake-0.0.1/spatialsnake/command_line.py +715 -0
- spatialsnake-0.0.1/spatialsnake/config.yaml +69 -0
- spatialsnake-0.0.1/spatialsnake/workflow/Snakefile +589 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/advance_analysis.yaml +83 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/annotation.yaml +47 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/annotation_help.yaml +20 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/clustering.yaml +24 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/compare_stage.yaml +43 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/integrate.yaml +68 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/merge.yaml +12 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/preprocess.yaml +23 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/reclustering.yaml +12 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/splitting.yaml +21 -0
- spatialsnake-0.0.1/spatialsnake/workflow/envs/transform.yaml +12 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/export_cluster_csv.py +84 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/get_sample.py +343 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/legacy_anndata.py +546 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/merfish_utils.py +173 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/merge.py +252 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/pca_choosing.py +35 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/plot.py +484 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/splitting.py +280 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/stereoseq_selection.py +144 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/stereoseq_spec.py +42 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/stereoseq_v8.py +463 -0
- spatialsnake-0.0.1/spatialsnake/workflow/function/transform.py +189 -0
- spatialsnake-0.0.1/spatialsnake/workflow/get_sample.smk +187 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/RCTD.smk +51 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/advance_analysis.smk +24 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/annotation_help.smk +106 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/cell2Location_run.smk +71 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/cellPhoneDB.smk +97 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/cluster.smk +66 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/compare_LR.smk +52 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/compare_gene.smk +50 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/enrich.smk +36 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/integrate.smk +125 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/mannul.smk +58 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/merge.smk +43 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/preprocess.smk +81 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/py_senic.smk +87 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/reannotation.smk +48 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/reclustering.smk +34 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/run_banksy.smk +29 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/run_cellcharter.smk +39 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/run_cellchat.smk +48 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/run_liana.smk +56 -0
- spatialsnake-0.0.1/spatialsnake/workflow/rules/run_slice.smk +22 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/Cellchat.R +550 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/DEG_visualize.R +110 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/DEseq2.py +174 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/Multi-cellchat.py +0 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/QC.py +176 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/RCTD.R +581 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/RCTD_visualize.py +255 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/advance_analyze.py +230 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/cell2Location.py +389 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/cell2locate_visualize.py +344 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/cellchat_compare.R +353 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/cellphoneDB.py +189 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/cellphoneDB_visualize.py +186 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/cluster_visualize.py +275 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/clustering.py +195 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/diffent_analysis.R +768 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/enrichment.R +729 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/h5ad_to_seurat.R +62 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/install_packages.R +91 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/mannul_annotation.py +294 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/preprocessing.py +261 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/pyscenic_numpy_compat.py +73 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/pysenic.py +90 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/pysenic_visualize.py +221 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/reannotation.py +318 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/reclustering.py +157 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/run_banksy.py +270 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/run_cellcharter.py +373 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/run_liana.py +241 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/seurat_to_h5ad.R +21 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/slice_out.py +0 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/spatial_in.py +608 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/spatial_in_multiple.py +439 -0
- spatialsnake-0.0.1/spatialsnake/workflow/scripts/subset.py +25 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/PKG-INFO +289 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/SOURCES.txt +98 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/dependency_links.txt +1 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/entry_points.txt +2 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/not-zip-safe +1 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/requires.txt +65 -0
- spatialsnake-0.0.1/spatialsnake.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
Copyright © 2025 Zhenghao Lin
|
|
3
|
+
----------------------------------------------------
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
include *.txt
|
|
2
|
+
include Snakefile
|
|
3
|
+
recursive-include spatialsnake *.R
|
|
4
|
+
recursive-include spatialsnake *.py
|
|
5
|
+
recursive-include spatialsnake *.sh
|
|
6
|
+
recursive-include spatialsnake *.smk
|
|
7
|
+
recursive-include spatialsnake Snakefile
|
|
8
|
+
recursive-include spatialsnake *.yaml
|
|
9
|
+
prune build
|
|
10
|
+
prune dist
|
|
11
|
+
global-exclude __pycache__
|
|
12
|
+
global-exclude *.py[cod]
|
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: spatialsnake
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: A Python package for spatial transcriptomics analysis workflows.
|
|
5
|
+
Home-page: https://github.com/l-zh007/spatialsnake
|
|
6
|
+
Author: lzh
|
|
7
|
+
Author-email: lzh <1714074171@qq.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/l-zh007/spatialsnake
|
|
10
|
+
Project-URL: Issues, https://github.com/l-zh007/spatialsnake/issues
|
|
11
|
+
Keywords: spatial transcriptomics,bioinformatics,snakemake,spatialdata
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
|
|
17
|
+
Requires-Python: >=3.12,<3.13
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Requires-Dist: setuptools<81,>=80.9.0
|
|
21
|
+
Requires-Dist: spatialdata==0.5.0
|
|
22
|
+
Requires-Dist: spatialdata-io==0.3.0
|
|
23
|
+
Requires-Dist: spatialdata-plot==0.2.11
|
|
24
|
+
Requires-Dist: squidpy==1.6.5
|
|
25
|
+
Requires-Dist: napari-spatialdata==0.5.7
|
|
26
|
+
Requires-Dist: numpy==2.2.6
|
|
27
|
+
Requires-Dist: scanpy==1.10.4
|
|
28
|
+
Requires-Dist: anndata==0.12.0
|
|
29
|
+
Requires-Dist: umap-learn==0.5.7
|
|
30
|
+
Requires-Dist: pandas==2.2.3
|
|
31
|
+
Requires-Dist: scipy==1.13.1
|
|
32
|
+
Requires-Dist: scikit-learn==1.7.2
|
|
33
|
+
Requires-Dist: numba==0.62.1
|
|
34
|
+
Requires-Dist: llvmlite==0.45.1
|
|
35
|
+
Requires-Dist: shapely==2.1.1
|
|
36
|
+
Requires-Dist: matplotlib==3.9.4
|
|
37
|
+
Requires-Dist: seaborn==0.13.2
|
|
38
|
+
Requires-Dist: plotnine==0.15.0
|
|
39
|
+
Requires-Dist: Pillow==11.3.0
|
|
40
|
+
Requires-Dist: cell2location==0.1.5
|
|
41
|
+
Requires-Dist: scvi-tools==1.4.0
|
|
42
|
+
Requires-Dist: zarr==2.18.7
|
|
43
|
+
Requires-Dist: h5py==3.14.0
|
|
44
|
+
Requires-Dist: tifffile==2025.8.28
|
|
45
|
+
Requires-Dist: imageio==2.37.0
|
|
46
|
+
Requires-Dist: ome-zarr==0.11.1
|
|
47
|
+
Requires-Dist: statsmodels==0.14.5
|
|
48
|
+
Requires-Dist: Pint==0.25
|
|
49
|
+
Requires-Dist: pyarrow==21.0.0
|
|
50
|
+
Requires-Dist: click==8.3.0
|
|
51
|
+
Requires-Dist: typer==0.16.0
|
|
52
|
+
Requires-Dist: docopt==0.6.2
|
|
53
|
+
Requires-Dist: PyYAML==6.0.3
|
|
54
|
+
Requires-Dist: geosketch==1.3
|
|
55
|
+
Requires-Dist: cell2location==0.1.5
|
|
56
|
+
Requires-Dist: geopandas==1.1.1
|
|
57
|
+
Requires-Dist: pydeseq2==0.5.2
|
|
58
|
+
Requires-Dist: harmonypy==0.0.10
|
|
59
|
+
Requires-Dist: igraph==0.11.9
|
|
60
|
+
Requires-Dist: louvain==0.8.2
|
|
61
|
+
Provides-Extra: extended
|
|
62
|
+
Requires-Dist: scikit-misc==0.5.2; extra == "extended"
|
|
63
|
+
Requires-Dist: dask-image==2024.5.3; extra == "extended"
|
|
64
|
+
Requires-Dist: ipython==9.5.0; extra == "extended"
|
|
65
|
+
Requires-Dist: pyogrio==0.12.1; extra == "extended"
|
|
66
|
+
Requires-Dist: pooch==1.8.2; extra == "extended"
|
|
67
|
+
Requires-Dist: dask==2024.11.2; extra == "extended"
|
|
68
|
+
Requires-Dist: dask-expr==1.1.19; extra == "extended"
|
|
69
|
+
Requires-Dist: pims==0.7; extra == "extended"
|
|
70
|
+
Requires-Dist: xarray==2025.1.2; extra == "extended"
|
|
71
|
+
Requires-Dist: pyro-ppl==1.9.1; extra == "extended"
|
|
72
|
+
Requires-Dist: pyro-api==0.1.1; extra == "extended"
|
|
73
|
+
Requires-Dist: opt-einsum==3.3.0; extra == "extended"
|
|
74
|
+
Requires-Dist: cellphonedb==5.0.1; extra == "extended"
|
|
75
|
+
Requires-Dist: torch==2.8.0; extra == "extended"
|
|
76
|
+
Requires-Dist: pytorch-lightning==2.5.5; extra == "extended"
|
|
77
|
+
Requires-Dist: cellcharter==0.3.5; extra == "extended"
|
|
78
|
+
Requires-Dist: cytoolz==1.0.1; extra == "extended"
|
|
79
|
+
Requires-Dist: ktplotspy==0.3.3; extra == "extended"
|
|
80
|
+
Requires-Dist: liana==1.6.1; extra == "extended"
|
|
81
|
+
Requires-Dist: loompy==3.0.8; extra == "extended"
|
|
82
|
+
Requires-Dist: pyscenic==0.12.1; extra == "extended"
|
|
83
|
+
Requires-Dist: leidenalg; extra == "extended"
|
|
84
|
+
Dynamic: author
|
|
85
|
+
Dynamic: home-page
|
|
86
|
+
Dynamic: license-file
|
|
87
|
+
Dynamic: requires-python
|
|
88
|
+
|
|
89
|
+
# Spatialsnake :
|
|
90
|
+
|
|
91
|
+
[](https://snakemake.github.io)
|
|
92
|
+
[](https://docs.conda.io/en/latest/)
|
|
93
|
+
[](https://snakemake.github.io/snakemake-workflow-catalog/docs/workflows/<owner>/<repo>)
|
|
94
|
+
|
|
95
|
+
A Snakemake workflow for spatial transcriptomics powered by spatialdata framework
|
|
96
|
+
|
|
97
|
+
for more detail of the usage of the pipeline
|
|
98
|
+
**please read the [documentation](https://spatialsnake-tutorial.readthedocs.io/en/latest/)**
|
|
99
|
+
|
|
100
|
+
- [Snakemake workflow: `spatialsnake`](#snakemake-workflow-name)
|
|
101
|
+
- [Usage](#usage)
|
|
102
|
+
- [Deployment options](#deployment-options)
|
|
103
|
+
- [lzh](#authors)
|
|
104
|
+
- [References](#references)
|
|
105
|
+
- [TODO](#todo)
|
|
106
|
+
|
|
107
|
+
## ** How to install spatialsnake **
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
### prepare the environment first.
|
|
111
|
+
```bash
|
|
112
|
+
## Create conda environment with the environment.yml file in github code page
|
|
113
|
+
|
|
114
|
+
conda env create -f environment.yml -n spatialsnake_env ## [or setting your own conda env name]
|
|
115
|
+
|
|
116
|
+
conda activate spatialsnake_env
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
### install the spatialsnake.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
git clone https://github.com/l-zh007/spatialsnake.git
|
|
124
|
+
|
|
125
|
+
cd spatialsnake
|
|
126
|
+
pip install -e . # or [pip install .] 优选-e开发者模式
|
|
127
|
+
|
|
128
|
+
spatialsnake -h
|
|
129
|
+
spatialsnake install-packages # (Install coordinate R packages)
|
|
130
|
+
|
|
131
|
+
mkdir project
|
|
132
|
+
cd project
|
|
133
|
+
|
|
134
|
+
start your analysis with file[sample.txt] and spatialdata in [data/*] and output dir [results]
|
|
135
|
+
|
|
136
|
+
please make sure your spatialdata folder name in [data/] in accordance with sample_name in [sample.txt]
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
## Examples:
|
|
141
|
+
Run only one step of ["integrate","preprocess","clustering","annotion_help","annotion","compare_analyze","advance_analysis"]
|
|
142
|
+
spatialsnake <sample_channal> sample.txt <data_type> --option=<option_name> [other_params]
|
|
143
|
+
|
|
144
|
+
IF you want to run with integrate multiple sample:
|
|
145
|
+
|
|
146
|
+
Run compare_analysis
|
|
147
|
+
spatialsnake compare_analysis sample.txt <data_type> --option=<option_name>
|
|
148
|
+
|
|
149
|
+
Run all basic steps on single sample (default behavior)
|
|
150
|
+
spatialsnake <sample_channal> sample.txt <data_type> --option=all
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
IF you want to run with setting your own params:
|
|
154
|
+
|
|
155
|
+
spatialsnake produce-file [--option=<analysis_option>]
|
|
156
|
+
spatialsnake <sample_channal> sample.txt <data_type> --option=<option_name> --config-file <*.yaml>
|
|
157
|
+
|
|
158
|
+
We produce some useful_tool to help you analysis.
|
|
159
|
+
|
|
160
|
+
Split integrated data with barcode
|
|
161
|
+
spatialsnake useful_tool integrated_data.zarr --data_barcode B_cell
|
|
162
|
+
|
|
163
|
+
Split integrated data with image coordinate
|
|
164
|
+
spatialsnake useful_tool integrated_data.zarr --max_x --min_x --max_y --min_y2
|
|
165
|
+
|
|
166
|
+
Install coordinate R packages
|
|
167
|
+
spatialsnake install-packages
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
## Usage:
|
|
171
|
+
spatialsnake <command> <INPUT> <TYPE> [--option=<analysis_option>] [options]
|
|
172
|
+
spatialsnake useful_tool [--option=<ways>] <INPUT> [options]
|
|
173
|
+
spatialsnake produce-file [--option=<analysis_option>]
|
|
174
|
+
spatialsnake install-packages
|
|
175
|
+
spatialsnake (-h | --help)
|
|
176
|
+
spatialsnake --version
|
|
177
|
+
|
|
178
|
+
commands:
|
|
179
|
+
single_analysis Process single spatial transcriptomics dataset (runs all basic steps except advance_analysis by default)
|
|
180
|
+
compare_analysis Compare multiple spatial transcriptomics datasets
|
|
181
|
+
|
|
182
|
+
analysis option:
|
|
183
|
+
integrate
|
|
184
|
+
preprocess
|
|
185
|
+
clustering
|
|
186
|
+
annotion_help
|
|
187
|
+
annotion
|
|
188
|
+
compare_analyze
|
|
189
|
+
advance_analysis
|
|
190
|
+
|
|
191
|
+
Type Arguments:
|
|
192
|
+
visium
|
|
193
|
+
visium_segment
|
|
194
|
+
visium_HD
|
|
195
|
+
xenium
|
|
196
|
+
Merfish
|
|
197
|
+
slide_seq
|
|
198
|
+
|
|
199
|
+
INPUT Arguments:
|
|
200
|
+
sample.txt
|
|
201
|
+
annotion.txt
|
|
202
|
+
filter_list
|
|
203
|
+
|
|
204
|
+
Basic Configuration:
|
|
205
|
+
--configfile <FILE> Configuration file in YAML format [default: config.yaml].
|
|
206
|
+
|
|
207
|
+
Integration Step Options (--option integrate):
|
|
208
|
+
--cells_boundaries <BOOL> xenium key in load in data [default: False].
|
|
209
|
+
--nucleus_boundaries <BOOL> xenium key in load in data [default: False].
|
|
210
|
+
--nucleus_labels <BOOL> xenium key in load in data [default: False].
|
|
211
|
+
--morphology_mip <BOOL> xenium key in load in data [default: False].
|
|
212
|
+
|
|
213
|
+
Preprocessing Step Options (--option preprocess):
|
|
214
|
+
--min_cells <INT> Minimum spots per gene [default: 3].
|
|
215
|
+
--min_genes <INT> Minimum genes per spot [default: 200].
|
|
216
|
+
--seg_filter <BOOL> to seg filter the differnet sample dataset when command compare_anaysis [default: False].
|
|
217
|
+
--filter_list <FILE> filename of filter [default: False]
|
|
218
|
+
--batch_method <TEXT> batch method for multiple sample analysis [default: harmony]
|
|
219
|
+
--sketch <BOOL> whether use sketch method to analysis [default: False]
|
|
220
|
+
|
|
221
|
+
Clustering Step Options (--option clustering):
|
|
222
|
+
--resolution <FLOAT> Cluster resolution [default: 0.5].
|
|
223
|
+
--cluster_algorithm <TEXT> Clustering algorithm [default: leiden].
|
|
224
|
+
--tsene <BOOL> umap [default:False].
|
|
225
|
+
--n_clusters <INT> kmeans params of cluster [default: 15].
|
|
226
|
+
|
|
227
|
+
Annotation Help Step Options (--option annotion_help):
|
|
228
|
+
--markers_algorithm <TEXT> Automatically detect marker genes [default: wilcoxon].
|
|
229
|
+
--spacies <TEXT> Automatically detect marker genes [default: human].
|
|
230
|
+
|
|
231
|
+
Compare_analyze option Options (--option compare_analysis)
|
|
232
|
+
--cell_focus <TEXT> celltype you focus to compare in different sample[default: None].
|
|
233
|
+
--compare_algorithm <TEXT> compare analysys [default: DEseq2].
|
|
234
|
+
Annotation option Options (--option annotion):
|
|
235
|
+
--annotation-file <FILE> Annotation file for cell typing (required for annotion step)
|
|
236
|
+
--anno_algorithm <TEXT> Annotation method [default: mannul].
|
|
237
|
+
--shape_type <TEXT> Automatically detect marker genes [default: cell_boundaries].
|
|
238
|
+
--image_type <TEXT> Automatically detect marker genes [default: hires].
|
|
239
|
+
--device <TEXT> cpu or GPU accelerate [default: cuda].
|
|
240
|
+
|
|
241
|
+
Advanced Analysis option Options (--option advance_analysis):
|
|
242
|
+
--runpipe <TEXT> Run which analysis analysis.[default: advance_analysis]
|
|
243
|
+
--senic_input <DIR> Input file for PySCENIC analysis.[default: sample.zarr]
|
|
244
|
+
--motifs_input <FILE> PySCENIC database directory.[default: motifs-v9-nr.hgnc-m0.001-o0.0.tbl]
|
|
245
|
+
--feather_input <FILE> path for necessary file of pyscenic.[default: hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather]
|
|
246
|
+
--tfs_input <FILE> path for necessary file of pyscenic.[default: hs_hgnc_tfs.txt]
|
|
247
|
+
--count-data <TEXT> gene type for cellPhoneDB [default: hgnc_symbol].
|
|
248
|
+
--threads <INT> workers for cellphoneDB [default: 8].
|
|
249
|
+
--output_name <TEXT> output name for cellPhoneDB [default: Normal].
|
|
250
|
+
useful_tool params Option:
|
|
251
|
+
--output_zarr_path <FILE> output dir for splitted file [default: results]
|
|
252
|
+
--split_by <TEXT> slice out with the barcode in table[anndata] .obs [default: clusters]
|
|
253
|
+
--max_x <FLOAT> coordinate of image boundaries [default: 0]
|
|
254
|
+
--min_x <FLOAT> coordinate of image boundaries [default: 2000]
|
|
255
|
+
--max_y <FLOAT> coordinate of image boundaries [default: 2000]
|
|
256
|
+
--min_y <FLOAT> coordinate of image boundaries [default: 0]
|
|
257
|
+
|
|
258
|
+
General Options:
|
|
259
|
+
-j <INT>, --jobs <INT> Number of CPU cores [default: 32].
|
|
260
|
+
--results_folder <DIR> Output directory [default: results].
|
|
261
|
+
|
|
262
|
+
Utility Options:
|
|
263
|
+
--install-packages Install required packages.
|
|
264
|
+
-u, --unlock Unlock stalled workflow.
|
|
265
|
+
-r, --remove Remove all output files.
|
|
266
|
+
-d, --dry Dry run (simulate execution).
|
|
267
|
+
-h, --help Show this help message.
|
|
268
|
+
--version Show version.
|
|
269
|
+
|
|
270
|
+
|
|
271
|
+
## Authors
|
|
272
|
+
|
|
273
|
+
- Firstname Lastname
|
|
274
|
+
- Affiliation
|
|
275
|
+
- ORCID profile
|
|
276
|
+
- home page
|
|
277
|
+
|
|
278
|
+
## References
|
|
279
|
+
|
|
280
|
+
> Köster, J., Mölder, F., Jablonski, K. P., Letcher, B., Hall, M. B., Tomkins-Tinch, C. H., Sochat, V., Forster, J., Lee, S., Twardziok, S. O., Kanitz, A., Wilm, A., Holtgrewe, M., Rahmann, S., & Nahnsen, S. _Sustainable data analysis with Snakemake_. F1000Research, 10:33, 10, 33, **2021**. https://doi.org/10.12688/f1000research.29032.2.
|
|
281
|
+
|
|
282
|
+
## TODO
|
|
283
|
+
|
|
284
|
+
- Replace `<owner>` and `<repo>` everywhere in the template with the correct user name/organization, and the repository name. The workflow will be automatically added to the [snakemake workflow catalog](https://snakemake.github.io/snakemake-workflow-catalog/index.html) once it is publicly available on Github.
|
|
285
|
+
- Replace `<name>` with the workflow name (can be the same as `<repo>`).
|
|
286
|
+
- Replace `<description>` with a description of what the workflow does.
|
|
287
|
+
- Update the [deployment](#deployment-options), [authors](#authors) and [references](#references) sections.
|
|
288
|
+
- Update the `README.md` badges. Add or remove badges for `conda`/`singularity`/`apptainer` usage depending on the workflow's [deployment](#deployment-options) options.
|
|
289
|
+
- Do not forget to also adjust the configuration-specific `config/README.md` file.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
# Spatialsnake :
|
|
2
|
+
|
|
3
|
+
[](https://snakemake.github.io)
|
|
4
|
+
[](https://docs.conda.io/en/latest/)
|
|
5
|
+
[](https://snakemake.github.io/snakemake-workflow-catalog/docs/workflows/<owner>/<repo>)
|
|
6
|
+
|
|
7
|
+
A Snakemake workflow for spatial transcriptomics powered by spatialdata framework
|
|
8
|
+
|
|
9
|
+
for more detail of the usage of the pipeline
|
|
10
|
+
**please read the [documentation](https://spatialsnake-tutorial.readthedocs.io/en/latest/)**
|
|
11
|
+
|
|
12
|
+
- [Snakemake workflow: `spatialsnake`](#snakemake-workflow-name)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
- [Deployment options](#deployment-options)
|
|
15
|
+
- [lzh](#authors)
|
|
16
|
+
- [References](#references)
|
|
17
|
+
- [TODO](#todo)
|
|
18
|
+
|
|
19
|
+
## ** How to install spatialsnake **
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### prepare the environment first.
|
|
23
|
+
```bash
|
|
24
|
+
## Create conda environment with the environment.yml file in github code page
|
|
25
|
+
|
|
26
|
+
conda env create -f environment.yml -n spatialsnake_env ## [or setting your own conda env name]
|
|
27
|
+
|
|
28
|
+
conda activate spatialsnake_env
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### install the spatialsnake.
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
git clone https://github.com/l-zh007/spatialsnake.git
|
|
36
|
+
|
|
37
|
+
cd spatialsnake
|
|
38
|
+
pip install -e . # or [pip install .] 优选-e开发者模式
|
|
39
|
+
|
|
40
|
+
spatialsnake -h
|
|
41
|
+
spatialsnake install-packages # (Install coordinate R packages)
|
|
42
|
+
|
|
43
|
+
mkdir project
|
|
44
|
+
cd project
|
|
45
|
+
|
|
46
|
+
start your analysis with file[sample.txt] and spatialdata in [data/*] and output dir [results]
|
|
47
|
+
|
|
48
|
+
please make sure your spatialdata folder name in [data/] in accordance with sample_name in [sample.txt]
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
## Examples:
|
|
53
|
+
Run only one step of ["integrate","preprocess","clustering","annotion_help","annotion","compare_analyze","advance_analysis"]
|
|
54
|
+
spatialsnake <sample_channal> sample.txt <data_type> --option=<option_name> [other_params]
|
|
55
|
+
|
|
56
|
+
IF you want to run with integrate multiple sample:
|
|
57
|
+
|
|
58
|
+
Run compare_analysis
|
|
59
|
+
spatialsnake compare_analysis sample.txt <data_type> --option=<option_name>
|
|
60
|
+
|
|
61
|
+
Run all basic steps on single sample (default behavior)
|
|
62
|
+
spatialsnake <sample_channal> sample.txt <data_type> --option=all
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
IF you want to run with setting your own params:
|
|
66
|
+
|
|
67
|
+
spatialsnake produce-file [--option=<analysis_option>]
|
|
68
|
+
spatialsnake <sample_channal> sample.txt <data_type> --option=<option_name> --config-file <*.yaml>
|
|
69
|
+
|
|
70
|
+
We produce some useful_tool to help you analysis.
|
|
71
|
+
|
|
72
|
+
Split integrated data with barcode
|
|
73
|
+
spatialsnake useful_tool integrated_data.zarr --data_barcode B_cell
|
|
74
|
+
|
|
75
|
+
Split integrated data with image coordinate
|
|
76
|
+
spatialsnake useful_tool integrated_data.zarr --max_x --min_x --max_y --min_y2
|
|
77
|
+
|
|
78
|
+
Install coordinate R packages
|
|
79
|
+
spatialsnake install-packages
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## Usage:
|
|
83
|
+
spatialsnake <command> <INPUT> <TYPE> [--option=<analysis_option>] [options]
|
|
84
|
+
spatialsnake useful_tool [--option=<ways>] <INPUT> [options]
|
|
85
|
+
spatialsnake produce-file [--option=<analysis_option>]
|
|
86
|
+
spatialsnake install-packages
|
|
87
|
+
spatialsnake (-h | --help)
|
|
88
|
+
spatialsnake --version
|
|
89
|
+
|
|
90
|
+
commands:
|
|
91
|
+
single_analysis Process single spatial transcriptomics dataset (runs all basic steps except advance_analysis by default)
|
|
92
|
+
compare_analysis Compare multiple spatial transcriptomics datasets
|
|
93
|
+
|
|
94
|
+
analysis option:
|
|
95
|
+
integrate
|
|
96
|
+
preprocess
|
|
97
|
+
clustering
|
|
98
|
+
annotion_help
|
|
99
|
+
annotion
|
|
100
|
+
compare_analyze
|
|
101
|
+
advance_analysis
|
|
102
|
+
|
|
103
|
+
Type Arguments:
|
|
104
|
+
visium
|
|
105
|
+
visium_segment
|
|
106
|
+
visium_HD
|
|
107
|
+
xenium
|
|
108
|
+
Merfish
|
|
109
|
+
slide_seq
|
|
110
|
+
|
|
111
|
+
INPUT Arguments:
|
|
112
|
+
sample.txt
|
|
113
|
+
annotion.txt
|
|
114
|
+
filter_list
|
|
115
|
+
|
|
116
|
+
Basic Configuration:
|
|
117
|
+
--configfile <FILE> Configuration file in YAML format [default: config.yaml].
|
|
118
|
+
|
|
119
|
+
Integration Step Options (--option integrate):
|
|
120
|
+
--cells_boundaries <BOOL> xenium key in load in data [default: False].
|
|
121
|
+
--nucleus_boundaries <BOOL> xenium key in load in data [default: False].
|
|
122
|
+
--nucleus_labels <BOOL> xenium key in load in data [default: False].
|
|
123
|
+
--morphology_mip <BOOL> xenium key in load in data [default: False].
|
|
124
|
+
|
|
125
|
+
Preprocessing Step Options (--option preprocess):
|
|
126
|
+
--min_cells <INT> Minimum spots per gene [default: 3].
|
|
127
|
+
--min_genes <INT> Minimum genes per spot [default: 200].
|
|
128
|
+
--seg_filter <BOOL> to seg filter the differnet sample dataset when command compare_anaysis [default: False].
|
|
129
|
+
--filter_list <FILE> filename of filter [default: False]
|
|
130
|
+
--batch_method <TEXT> batch method for multiple sample analysis [default: harmony]
|
|
131
|
+
--sketch <BOOL> whether use sketch method to analysis [default: False]
|
|
132
|
+
|
|
133
|
+
Clustering Step Options (--option clustering):
|
|
134
|
+
--resolution <FLOAT> Cluster resolution [default: 0.5].
|
|
135
|
+
--cluster_algorithm <TEXT> Clustering algorithm [default: leiden].
|
|
136
|
+
--tsene <BOOL> umap [default:False].
|
|
137
|
+
--n_clusters <INT> kmeans params of cluster [default: 15].
|
|
138
|
+
|
|
139
|
+
Annotation Help Step Options (--option annotion_help):
|
|
140
|
+
--markers_algorithm <TEXT> Automatically detect marker genes [default: wilcoxon].
|
|
141
|
+
--spacies <TEXT> Automatically detect marker genes [default: human].
|
|
142
|
+
|
|
143
|
+
Compare_analyze option Options (--option compare_analysis)
|
|
144
|
+
--cell_focus <TEXT> celltype you focus to compare in different sample[default: None].
|
|
145
|
+
--compare_algorithm <TEXT> compare analysys [default: DEseq2].
|
|
146
|
+
Annotation option Options (--option annotion):
|
|
147
|
+
--annotation-file <FILE> Annotation file for cell typing (required for annotion step)
|
|
148
|
+
--anno_algorithm <TEXT> Annotation method [default: mannul].
|
|
149
|
+
--shape_type <TEXT> Automatically detect marker genes [default: cell_boundaries].
|
|
150
|
+
--image_type <TEXT> Automatically detect marker genes [default: hires].
|
|
151
|
+
--device <TEXT> cpu or GPU accelerate [default: cuda].
|
|
152
|
+
|
|
153
|
+
Advanced Analysis option Options (--option advance_analysis):
|
|
154
|
+
--runpipe <TEXT> Run which analysis analysis.[default: advance_analysis]
|
|
155
|
+
--senic_input <DIR> Input file for PySCENIC analysis.[default: sample.zarr]
|
|
156
|
+
--motifs_input <FILE> PySCENIC database directory.[default: motifs-v9-nr.hgnc-m0.001-o0.0.tbl]
|
|
157
|
+
--feather_input <FILE> path for necessary file of pyscenic.[default: hg38_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather]
|
|
158
|
+
--tfs_input <FILE> path for necessary file of pyscenic.[default: hs_hgnc_tfs.txt]
|
|
159
|
+
--count-data <TEXT> gene type for cellPhoneDB [default: hgnc_symbol].
|
|
160
|
+
--threads <INT> workers for cellphoneDB [default: 8].
|
|
161
|
+
--output_name <TEXT> output name for cellPhoneDB [default: Normal].
|
|
162
|
+
useful_tool params Option:
|
|
163
|
+
--output_zarr_path <FILE> output dir for splitted file [default: results]
|
|
164
|
+
--split_by <TEXT> slice out with the barcode in table[anndata] .obs [default: clusters]
|
|
165
|
+
--max_x <FLOAT> coordinate of image boundaries [default: 0]
|
|
166
|
+
--min_x <FLOAT> coordinate of image boundaries [default: 2000]
|
|
167
|
+
--max_y <FLOAT> coordinate of image boundaries [default: 2000]
|
|
168
|
+
--min_y <FLOAT> coordinate of image boundaries [default: 0]
|
|
169
|
+
|
|
170
|
+
General Options:
|
|
171
|
+
-j <INT>, --jobs <INT> Number of CPU cores [default: 32].
|
|
172
|
+
--results_folder <DIR> Output directory [default: results].
|
|
173
|
+
|
|
174
|
+
Utility Options:
|
|
175
|
+
--install-packages Install required packages.
|
|
176
|
+
-u, --unlock Unlock stalled workflow.
|
|
177
|
+
-r, --remove Remove all output files.
|
|
178
|
+
-d, --dry Dry run (simulate execution).
|
|
179
|
+
-h, --help Show this help message.
|
|
180
|
+
--version Show version.
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
## Authors
|
|
184
|
+
|
|
185
|
+
- Firstname Lastname
|
|
186
|
+
- Affiliation
|
|
187
|
+
- ORCID profile
|
|
188
|
+
- home page
|
|
189
|
+
|
|
190
|
+
## References
|
|
191
|
+
|
|
192
|
+
> Köster, J., Mölder, F., Jablonski, K. P., Letcher, B., Hall, M. B., Tomkins-Tinch, C. H., Sochat, V., Forster, J., Lee, S., Twardziok, S. O., Kanitz, A., Wilm, A., Holtgrewe, M., Rahmann, S., & Nahnsen, S. _Sustainable data analysis with Snakemake_. F1000Research, 10:33, 10, 33, **2021**. https://doi.org/10.12688/f1000research.29032.2.
|
|
193
|
+
|
|
194
|
+
## TODO
|
|
195
|
+
|
|
196
|
+
- Replace `<owner>` and `<repo>` everywhere in the template with the correct user name/organization, and the repository name. The workflow will be automatically added to the [snakemake workflow catalog](https://snakemake.github.io/snakemake-workflow-catalog/index.html) once it is publicly available on Github.
|
|
197
|
+
- Replace `<name>` with the workflow name (can be the same as `<repo>`).
|
|
198
|
+
- Replace `<description>` with a description of what the workflow does.
|
|
199
|
+
- Update the [deployment](#deployment-options), [authors](#authors) and [references](#references) sections.
|
|
200
|
+
- Update the `README.md` badges. Add or remove badges for `conda`/`singularity`/`apptainer` usage depending on the workflow's [deployment](#deployment-options) options.
|
|
201
|
+
- Do not forget to also adjust the configuration-specific `config/README.md` file.
|