SPACEc 0.0.7__tar.gz → 0.0.8__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.
- {spacec-0.0.7 → spacec-0.0.8}/PKG-INFO +6 -4
- {spacec-0.0.7 → spacec-0.0.8}/README.md +5 -3
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/0_tissue_extractor.ipynb +5 -18
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/1_cell_segmentation.ipynb +3 -10
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/2_preprocessing.ipynb +1 -0
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/3_cell_annotation_STELLAR.ipynb +4 -10
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/3_cell_annotation_ml.ipynb +4 -10
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/3_clustering.ipynb +5 -11
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/4_cell_neighborhood_analysis.ipynb +5 -11
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/5_distance_permutation_analysis.ipynb +4 -2
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/6_patch_proximity_analysis.ipynb +8 -13
- {spacec-0.0.7 → spacec-0.0.8}/notebooks/7_TissUUmaps.ipynb +9 -3
- {spacec-0.0.7 → spacec-0.0.8}/src/SPACEc.egg-info/PKG-INFO +6 -4
- {spacec-0.0.7 → spacec-0.0.8}/.coveragerc +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/.github/workflows/ci.yml +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/.gitignore +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/.isort.cfg +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/.pre-commit-config.yaml +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/.readthedocs.yml +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/AUTHORS.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/CHANGELOG.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/CONTRIBUTING.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/Docker/SPACEc_cpu +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/Docker/SPACEc_gpu +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/Docker/old/Dockerfile +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/Docker/old/tutorial.Dockerfile +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/Docker/old/tutorial_init.sh +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/LICENSE.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/TODO.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/Makefile +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/_static/.gitignore +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/authors.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/changelog.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/conf.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/contributing.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/index.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/license.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/overview.png +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/readme.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/requirements.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/docs/tutorials.md +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/environment.yml +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/pyproject.toml +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/setup.cfg +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/setup.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/SPACEc.egg-info/SOURCES.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/SPACEc.egg-info/dependency_links.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/SPACEc.egg-info/not-zip-safe +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/SPACEc.egg-info/requires.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/SPACEc.egg-info/top_level.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/__init__.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/_shared/segmentation.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/_shared/segmentation_unused.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/helperfunctions/__init__.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/helperfunctions/_general.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/helperfunctions/_qptiff_converter.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/plotting/__init__.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/plotting/_general.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/plotting/_qptiff_converter.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/plotting/_segmentation.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/preprocessing/__init__.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/preprocessing/_general.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/tools/__init__.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/tools/_general.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/tools/_qptiff_converter.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/src/spacec/tools/_segmentation.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/__init__.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/conftest.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/cellseg/reg001_X01_Y01_Z01_compensated.csv +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/cellseg/reg010_X01_Y01_Z01_compensated.csv +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/tonsil/1/adata_nn_2000.h5ad +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/tonsil/1/adata_nn_demo.h5ad +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/tonsil/1/adata_nn_demo_annotated.h5ad +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/tonsil/1/adata_nn_demo_annotated_cn.h5ad +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/tonsil/1/overlay_tonsil1.pickle +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/tonsil/1/seg_output_tonsil1.pickle +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/raw/S1121_Scan1_small.qptiff +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/raw/tonsil/1/reg010_X01_Y01_Z01.tif +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/raw/tonsil/celltype_markers +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/data/raw/tonsil/channelnames.txt +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_0_qptiff_converter.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_1_cell_segmentation.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_2_preprocessing.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_3_cell_annotation_STELLAR.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_3_cell_annotation_ml.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_3_clustering.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_3_clustering_gpu.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_4_cellular_neighborhood_analysis.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_5_distance_permutation_analysis.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_6_patch_proximity_analysis.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tests/test_7_TissUUmaps.py +0 -0
- {spacec-0.0.7 → spacec-0.0.8}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SPACEc
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: SPatial Analysis for CodEX data (SPACEc)
|
|
5
5
|
Home-page: https://github.com/yuqiyuqitan/SPACEc
|
|
6
6
|
Author: yuqiyuqitan
|
|
@@ -50,9 +50,12 @@ Requires-Dist: pytest-cov; extra == "testing"
|
|
|
50
50
|
[](https://spacec.readthedocs.io/en/latest/?badge=latest)
|
|
51
51
|

|
|
52
52
|
|
|
53
|
+
[Preprint](https://doi.org/10.1101/2024.06.29.601349): more detailed explanation on each steps in Supplementary Notes 2 (p13-24).
|
|
54
|
+
[Tutorial](https://spacec.readthedocs.io/en/latest/?badge=latest)
|
|
55
|
+
|
|
53
56
|
## Installation notes
|
|
54
57
|
|
|
55
|
-
**Note**:
|
|
58
|
+
**Note**: We currently only support Python==`3.9`. We are currently working on adding support for Macs with M1 and M2 chips following a recent update to some of our dependencies. Stay tuned for further updates!
|
|
56
59
|
|
|
57
60
|
We generally recommend to use a `conda` environment. It makes installing requirements like `graphviz` a lot easier.
|
|
58
61
|
|
|
@@ -83,7 +86,7 @@ pip install spacec
|
|
|
83
86
|
Example tonsil data on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)
|
|
84
87
|
|
|
85
88
|
### Docker
|
|
86
|
-
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/
|
|
89
|
+
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/r/tkempchen/spacec
|
|
87
90
|
|
|
88
91
|
```bash
|
|
89
92
|
#Run CPU version:
|
|
@@ -134,7 +137,6 @@ pip install torch_geometric
|
|
|
134
137
|
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cu121.html
|
|
135
138
|
```
|
|
136
139
|
|
|
137
|
-
|
|
138
140
|
## General outline of SPACEc analysis
|
|
139
141
|
|
|
140
142
|

|
|
@@ -3,9 +3,12 @@
|
|
|
3
3
|
[](https://spacec.readthedocs.io/en/latest/?badge=latest)
|
|
4
4
|

|
|
5
5
|
|
|
6
|
+
[Preprint](https://doi.org/10.1101/2024.06.29.601349): more detailed explanation on each steps in Supplementary Notes 2 (p13-24).
|
|
7
|
+
[Tutorial](https://spacec.readthedocs.io/en/latest/?badge=latest)
|
|
8
|
+
|
|
6
9
|
## Installation notes
|
|
7
10
|
|
|
8
|
-
**Note**:
|
|
11
|
+
**Note**: We currently only support Python==`3.9`. We are currently working on adding support for Macs with M1 and M2 chips following a recent update to some of our dependencies. Stay tuned for further updates!
|
|
9
12
|
|
|
10
13
|
We generally recommend to use a `conda` environment. It makes installing requirements like `graphviz` a lot easier.
|
|
11
14
|
|
|
@@ -36,7 +39,7 @@ pip install spacec
|
|
|
36
39
|
Example tonsil data on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)
|
|
37
40
|
|
|
38
41
|
### Docker
|
|
39
|
-
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/
|
|
42
|
+
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/r/tkempchen/spacec
|
|
40
43
|
|
|
41
44
|
```bash
|
|
42
45
|
#Run CPU version:
|
|
@@ -87,7 +90,6 @@ pip install torch_geometric
|
|
|
87
90
|
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cu121.html
|
|
88
91
|
```
|
|
89
92
|
|
|
90
|
-
|
|
91
93
|
## General outline of SPACEc analysis
|
|
92
94
|
|
|
93
95
|

|
|
@@ -40,22 +40,8 @@
|
|
|
40
40
|
"import scanpy as sc\n",
|
|
41
41
|
"import matplotlib\n",
|
|
42
42
|
"\n",
|
|
43
|
-
"warnings.filterwarnings('ignore')"
|
|
44
|
-
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
"cell_type": "markdown",
|
|
48
|
-
"metadata": {},
|
|
49
|
-
"source": [
|
|
50
|
-
"Set figure defaults for plotting"
|
|
51
|
-
]
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"cell_type": "code",
|
|
55
|
-
"execution_count": 9,
|
|
56
|
-
"metadata": {},
|
|
57
|
-
"outputs": [],
|
|
58
|
-
"source": [
|
|
43
|
+
"warnings.filterwarnings('ignore')\n",
|
|
44
|
+
"\n",
|
|
59
45
|
"sc.settings.set_figure_params(dpi=80, facecolor='white') \n",
|
|
60
46
|
"# set the default color map to viridis, the below paramters can be chanaged\n",
|
|
61
47
|
"matplotlib.rcParams[\"image.cmap\"] = 'viridis'"
|
|
@@ -67,6 +53,7 @@
|
|
|
67
53
|
"metadata": {},
|
|
68
54
|
"outputs": [],
|
|
69
55
|
"source": [
|
|
56
|
+
"# Specify the path to the data\n",
|
|
70
57
|
"root_path = \"/home/user/path/SPACEc/\" # replace with your path\n",
|
|
71
58
|
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
72
59
|
"\n",
|
|
@@ -81,8 +68,8 @@
|
|
|
81
68
|
"metadata": {},
|
|
82
69
|
"outputs": [],
|
|
83
70
|
"source": [
|
|
84
|
-
"#
|
|
85
|
-
"file = 'tonsil_tma.tif' # the file name of the image\n",
|
|
71
|
+
"# specify the image file for extraction\n",
|
|
72
|
+
"file = 'tonsil_tma.tif' # the file name of the image, can be qptiff or tiff\n",
|
|
86
73
|
"file_path = data_path + file # the path to the image"
|
|
87
74
|
]
|
|
88
75
|
},
|
|
@@ -48,16 +48,8 @@
|
|
|
48
48
|
"import warnings\n",
|
|
49
49
|
"import matplotlib\n",
|
|
50
50
|
"import pickle\n",
|
|
51
|
-
"warnings.filterwarnings('ignore')"
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"cell_type": "code",
|
|
56
|
-
"execution_count": 2,
|
|
57
|
-
"id": "2c3346dd",
|
|
58
|
-
"metadata": {},
|
|
59
|
-
"outputs": [],
|
|
60
|
-
"source": [
|
|
51
|
+
"warnings.filterwarnings('ignore')\n",
|
|
52
|
+
"\n",
|
|
61
53
|
"# set the default color map to viridis, the below paramters can be chanaged\n",
|
|
62
54
|
"matplotlib.rcParams[\"image.cmap\"] = 'viridis'"
|
|
63
55
|
]
|
|
@@ -69,6 +61,7 @@
|
|
|
69
61
|
"metadata": {},
|
|
70
62
|
"outputs": [],
|
|
71
63
|
"source": [
|
|
64
|
+
"# Specify the path to the data\n",
|
|
72
65
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
73
66
|
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
74
67
|
"\n",
|
|
@@ -51,7 +51,9 @@
|
|
|
51
51
|
"\n",
|
|
52
52
|
"# silencing warnings\n",
|
|
53
53
|
"import warnings\n",
|
|
54
|
-
"warnings.filterwarnings('ignore')"
|
|
54
|
+
"warnings.filterwarnings('ignore')\n",
|
|
55
|
+
"\n",
|
|
56
|
+
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
55
57
|
]
|
|
56
58
|
},
|
|
57
59
|
{
|
|
@@ -60,6 +62,7 @@
|
|
|
60
62
|
"metadata": {},
|
|
61
63
|
"outputs": [],
|
|
62
64
|
"source": [
|
|
65
|
+
"# Specify the path to the data\n",
|
|
63
66
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
64
67
|
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
65
68
|
"\n",
|
|
@@ -77,15 +80,6 @@
|
|
|
77
80
|
" Repo.clone_from(repo_url, STELLAR_path)"
|
|
78
81
|
]
|
|
79
82
|
},
|
|
80
|
-
{
|
|
81
|
-
"cell_type": "code",
|
|
82
|
-
"execution_count": 3,
|
|
83
|
-
"metadata": {},
|
|
84
|
-
"outputs": [],
|
|
85
|
-
"source": [
|
|
86
|
-
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
87
|
-
]
|
|
88
|
-
},
|
|
89
83
|
{
|
|
90
84
|
"cell_type": "markdown",
|
|
91
85
|
"metadata": {},
|
|
@@ -34,7 +34,9 @@
|
|
|
34
34
|
"\n",
|
|
35
35
|
"# silencing warnings\n",
|
|
36
36
|
"import warnings\n",
|
|
37
|
-
"warnings.filterwarnings('ignore')"
|
|
37
|
+
"warnings.filterwarnings('ignore')\n",
|
|
38
|
+
"\n",
|
|
39
|
+
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
38
40
|
]
|
|
39
41
|
},
|
|
40
42
|
{
|
|
@@ -43,6 +45,7 @@
|
|
|
43
45
|
"metadata": {},
|
|
44
46
|
"outputs": [],
|
|
45
47
|
"source": [
|
|
48
|
+
"# Specify the path to the data\n",
|
|
46
49
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
47
50
|
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
48
51
|
"\n",
|
|
@@ -51,15 +54,6 @@
|
|
|
51
54
|
"os.makedirs(output_dir, exist_ok=True)"
|
|
52
55
|
]
|
|
53
56
|
},
|
|
54
|
-
{
|
|
55
|
-
"cell_type": "code",
|
|
56
|
-
"execution_count": 5,
|
|
57
|
-
"metadata": {},
|
|
58
|
-
"outputs": [],
|
|
59
|
-
"source": [
|
|
60
|
-
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
61
|
-
]
|
|
62
|
-
},
|
|
63
57
|
{
|
|
64
58
|
"cell_type": "markdown",
|
|
65
59
|
"metadata": {},
|
|
@@ -49,7 +49,10 @@
|
|
|
49
49
|
"\n",
|
|
50
50
|
"# silencing warnings\n",
|
|
51
51
|
"import warnings\n",
|
|
52
|
-
"warnings.filterwarnings('ignore')"
|
|
52
|
+
"warnings.filterwarnings('ignore')\n",
|
|
53
|
+
"\n",
|
|
54
|
+
"plt.rc('axes', grid=False) # remove gridlines\n",
|
|
55
|
+
"sc.settings.set_figure_params(dpi=80, facecolor='white') # set dpi and background color for scanpy figures"
|
|
53
56
|
]
|
|
54
57
|
},
|
|
55
58
|
{
|
|
@@ -58,6 +61,7 @@
|
|
|
58
61
|
"metadata": {},
|
|
59
62
|
"outputs": [],
|
|
60
63
|
"source": [
|
|
64
|
+
"# Specify the path to the data\n",
|
|
61
65
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
62
66
|
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
63
67
|
"\n",
|
|
@@ -66,16 +70,6 @@
|
|
|
66
70
|
"os.makedirs(output_dir, exist_ok=True)"
|
|
67
71
|
]
|
|
68
72
|
},
|
|
69
|
-
{
|
|
70
|
-
"cell_type": "code",
|
|
71
|
-
"execution_count": 3,
|
|
72
|
-
"metadata": {},
|
|
73
|
-
"outputs": [],
|
|
74
|
-
"source": [
|
|
75
|
-
"plt.rc('axes', grid=False) # remove gridlines\n",
|
|
76
|
-
"sc.settings.set_figure_params(dpi=80, facecolor='white') # set dpi and background color for scanpy figures"
|
|
77
|
-
]
|
|
78
|
-
},
|
|
79
73
|
{
|
|
80
74
|
"cell_type": "code",
|
|
81
75
|
"execution_count": 4,
|
|
@@ -30,15 +30,8 @@
|
|
|
30
30
|
"\n",
|
|
31
31
|
"#import standard packages\n",
|
|
32
32
|
"import os\n",
|
|
33
|
-
"import scanpy as sc"
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"cell_type": "code",
|
|
38
|
-
"execution_count": 3,
|
|
39
|
-
"metadata": {},
|
|
40
|
-
"outputs": [],
|
|
41
|
-
"source": [
|
|
33
|
+
"import scanpy as sc\n",
|
|
34
|
+
"\n",
|
|
42
35
|
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
43
36
|
]
|
|
44
37
|
},
|
|
@@ -48,12 +41,13 @@
|
|
|
48
41
|
"metadata": {},
|
|
49
42
|
"outputs": [],
|
|
50
43
|
"source": [
|
|
44
|
+
"# Specify the path to the data\n",
|
|
51
45
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
52
46
|
"\n",
|
|
53
|
-
"data_path = root_path + '
|
|
47
|
+
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
54
48
|
"\n",
|
|
55
49
|
"# where you want to store the output\n",
|
|
56
|
-
"output_dir = root_path + '
|
|
50
|
+
"output_dir = root_path + 'example_data/output/'\n",
|
|
57
51
|
"os.makedirs(output_dir, exist_ok=True)"
|
|
58
52
|
]
|
|
59
53
|
},
|
|
@@ -55,12 +55,13 @@
|
|
|
55
55
|
"metadata": {},
|
|
56
56
|
"outputs": [],
|
|
57
57
|
"source": [
|
|
58
|
+
"# Specify the path to the data\n",
|
|
58
59
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
59
60
|
"\n",
|
|
60
|
-
"data_path = root_path + '
|
|
61
|
+
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
61
62
|
"\n",
|
|
62
63
|
"# where you want to store the output\n",
|
|
63
|
-
"output_dir = root_path + '
|
|
64
|
+
"output_dir = root_path + 'example_data/output/'\n",
|
|
64
65
|
"os.makedirs(output_dir, exist_ok=True)"
|
|
65
66
|
]
|
|
66
67
|
},
|
|
@@ -153,6 +154,7 @@
|
|
|
153
154
|
}
|
|
154
155
|
],
|
|
155
156
|
"source": [
|
|
157
|
+
"# compute the potential interactions\n",
|
|
156
158
|
"distance_pvals = sp.tl.identify_interactions(\n",
|
|
157
159
|
" adata = adata, # AnnData object\n",
|
|
158
160
|
" cellid = \"index\", # column that contains the cell id (set index if the cell id is the index of the dataframe)\n",
|
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
"\n",
|
|
44
44
|
"# silencing warnings\n",
|
|
45
45
|
"import warnings\n",
|
|
46
|
-
"warnings.filterwarnings('ignore')"
|
|
46
|
+
"warnings.filterwarnings('ignore')\n",
|
|
47
|
+
"\n",
|
|
48
|
+
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
47
49
|
]
|
|
48
50
|
},
|
|
49
51
|
{
|
|
@@ -52,24 +54,16 @@
|
|
|
52
54
|
"metadata": {},
|
|
53
55
|
"outputs": [],
|
|
54
56
|
"source": [
|
|
57
|
+
"# Specify the path to the data\n",
|
|
55
58
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
56
59
|
"\n",
|
|
57
|
-
"data_path = root_path + '
|
|
60
|
+
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
58
61
|
"\n",
|
|
59
62
|
"# where you want to store the output\n",
|
|
60
|
-
"output_dir = root_path + '
|
|
63
|
+
"output_dir = root_path + 'example_data/output/'\n",
|
|
61
64
|
"os.makedirs(output_dir, exist_ok=True)"
|
|
62
65
|
]
|
|
63
66
|
},
|
|
64
|
-
{
|
|
65
|
-
"cell_type": "code",
|
|
66
|
-
"execution_count": 3,
|
|
67
|
-
"metadata": {},
|
|
68
|
-
"outputs": [],
|
|
69
|
-
"source": [
|
|
70
|
-
"sc.settings.set_figure_params(dpi=80, facecolor='white')"
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
67
|
{
|
|
74
68
|
"cell_type": "code",
|
|
75
69
|
"execution_count": 4,
|
|
@@ -92,7 +86,8 @@
|
|
|
92
86
|
}
|
|
93
87
|
],
|
|
94
88
|
"source": [
|
|
95
|
-
"
|
|
89
|
+
"# read in the annotated anndata\n",
|
|
90
|
+
"adata = sc.read(output_dir + 'adata_nn_demo_annotated_cn.h5ad')\n",
|
|
96
91
|
"adata"
|
|
97
92
|
]
|
|
98
93
|
},
|
|
@@ -49,12 +49,14 @@
|
|
|
49
49
|
"metadata": {},
|
|
50
50
|
"outputs": [],
|
|
51
51
|
"source": [
|
|
52
|
+
"# Specify the path to the data\n",
|
|
52
53
|
"root_path = \"/home/user/path/SPACEc/\" # inset your own path\n",
|
|
53
54
|
"\n",
|
|
54
|
-
"data_path = root_path + '
|
|
55
|
+
"data_path = root_path + 'example_data/raw/' # where the data is stored\n",
|
|
55
56
|
"\n",
|
|
56
57
|
"# where you want to store the output\n",
|
|
57
|
-
"output_dir = root_path + '
|
|
58
|
+
"output_dir = root_path + 'example_data/output/'\n",
|
|
59
|
+
"\n",
|
|
58
60
|
"os.makedirs(output_dir, exist_ok=True)"
|
|
59
61
|
]
|
|
60
62
|
},
|
|
@@ -80,6 +82,7 @@
|
|
|
80
82
|
}
|
|
81
83
|
],
|
|
82
84
|
"source": [
|
|
85
|
+
"# read in the annotated anndata\n",
|
|
83
86
|
"adata = sc.read(output_dir + 'adata_nn_demo_annotated_cn.h5ad')\n",
|
|
84
87
|
"adata"
|
|
85
88
|
]
|
|
@@ -343,10 +346,13 @@
|
|
|
343
346
|
}
|
|
344
347
|
],
|
|
345
348
|
"source": [
|
|
349
|
+
"#create cache direction to store tissuumaps cache\n",
|
|
350
|
+
"os.makedirs(output_dir + \"cache\", exist_ok=True)\n",
|
|
351
|
+
"\n",
|
|
346
352
|
"image_list, csv_paths = sp.tl.tm_viewer(\n",
|
|
347
353
|
" adata,\n",
|
|
348
354
|
" images_pickle_path= output_dir + 'seg_output_tonsil2.pickle',\n",
|
|
349
|
-
" directory = \"
|
|
355
|
+
" directory = output_dir + \"cache\", # Or inset your own path where you want to cache your images for TM visualization (you can delete this once you are done with TM)\n",
|
|
350
356
|
" region_column = \"unique_region\",\n",
|
|
351
357
|
" region = \"reg002\",\n",
|
|
352
358
|
" xSelector = \"y\",\n",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: SPACEc
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.8
|
|
4
4
|
Summary: SPatial Analysis for CodEX data (SPACEc)
|
|
5
5
|
Home-page: https://github.com/yuqiyuqitan/SPACEc
|
|
6
6
|
Author: yuqiyuqitan
|
|
@@ -50,9 +50,12 @@ Requires-Dist: pytest-cov; extra == "testing"
|
|
|
50
50
|
[](https://spacec.readthedocs.io/en/latest/?badge=latest)
|
|
51
51
|

|
|
52
52
|
|
|
53
|
+
[Preprint](https://doi.org/10.1101/2024.06.29.601349): more detailed explanation on each steps in Supplementary Notes 2 (p13-24).
|
|
54
|
+
[Tutorial](https://spacec.readthedocs.io/en/latest/?badge=latest)
|
|
55
|
+
|
|
53
56
|
## Installation notes
|
|
54
57
|
|
|
55
|
-
**Note**:
|
|
58
|
+
**Note**: We currently only support Python==`3.9`. We are currently working on adding support for Macs with M1 and M2 chips following a recent update to some of our dependencies. Stay tuned for further updates!
|
|
56
59
|
|
|
57
60
|
We generally recommend to use a `conda` environment. It makes installing requirements like `graphviz` a lot easier.
|
|
58
61
|
|
|
@@ -83,7 +86,7 @@ pip install spacec
|
|
|
83
86
|
Example tonsil data on [dryad](https://datadryad.org/stash/share/OXTHu8fAybiINGD1S3tIVUIcUiG4nOsjjeWmrvJV-dQ)
|
|
84
87
|
|
|
85
88
|
### Docker
|
|
86
|
-
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/
|
|
89
|
+
If you run into an installation issue or want to run SPACEc in a containerized environment, we have created a Docker image for you to use SPACEc so that you don't have to install manually. You can find the SPACEc Docker image here: https://hub.docker.com/r/tkempchen/spacec
|
|
87
90
|
|
|
88
91
|
```bash
|
|
89
92
|
#Run CPU version:
|
|
@@ -134,7 +137,6 @@ pip install torch_geometric
|
|
|
134
137
|
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f https://data.pyg.org/whl/torch-2.3.0+cu121.html
|
|
135
138
|
```
|
|
136
139
|
|
|
137
|
-
|
|
138
140
|
## General outline of SPACEc analysis
|
|
139
141
|
|
|
140
142
|

|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/cellseg/reg001_X01_Y01_Z01_compensated.csv
RENAMED
|
File without changes
|
{spacec-0.0.7 → spacec-0.0.8}/tests/data/processed/cellseg/reg010_X01_Y01_Z01_compensated.csv
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|