simspace 0.1.0__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.
- simspace-0.1.0/LICENSE +21 -0
- simspace-0.1.0/PKG-INFO +87 -0
- simspace-0.1.0/README.md +63 -0
- simspace-0.1.0/pyproject.toml +32 -0
- simspace-0.1.0/setup.cfg +4 -0
- simspace-0.1.0/setup.py +35 -0
- simspace-0.1.0/simspace/__init__.py +2 -0
- simspace-0.1.0/simspace/core.py +950 -0
- simspace-0.1.0/simspace/initialize/initialize.py +41 -0
- simspace-0.1.0/simspace/initialize/neighbors.py +66 -0
- simspace-0.1.0/simspace/niche.py +209 -0
- simspace-0.1.0/simspace/omics.py +394 -0
- simspace-0.1.0/simspace/plot.py +86 -0
- simspace-0.1.0/simspace/spatial.py +291 -0
- simspace-0.1.0/simspace/util.py +281 -0
- simspace-0.1.0/simspace.egg-info/PKG-INFO +87 -0
- simspace-0.1.0/simspace.egg-info/SOURCES.txt +21 -0
- simspace-0.1.0/simspace.egg-info/dependency_links.txt +1 -0
- simspace-0.1.0/simspace.egg-info/requires.txt +13 -0
- simspace-0.1.0/simspace.egg-info/top_level.txt +1 -0
- simspace-0.1.0/tests/test_core.py +12 -0
- simspace-0.1.0/tests/test_omics.py +50 -0
- simspace-0.1.0/tests/test_util.py +52 -0
simspace-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tianxiao Zhao
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the โSoftwareโ), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED โAS ISโ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
|
21
|
+
DEALINGS IN THE SOFTWARE.
|
simspace-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: simspace
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: SimSpace: a comprehensive in-silico spatial omics data simulation framework
|
|
5
|
+
Author: Tianxiao Zhao
|
|
6
|
+
License: MIT
|
|
7
|
+
Requires-Python: >=3.10
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Requires-Dist: numpy>=2.2.6
|
|
11
|
+
Requires-Dist: scipy>=1.15.2
|
|
12
|
+
Requires-Dist: pandas>=2.3.1
|
|
13
|
+
Requires-Dist: matplotlib>=3.10.3
|
|
14
|
+
Requires-Dist: seaborn>=0.13.2
|
|
15
|
+
Requires-Dist: scikit-learn>=1.7.0
|
|
16
|
+
Requires-Dist: colorcet>=3.1.0
|
|
17
|
+
Requires-Dist: esda>=2.7.1
|
|
18
|
+
Requires-Dist: libpysal>=4.12.1
|
|
19
|
+
Requires-Dist: umap-learn>=0.5.9
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest; extra == "dev"
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
Dynamic: requires-python
|
|
24
|
+
|
|
25
|
+
# SimSpace
|
|
26
|
+
|
|
27
|
+
**SimSpace** is a Python framework for simulating spatial omics data with realistic cellular distributions and tissue organization. Designed for benchmarking spatial analysis methods, SimSpace enables generation of synthetic datasets that preserve spatial autocorrelation, cell-cell interactions, and reference-based spatial layouts using a Markov Random Field (MRF) model.
|
|
28
|
+
|
|
29
|
+
## ๐ฆ Installation
|
|
30
|
+
|
|
31
|
+
To install the latest version of SimSpace, we recommend using conda to setup the environment:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
git clone https://github.com/TianxiaoNYU/simspace.git
|
|
35
|
+
cd simspace
|
|
36
|
+
conda env create -f environment.yml
|
|
37
|
+
conda activate simspace
|
|
38
|
+
pip install -e .
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### ๐งฌ Setting up the R environment
|
|
42
|
+
|
|
43
|
+
To reproduce the R environment required for SimSpace omics simulation:
|
|
44
|
+
|
|
45
|
+
1. Make sure you have R (version 4.4 or compatible) installed.
|
|
46
|
+
2. From the project folder:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
cd simspace/R
|
|
50
|
+
Rscript -e 'install.packages("renv"); renv::restore()'
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## ๐ Quick Start
|
|
54
|
+
|
|
55
|
+
Hereโs a basic example to simulate a 2D tissue with 4 cell types:
|
|
56
|
+
|
|
57
|
+
```python
|
|
58
|
+
from simspace import util, spatial
|
|
59
|
+
|
|
60
|
+
# Define simulation parameters
|
|
61
|
+
params = util.generate_random_parameters(
|
|
62
|
+
n_group=3,
|
|
63
|
+
n_state=8,
|
|
64
|
+
seed=42)
|
|
65
|
+
|
|
66
|
+
# Run simulation
|
|
67
|
+
sim = util.sim_from_params(
|
|
68
|
+
params,
|
|
69
|
+
shape=(50, 50),
|
|
70
|
+
num_iteration=4,
|
|
71
|
+
n_iter=6,
|
|
72
|
+
custom_neighbor=spatial.generate_offsets(3, 'manhattan'),
|
|
73
|
+
seed=42
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
# Visualize
|
|
77
|
+
sim.plot()
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## ๐โโ๏ธ About
|
|
81
|
+
|
|
82
|
+
Developed by Tianxiao Zhao at NYU Grossman School of Medicine. Should you have any questions, please contact Tianxiao Zhao at Tianxiao.Zhao@nyulangone.org
|
|
83
|
+
|
|
84
|
+
## ๐ References
|
|
85
|
+
If you use SimSpace in your work, please cite:
|
|
86
|
+
|
|
87
|
+
|
simspace-0.1.0/README.md
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# SimSpace
|
|
2
|
+
|
|
3
|
+
**SimSpace** is a Python framework for simulating spatial omics data with realistic cellular distributions and tissue organization. Designed for benchmarking spatial analysis methods, SimSpace enables generation of synthetic datasets that preserve spatial autocorrelation, cell-cell interactions, and reference-based spatial layouts using a Markov Random Field (MRF) model.
|
|
4
|
+
|
|
5
|
+
## ๐ฆ Installation
|
|
6
|
+
|
|
7
|
+
To install the latest version of SimSpace, we recommend using conda to setup the environment:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
git clone https://github.com/TianxiaoNYU/simspace.git
|
|
11
|
+
cd simspace
|
|
12
|
+
conda env create -f environment.yml
|
|
13
|
+
conda activate simspace
|
|
14
|
+
pip install -e .
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### ๐งฌ Setting up the R environment
|
|
18
|
+
|
|
19
|
+
To reproduce the R environment required for SimSpace omics simulation:
|
|
20
|
+
|
|
21
|
+
1. Make sure you have R (version 4.4 or compatible) installed.
|
|
22
|
+
2. From the project folder:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
cd simspace/R
|
|
26
|
+
Rscript -e 'install.packages("renv"); renv::restore()'
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## ๐ Quick Start
|
|
30
|
+
|
|
31
|
+
Hereโs a basic example to simulate a 2D tissue with 4 cell types:
|
|
32
|
+
|
|
33
|
+
```python
|
|
34
|
+
from simspace import util, spatial
|
|
35
|
+
|
|
36
|
+
# Define simulation parameters
|
|
37
|
+
params = util.generate_random_parameters(
|
|
38
|
+
n_group=3,
|
|
39
|
+
n_state=8,
|
|
40
|
+
seed=42)
|
|
41
|
+
|
|
42
|
+
# Run simulation
|
|
43
|
+
sim = util.sim_from_params(
|
|
44
|
+
params,
|
|
45
|
+
shape=(50, 50),
|
|
46
|
+
num_iteration=4,
|
|
47
|
+
n_iter=6,
|
|
48
|
+
custom_neighbor=spatial.generate_offsets(3, 'manhattan'),
|
|
49
|
+
seed=42
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
# Visualize
|
|
53
|
+
sim.plot()
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## ๐โโ๏ธ About
|
|
57
|
+
|
|
58
|
+
Developed by Tianxiao Zhao at NYU Grossman School of Medicine. Should you have any questions, please contact Tianxiao Zhao at Tianxiao.Zhao@nyulangone.org
|
|
59
|
+
|
|
60
|
+
## ๐ References
|
|
61
|
+
If you use SimSpace in your work, please cite:
|
|
62
|
+
|
|
63
|
+
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "simspace"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "SimSpace: a comprehensive in-silico spatial omics data simulation framework"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = { text = "MIT" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Tianxiao Zhao" }
|
|
14
|
+
]
|
|
15
|
+
dependencies = [
|
|
16
|
+
'numpy >=2.2.6',
|
|
17
|
+
'scipy >=1.15.2',
|
|
18
|
+
'pandas >=2.3.1',
|
|
19
|
+
'matplotlib >=3.10.3',
|
|
20
|
+
'seaborn >=0.13.2',
|
|
21
|
+
'scikit-learn >=1.7.0',
|
|
22
|
+
'colorcet >=3.1.0',
|
|
23
|
+
'esda >=2.7.1',
|
|
24
|
+
'libpysal >=4.12.1',
|
|
25
|
+
'umap-learn >=0.5.9'
|
|
26
|
+
]
|
|
27
|
+
|
|
28
|
+
[project.optional-dependencies]
|
|
29
|
+
dev = ["pytest"]
|
|
30
|
+
|
|
31
|
+
[tool.setuptools.packages.find]
|
|
32
|
+
include = ["simspace", "simspace.*"]
|
simspace-0.1.0/setup.cfg
ADDED
simspace-0.1.0/setup.py
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="simspace",
|
|
8
|
+
version="0.1.0",
|
|
9
|
+
description="SimSpace: a comprehensive in-silico spatial omics data simulation framework",
|
|
10
|
+
long_description=long_description,
|
|
11
|
+
long_description_content_type="text/markdown",
|
|
12
|
+
author="Tianxiao Zhao",
|
|
13
|
+
packages=find_packages(include=["simspace", "simspace.*"]),
|
|
14
|
+
install_requires=[
|
|
15
|
+
'numpy >=2.2.6',
|
|
16
|
+
'scipy >=1.15.2',
|
|
17
|
+
'pandas >=2.3.1',
|
|
18
|
+
'matplotlib >=3.10.3',
|
|
19
|
+
'seaborn >=0.13.2',
|
|
20
|
+
'scikit-learn >=1.7.0',
|
|
21
|
+
'colorcet >=3.1.0',
|
|
22
|
+
'esda >=2.7.1',
|
|
23
|
+
'libpysal >=4.12.1',
|
|
24
|
+
'umap-learn >=0.5.9'
|
|
25
|
+
],
|
|
26
|
+
extras_require={
|
|
27
|
+
"dev": ["pytest"]
|
|
28
|
+
},
|
|
29
|
+
python_requires=">=3.10",
|
|
30
|
+
classifiers=[
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"License :: OSI Approved :: MIT License",
|
|
33
|
+
"Operating System :: OS Independent",
|
|
34
|
+
],
|
|
35
|
+
)
|