FEAST-py 0.1.7__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.
- feast_py-0.1.7/LICENSE +19 -0
- feast_py-0.1.7/PKG-INFO +228 -0
- feast_py-0.1.7/README.md +190 -0
- feast_py-0.1.7/pyproject.toml +49 -0
- feast_py-0.1.7/setup.cfg +4 -0
- feast_py-0.1.7/setup.py +41 -0
- feast_py-0.1.7/src/FEAST/FEAST_core/APIs.py +711 -0
- feast_py-0.1.7/src/FEAST/FEAST_core/__init__.py +6 -0
- feast_py-0.1.7/src/FEAST/FEAST_core/parameter_cloud.py +492 -0
- feast_py-0.1.7/src/FEAST/FEAST_core/simulator.py +973 -0
- feast_py-0.1.7/src/FEAST/__init__.py +43 -0
- feast_py-0.1.7/src/FEAST/alignment/__init__.py +25 -0
- feast_py-0.1.7/src/FEAST/alignment/alignment_simulator.py +806 -0
- feast_py-0.1.7/src/FEAST/alignment/spatial_align_alter.py +415 -0
- feast_py-0.1.7/src/FEAST/deconvolution/__init__.py +32 -0
- feast_py-0.1.7/src/FEAST/deconvolution/deconvolution_simulator.py +403 -0
- feast_py-0.1.7/src/FEAST/deconvolution/generate_deconvolution.py +190 -0
- feast_py-0.1.7/src/FEAST/interpolation/__init__.py +28 -0
- feast_py-0.1.7/src/FEAST/interpolation/coordinate_generation.py +310 -0
- feast_py-0.1.7/src/FEAST/interpolation/count_generation.py +287 -0
- feast_py-0.1.7/src/FEAST/interpolation/interpolation_pipeline.py +306 -0
- feast_py-0.1.7/src/FEAST/interpolation/parameter_interpolation.py +369 -0
- feast_py-0.1.7/src/FEAST/modeling/Beta_mixture_model.py +414 -0
- feast_py-0.1.7/src/FEAST/modeling/StudentT_mixture_model.py +234 -0
- feast_py-0.1.7/src/FEAST/modeling/__init__.py +0 -0
- feast_py-0.1.7/src/FEAST/modeling/marginal_alteration.py +439 -0
- feast_py-0.1.7/src/FEAST_py.egg-info/PKG-INFO +228 -0
- feast_py-0.1.7/src/FEAST_py.egg-info/SOURCES.txt +29 -0
- feast_py-0.1.7/src/FEAST_py.egg-info/dependency_links.txt +1 -0
- feast_py-0.1.7/src/FEAST_py.egg-info/requires.txt +19 -0
- feast_py-0.1.7/src/FEAST_py.egg-info/top_level.txt +1 -0
feast_py-0.1.7/LICENSE
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) <year> <copyright holders>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
|
11
|
+
all copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
19
|
+
THE SOFTWARE.
|
feast_py-0.1.7/PKG-INFO
ADDED
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: FEAST-py
|
|
3
|
+
Version: 0.1.7
|
|
4
|
+
Summary: Spatial Transcriptomics Simulator
|
|
5
|
+
Home-page: https://github.com/maiziezhoulab/FEAST-sim
|
|
6
|
+
Author: Yiru CHEN
|
|
7
|
+
Author-email: Yiru CHEN <yiru.22@intl.zju.edu.cn>
|
|
8
|
+
License: MIT
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Operating System :: OS Independent
|
|
12
|
+
Requires-Python: >=3.8
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
License-File: LICENSE
|
|
15
|
+
Requires-Dist: alphashape>=1.3.1
|
|
16
|
+
Requires-Dist: anndata>=0.9.2
|
|
17
|
+
Requires-Dist: geomloss>=0.2.6
|
|
18
|
+
Requires-Dist: joblib>=1.4.2
|
|
19
|
+
Requires-Dist: matplotlib>=3.7.5
|
|
20
|
+
Requires-Dist: numba>=0.55.2
|
|
21
|
+
Requires-Dist: numpy>=1.22.4
|
|
22
|
+
Requires-Dist: pandas>=2.0.3
|
|
23
|
+
Requires-Dist: paste2>=1.0.1
|
|
24
|
+
Requires-Dist: scanpy>=1.9.8
|
|
25
|
+
Requires-Dist: scikit-learn>=1.2.1
|
|
26
|
+
Requires-Dist: scipy>=1.10.1
|
|
27
|
+
Requires-Dist: seaborn>=0.13.2
|
|
28
|
+
Requires-Dist: torch>=1.12.1
|
|
29
|
+
Requires-Dist: tqdm>=4.66.4
|
|
30
|
+
Requires-Dist: spateo-release==1.1.1
|
|
31
|
+
Requires-Dist: pydot>=4.0.1
|
|
32
|
+
Requires-Dist: pyvinecopulib>=0.7.5
|
|
33
|
+
Requires-Dist: thin-plate-spline>=1.2.0
|
|
34
|
+
Dynamic: author
|
|
35
|
+
Dynamic: home-page
|
|
36
|
+
Dynamic: license-file
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
|
|
39
|
+
# FEAST: From features to slice: parameter-cloud modeling and 3D interpolation of spatial transcriptomics
|
|
40
|
+
|
|
41
|
+
[](https://opensource.org/licenses/MIT)
|
|
42
|
+
[](https://www.python.org/downloads/)
|
|
43
|
+
|
|
44
|
+
**FEAST** (Feature-space-based modeling of Spatial Transcriptomics) is a comprehensive computational framework for simulating and interpolating spatial transcriptomics (ST) data. By modeling gene expression through a "parameter cloud" - a latent manifold capturing mean, variance, and sparsity - FEAST-sim generates high-fidelity synthetic ST slices with controllable biological and technical variations.
|
|
45
|
+
|
|
46
|
+
## Key Features
|
|
47
|
+
|
|
48
|
+
- **High-Fidelity Simulation**: Generate realistic ST data that preserves gene-level statistics, spatial patterns, and biological heterogeneity
|
|
49
|
+
- **Controllable Alterations**: Systematically modify gene expression (mean, variance, sparsity) for robust benchmarking
|
|
50
|
+
- **Multiple ST Technologies**: Support for Visium, MERFISH, Stereo-seq, Slide-seq, Xenium, and OpenST
|
|
51
|
+
- **Alignment Benchmarks**: Create paired datasets with controlled geometric transformations (rotation, warping) for testing alignment algorithms
|
|
52
|
+
- **Deconvolution Ground Truth**: Generate multi-resolution data with known cell-type compositions
|
|
53
|
+
- **3D Interpolation**: Reconstruct missing tissue slices using optimal transport in parameter space
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
### From PyPI (Recommended)
|
|
59
|
+
```bash
|
|
60
|
+
pip install FEAST-sim
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Directly From Source
|
|
64
|
+
```bash
|
|
65
|
+
git clone https://github.com/maiziezhoulab/FEAST-sim.git
|
|
66
|
+
cd FEAST-sim
|
|
67
|
+
pip install -e .
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
### Dependencies
|
|
71
|
+
- Python >= 3.8
|
|
72
|
+
- scanpy
|
|
73
|
+
- anndata
|
|
74
|
+
- numpy
|
|
75
|
+
- scipy
|
|
76
|
+
- pandas
|
|
77
|
+
- scikit-learn
|
|
78
|
+
- pyvinecopulib
|
|
79
|
+
- POT (Python Optimal Transport)
|
|
80
|
+
- tps (Thin Plate Spline)
|
|
81
|
+
|
|
82
|
+
## Quick Start
|
|
83
|
+
|
|
84
|
+
### Single Slice Simulation
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from FEAST import simulator
|
|
88
|
+
import scanpy as sc
|
|
89
|
+
|
|
90
|
+
# Load your reference data
|
|
91
|
+
adata = sc.read_h5ad("your_spatial_data.h5ad")
|
|
92
|
+
|
|
93
|
+
# Simple simulation with default parameters
|
|
94
|
+
simulated_adata = simulator.simulate_single_slice(
|
|
95
|
+
adata=adata,
|
|
96
|
+
sigma=1.0, # Spatial smoothness parameter
|
|
97
|
+
verbose=True
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
# Simulation with expression alteration
|
|
101
|
+
from FEAST.modeling.marginal_alteration import AlterationConfig
|
|
102
|
+
|
|
103
|
+
alteration_config = AlterationConfig.mean_only(fold_change=2.0)
|
|
104
|
+
altered_adata = simulator.simulate_single_slice(
|
|
105
|
+
adata=adata,
|
|
106
|
+
alteration_config=alteration_config,
|
|
107
|
+
sigma=1.0
|
|
108
|
+
)
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Alignment Simulation
|
|
112
|
+
|
|
113
|
+
```python
|
|
114
|
+
from FEAST.alignment.alignment_simulator import simulate_alignment_rotation
|
|
115
|
+
|
|
116
|
+
# Generate paired datasets with rotation for alignment benchmarking
|
|
117
|
+
original, rotated = simulate_alignment_rotation(
|
|
118
|
+
adata=adata,
|
|
119
|
+
rotation_angle=30.0, # degrees
|
|
120
|
+
data_type='imaging', # or 'sequencing'
|
|
121
|
+
sigma=0 # Perfect pattern preservation
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Deconvolution Simulation
|
|
126
|
+
|
|
127
|
+
```python
|
|
128
|
+
from FEAST.deconvolution.generate_deconvolution import create_deconvolution_benchmark_data
|
|
129
|
+
|
|
130
|
+
# Generate multi-resolution data with known cell-type compositions
|
|
131
|
+
deconv_adata = create_deconvolution_benchmark_data(
|
|
132
|
+
adata=single_cell_adata,
|
|
133
|
+
downsampling_factor=0.25,
|
|
134
|
+
grid_type='hexagonal',
|
|
135
|
+
cell_type_key='cell_type'
|
|
136
|
+
)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### 3D Slice Interpolation
|
|
140
|
+
|
|
141
|
+
```python
|
|
142
|
+
from FEAST.interpolation.interpolation_pipeline import interpolate_slices
|
|
143
|
+
|
|
144
|
+
# Interpolate missing slices between consecutive sections
|
|
145
|
+
interpolated_slices = interpolate_slices(
|
|
146
|
+
adata_list=[slice_k, slice_k_plus_1],
|
|
147
|
+
n_interpolate=3, # Number of intermediate slices
|
|
148
|
+
alpha=0.01,
|
|
149
|
+
verbose=True
|
|
150
|
+
)
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
## Tutorials
|
|
154
|
+
|
|
155
|
+
Try FEAST-sim with notebook! Comprehensive Jupyter notebooks are provided in the repository:
|
|
156
|
+
|
|
157
|
+
- **[example_single_sim.ipynb](example_single_sim.ipynb)**: Basic single-slice simulation for both sequencing-based and imaging-based ST data
|
|
158
|
+
- Visualization of parameter clouds
|
|
159
|
+
- Quality evaluation metrics
|
|
160
|
+
- Expression alteration examples
|
|
161
|
+
|
|
162
|
+
To get the datasets for tutorial, you can download via https://drive.google.com/drive/folders/1lOQasZ9nxIDIZwlqEQDCBY0kJaA7GwZD?usp=drive_link
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
## Architecture
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
FEAST-sim/
|
|
169
|
+
├── FEAST_core/ # Core simulation engine
|
|
170
|
+
│ ├── simulator.py # Main simulation logic (G-SRBA algorithm)
|
|
171
|
+
│ ├── parameter_cloud.py # Parameter cloud modeling
|
|
172
|
+
│ └── APIs.py # Unified FEAST API
|
|
173
|
+
├── alignment/ # Alignment simulation
|
|
174
|
+
│ ├── alignment_simulator.py
|
|
175
|
+
│ └── spatial_align_alter.py # Rotation & warping transformations
|
|
176
|
+
├── deconvolution/ # Deconvolution simulation
|
|
177
|
+
│ ├── deconvolution_simulator.py
|
|
178
|
+
│ └── generate_deconvolution.py
|
|
179
|
+
├── interpolation/ # 3D interpolation
|
|
180
|
+
│ ├── interpolation_pipeline.py
|
|
181
|
+
│ ├── parameter_interpolation.py
|
|
182
|
+
│ └── coordinate_generation.py
|
|
183
|
+
└── modeling/ # Statistical models
|
|
184
|
+
├── StudentT_mixture_model.py
|
|
185
|
+
├── Beta_mixture_model.py
|
|
186
|
+
└── marginal_alteration.py
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
## Reproduction Scripts
|
|
190
|
+
|
|
191
|
+
The `reproduction/` folder contains scripts to reproduce all benchmarking results from the paper. Each subdirectory corresponds to a specific analysis:
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
reproduction/
|
|
195
|
+
├── 1_Simulator_benchmark/ # Figure 2: Simulation fidelity evaluation
|
|
196
|
+
├── 2_Clustering_simulation/ # Figure 3: Clustering robustness testing
|
|
197
|
+
├── 3_Alignment_simulation/ # Figure 4: Alignment algorithm benchmarking
|
|
198
|
+
├── 4_Deconvolution_simulation/# Supp Fig: Deconvolution ground truth generation
|
|
199
|
+
└── 5_Interpolation_simulation/# Figure 5: 3D slice interpolation evaluation
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Dataset Organization
|
|
203
|
+
|
|
204
|
+
All scripts expect datasets in a `data/` directory with the following naming convention:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
data/
|
|
208
|
+
├── DLPFC_{sample_id}.h5ad # Human DLPFC sections
|
|
209
|
+
├── MERFISH_{slice_id}.h5ad # Mouse brain MERFISH slices
|
|
210
|
+
├── OpenST_{slice_id}.h5ad # Lymph node OpenST slices
|
|
211
|
+
├── Stereoseq_{sample_id}.h5ad # Mouse embryo Stereo-seq slices
|
|
212
|
+
├── Slideseq_{sample_id}.h5ad # Slide-seqV2 slices
|
|
213
|
+
└── Xenium_{sample_id}.h5ad # Xenium tissue slices
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Required Datasets
|
|
217
|
+
|
|
218
|
+
| Dataset | Technology | Source | Usage | Files |
|
|
219
|
+
|---------|-----------|---------|--------|-------|
|
|
220
|
+
| **DLPFC** | 10X Visium | [spatialLIBD](http://research.libd.org/spatialLIBD/) | Simulation, Clustering, Alignment | `DLPFC_151670.h5ad`<br>`DLPFC_151676.h5ad`<br>`DLPFC_151675.h5ad` |
|
|
221
|
+
| **MERFISH** | MERFISH | [Allen Brain Atlas](https://alleninstitute.github.io/abc_atlas_access/descriptions/Zhuang-ABCA-1.html) | Simulation, Deconvolution, Interpolation | `MERFISH_006.h5ad`<br>`MERFISH_007.h5ad`<br>`MERFISH_005-009.h5ad` (5 files) |
|
|
222
|
+
| **OpenST** | OpenST | [GEO: GSE251926](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE251926) | Simulation | `OpenST_005.h5ad`<br>`OpenST_006.h5ad` |
|
|
223
|
+
| **Stereo-seq** | Stereo-seq | [MOSTA](https://www.sciencedirect.com/science/article/pii/S0092867422003993) | Simulation | `Stereoseq_E14_5_E2S2.h5ad` |
|
|
224
|
+
| **Slide-seq** | Slide-seqV2 | [SODB](https://gene.ai.tencent.com/SpatialOmics/dataset?datasetID=119) | Simulation | `Slideseq_001.h5ad` |
|
|
225
|
+
| **Xenium** | Xenium | [10X Genomics](https://www.10xgenomics.com/datasets/human-lymph-node-preview-data-xenium-human-multi-tissue-and-cancer-panel-1-standard) | Simulation | `Xenium_LymphNode.h5ad` |
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
**Note**: FEAST-sim is actively maintained. If you have any question, please let me know!
|
feast_py-0.1.7/README.md
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# FEAST: From features to slice: parameter-cloud modeling and 3D interpolation of spatial transcriptomics
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.python.org/downloads/)
|
|
5
|
+
|
|
6
|
+
**FEAST** (Feature-space-based modeling of Spatial Transcriptomics) is a comprehensive computational framework for simulating and interpolating spatial transcriptomics (ST) data. By modeling gene expression through a "parameter cloud" - a latent manifold capturing mean, variance, and sparsity - FEAST-sim generates high-fidelity synthetic ST slices with controllable biological and technical variations.
|
|
7
|
+
|
|
8
|
+
## Key Features
|
|
9
|
+
|
|
10
|
+
- **High-Fidelity Simulation**: Generate realistic ST data that preserves gene-level statistics, spatial patterns, and biological heterogeneity
|
|
11
|
+
- **Controllable Alterations**: Systematically modify gene expression (mean, variance, sparsity) for robust benchmarking
|
|
12
|
+
- **Multiple ST Technologies**: Support for Visium, MERFISH, Stereo-seq, Slide-seq, Xenium, and OpenST
|
|
13
|
+
- **Alignment Benchmarks**: Create paired datasets with controlled geometric transformations (rotation, warping) for testing alignment algorithms
|
|
14
|
+
- **Deconvolution Ground Truth**: Generate multi-resolution data with known cell-type compositions
|
|
15
|
+
- **3D Interpolation**: Reconstruct missing tissue slices using optimal transport in parameter space
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### From PyPI (Recommended)
|
|
21
|
+
```bash
|
|
22
|
+
pip install FEAST-sim
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### Directly From Source
|
|
26
|
+
```bash
|
|
27
|
+
git clone https://github.com/maiziezhoulab/FEAST-sim.git
|
|
28
|
+
cd FEAST-sim
|
|
29
|
+
pip install -e .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Dependencies
|
|
33
|
+
- Python >= 3.8
|
|
34
|
+
- scanpy
|
|
35
|
+
- anndata
|
|
36
|
+
- numpy
|
|
37
|
+
- scipy
|
|
38
|
+
- pandas
|
|
39
|
+
- scikit-learn
|
|
40
|
+
- pyvinecopulib
|
|
41
|
+
- POT (Python Optimal Transport)
|
|
42
|
+
- tps (Thin Plate Spline)
|
|
43
|
+
|
|
44
|
+
## Quick Start
|
|
45
|
+
|
|
46
|
+
### Single Slice Simulation
|
|
47
|
+
|
|
48
|
+
```python
|
|
49
|
+
from FEAST import simulator
|
|
50
|
+
import scanpy as sc
|
|
51
|
+
|
|
52
|
+
# Load your reference data
|
|
53
|
+
adata = sc.read_h5ad("your_spatial_data.h5ad")
|
|
54
|
+
|
|
55
|
+
# Simple simulation with default parameters
|
|
56
|
+
simulated_adata = simulator.simulate_single_slice(
|
|
57
|
+
adata=adata,
|
|
58
|
+
sigma=1.0, # Spatial smoothness parameter
|
|
59
|
+
verbose=True
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
# Simulation with expression alteration
|
|
63
|
+
from FEAST.modeling.marginal_alteration import AlterationConfig
|
|
64
|
+
|
|
65
|
+
alteration_config = AlterationConfig.mean_only(fold_change=2.0)
|
|
66
|
+
altered_adata = simulator.simulate_single_slice(
|
|
67
|
+
adata=adata,
|
|
68
|
+
alteration_config=alteration_config,
|
|
69
|
+
sigma=1.0
|
|
70
|
+
)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Alignment Simulation
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from FEAST.alignment.alignment_simulator import simulate_alignment_rotation
|
|
77
|
+
|
|
78
|
+
# Generate paired datasets with rotation for alignment benchmarking
|
|
79
|
+
original, rotated = simulate_alignment_rotation(
|
|
80
|
+
adata=adata,
|
|
81
|
+
rotation_angle=30.0, # degrees
|
|
82
|
+
data_type='imaging', # or 'sequencing'
|
|
83
|
+
sigma=0 # Perfect pattern preservation
|
|
84
|
+
)
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Deconvolution Simulation
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
from FEAST.deconvolution.generate_deconvolution import create_deconvolution_benchmark_data
|
|
91
|
+
|
|
92
|
+
# Generate multi-resolution data with known cell-type compositions
|
|
93
|
+
deconv_adata = create_deconvolution_benchmark_data(
|
|
94
|
+
adata=single_cell_adata,
|
|
95
|
+
downsampling_factor=0.25,
|
|
96
|
+
grid_type='hexagonal',
|
|
97
|
+
cell_type_key='cell_type'
|
|
98
|
+
)
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### 3D Slice Interpolation
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
from FEAST.interpolation.interpolation_pipeline import interpolate_slices
|
|
105
|
+
|
|
106
|
+
# Interpolate missing slices between consecutive sections
|
|
107
|
+
interpolated_slices = interpolate_slices(
|
|
108
|
+
adata_list=[slice_k, slice_k_plus_1],
|
|
109
|
+
n_interpolate=3, # Number of intermediate slices
|
|
110
|
+
alpha=0.01,
|
|
111
|
+
verbose=True
|
|
112
|
+
)
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Tutorials
|
|
116
|
+
|
|
117
|
+
Try FEAST-sim with notebook! Comprehensive Jupyter notebooks are provided in the repository:
|
|
118
|
+
|
|
119
|
+
- **[example_single_sim.ipynb](example_single_sim.ipynb)**: Basic single-slice simulation for both sequencing-based and imaging-based ST data
|
|
120
|
+
- Visualization of parameter clouds
|
|
121
|
+
- Quality evaluation metrics
|
|
122
|
+
- Expression alteration examples
|
|
123
|
+
|
|
124
|
+
To get the datasets for tutorial, you can download via https://drive.google.com/drive/folders/1lOQasZ9nxIDIZwlqEQDCBY0kJaA7GwZD?usp=drive_link
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
## Architecture
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
FEAST-sim/
|
|
131
|
+
├── FEAST_core/ # Core simulation engine
|
|
132
|
+
│ ├── simulator.py # Main simulation logic (G-SRBA algorithm)
|
|
133
|
+
│ ├── parameter_cloud.py # Parameter cloud modeling
|
|
134
|
+
│ └── APIs.py # Unified FEAST API
|
|
135
|
+
├── alignment/ # Alignment simulation
|
|
136
|
+
│ ├── alignment_simulator.py
|
|
137
|
+
│ └── spatial_align_alter.py # Rotation & warping transformations
|
|
138
|
+
├── deconvolution/ # Deconvolution simulation
|
|
139
|
+
│ ├── deconvolution_simulator.py
|
|
140
|
+
│ └── generate_deconvolution.py
|
|
141
|
+
├── interpolation/ # 3D interpolation
|
|
142
|
+
│ ├── interpolation_pipeline.py
|
|
143
|
+
│ ├── parameter_interpolation.py
|
|
144
|
+
│ └── coordinate_generation.py
|
|
145
|
+
└── modeling/ # Statistical models
|
|
146
|
+
├── StudentT_mixture_model.py
|
|
147
|
+
├── Beta_mixture_model.py
|
|
148
|
+
└── marginal_alteration.py
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
## Reproduction Scripts
|
|
152
|
+
|
|
153
|
+
The `reproduction/` folder contains scripts to reproduce all benchmarking results from the paper. Each subdirectory corresponds to a specific analysis:
|
|
154
|
+
|
|
155
|
+
```
|
|
156
|
+
reproduction/
|
|
157
|
+
├── 1_Simulator_benchmark/ # Figure 2: Simulation fidelity evaluation
|
|
158
|
+
├── 2_Clustering_simulation/ # Figure 3: Clustering robustness testing
|
|
159
|
+
├── 3_Alignment_simulation/ # Figure 4: Alignment algorithm benchmarking
|
|
160
|
+
├── 4_Deconvolution_simulation/# Supp Fig: Deconvolution ground truth generation
|
|
161
|
+
└── 5_Interpolation_simulation/# Figure 5: 3D slice interpolation evaluation
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Dataset Organization
|
|
165
|
+
|
|
166
|
+
All scripts expect datasets in a `data/` directory with the following naming convention:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
data/
|
|
170
|
+
├── DLPFC_{sample_id}.h5ad # Human DLPFC sections
|
|
171
|
+
├── MERFISH_{slice_id}.h5ad # Mouse brain MERFISH slices
|
|
172
|
+
├── OpenST_{slice_id}.h5ad # Lymph node OpenST slices
|
|
173
|
+
├── Stereoseq_{sample_id}.h5ad # Mouse embryo Stereo-seq slices
|
|
174
|
+
├── Slideseq_{sample_id}.h5ad # Slide-seqV2 slices
|
|
175
|
+
└── Xenium_{sample_id}.h5ad # Xenium tissue slices
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Required Datasets
|
|
179
|
+
|
|
180
|
+
| Dataset | Technology | Source | Usage | Files |
|
|
181
|
+
|---------|-----------|---------|--------|-------|
|
|
182
|
+
| **DLPFC** | 10X Visium | [spatialLIBD](http://research.libd.org/spatialLIBD/) | Simulation, Clustering, Alignment | `DLPFC_151670.h5ad`<br>`DLPFC_151676.h5ad`<br>`DLPFC_151675.h5ad` |
|
|
183
|
+
| **MERFISH** | MERFISH | [Allen Brain Atlas](https://alleninstitute.github.io/abc_atlas_access/descriptions/Zhuang-ABCA-1.html) | Simulation, Deconvolution, Interpolation | `MERFISH_006.h5ad`<br>`MERFISH_007.h5ad`<br>`MERFISH_005-009.h5ad` (5 files) |
|
|
184
|
+
| **OpenST** | OpenST | [GEO: GSE251926](https://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=GSE251926) | Simulation | `OpenST_005.h5ad`<br>`OpenST_006.h5ad` |
|
|
185
|
+
| **Stereo-seq** | Stereo-seq | [MOSTA](https://www.sciencedirect.com/science/article/pii/S0092867422003993) | Simulation | `Stereoseq_E14_5_E2S2.h5ad` |
|
|
186
|
+
| **Slide-seq** | Slide-seqV2 | [SODB](https://gene.ai.tencent.com/SpatialOmics/dataset?datasetID=119) | Simulation | `Slideseq_001.h5ad` |
|
|
187
|
+
| **Xenium** | Xenium | [10X Genomics](https://www.10xgenomics.com/datasets/human-lymph-node-preview-data-xenium-human-multi-tissue-and-cancer-panel-1-standard) | Simulation | `Xenium_LymphNode.h5ad` |
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
**Note**: FEAST-sim is actively maintained. If you have any question, please let me know!
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=42", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "FEAST-py"
|
|
7
|
+
version = "0.1.7"
|
|
8
|
+
description = "Spatial Transcriptomics Simulator"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{name = "Yiru CHEN", email = "yiru.22@intl.zju.edu.cn"}
|
|
12
|
+
]
|
|
13
|
+
license = {text = "MIT"}
|
|
14
|
+
requires-python = ">=3.8"
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Programming Language :: Python :: 3",
|
|
17
|
+
"License :: OSI Approved :: MIT License",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"alphashape>=1.3.1",
|
|
22
|
+
"anndata>=0.9.2",
|
|
23
|
+
"geomloss>=0.2.6",
|
|
24
|
+
"joblib>=1.4.2",
|
|
25
|
+
"matplotlib>=3.7.5",
|
|
26
|
+
"numba>=0.55.2",
|
|
27
|
+
"numpy>=1.22.4",
|
|
28
|
+
"pandas>=2.0.3",
|
|
29
|
+
"paste2>=1.0.1",
|
|
30
|
+
"scanpy>=1.9.8",
|
|
31
|
+
"scikit-learn>=1.2.1",
|
|
32
|
+
"scipy>=1.10.1",
|
|
33
|
+
"seaborn>=0.13.2",
|
|
34
|
+
"torch>=1.12.1",
|
|
35
|
+
"tqdm>=4.66.4",
|
|
36
|
+
"spateo-release==1.1.1",
|
|
37
|
+
"pydot>=4.0.1",
|
|
38
|
+
"pyvinecopulib>=0.7.5",
|
|
39
|
+
"thin-plate-spline>=1.2.0",
|
|
40
|
+
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
[tool.setuptools]
|
|
46
|
+
package-dir = {"" = "src"}
|
|
47
|
+
|
|
48
|
+
[tool.setuptools.packages.find]
|
|
49
|
+
where = ["src"]
|
feast_py-0.1.7/setup.cfg
ADDED
feast_py-0.1.7/setup.py
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
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="FEAST-py",
|
|
8
|
+
version="0.1.7",
|
|
9
|
+
author="Yiru CHEN",
|
|
10
|
+
author_email="yiru.22@intl.zju.edu.cn",
|
|
11
|
+
description="Spatial Transcriptomics Simulator",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
url="https://github.com/maiziezhoulab/FEAST-sim",
|
|
15
|
+
package_dir={"": "src"},
|
|
16
|
+
packages=find_packages(where="src"),
|
|
17
|
+
license="MIT",
|
|
18
|
+
classifiers=[
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
],
|
|
23
|
+
python_requires=">=3.8",
|
|
24
|
+
install_requires=[
|
|
25
|
+
"alphashape>=1.3.1",
|
|
26
|
+
"anndata>=0.9.2",
|
|
27
|
+
"geomloss>=0.2.6",
|
|
28
|
+
"joblib>=1.4.2",
|
|
29
|
+
"matplotlib>=3.7.5",
|
|
30
|
+
"numba>=0.55.2",
|
|
31
|
+
"numpy>=1.22.4",
|
|
32
|
+
"pandas>=2.0.3",
|
|
33
|
+
"paste2>=1.0.1",
|
|
34
|
+
"scanpy>=1.9.8",
|
|
35
|
+
"scikit-learn>=1.2.1",
|
|
36
|
+
"scipy>=1.10.1",
|
|
37
|
+
"seaborn>=0.13.2",
|
|
38
|
+
"torch>=1.12.1",
|
|
39
|
+
"tqdm>=4.66.4",
|
|
40
|
+
],
|
|
41
|
+
)
|