gsMap3D 0.1.0a1__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.
Files changed (74) hide show
  1. gsmap3d-0.1.0a1/.gitignore +251 -0
  2. gsmap3d-0.1.0a1/LICENSE +21 -0
  3. gsmap3d-0.1.0a1/PKG-INFO +168 -0
  4. gsmap3d-0.1.0a1/README.md +71 -0
  5. gsmap3d-0.1.0a1/pyproject.toml +209 -0
  6. gsmap3d-0.1.0a1/src/gsMap/__init__.py +13 -0
  7. gsmap3d-0.1.0a1/src/gsMap/__main__.py +4 -0
  8. gsmap3d-0.1.0a1/src/gsMap/cauchy_combination_test.py +342 -0
  9. gsmap3d-0.1.0a1/src/gsMap/cli.py +355 -0
  10. gsmap3d-0.1.0a1/src/gsMap/config/__init__.py +72 -0
  11. gsmap3d-0.1.0a1/src/gsMap/config/base.py +296 -0
  12. gsmap3d-0.1.0a1/src/gsMap/config/cauchy_config.py +79 -0
  13. gsmap3d-0.1.0a1/src/gsMap/config/dataclasses.py +235 -0
  14. gsmap3d-0.1.0a1/src/gsMap/config/decorators.py +302 -0
  15. gsmap3d-0.1.0a1/src/gsMap/config/find_latent_config.py +276 -0
  16. gsmap3d-0.1.0a1/src/gsMap/config/format_sumstats_config.py +54 -0
  17. gsmap3d-0.1.0a1/src/gsMap/config/latent2gene_config.py +461 -0
  18. gsmap3d-0.1.0a1/src/gsMap/config/ldscore_config.py +261 -0
  19. gsmap3d-0.1.0a1/src/gsMap/config/quick_mode_config.py +242 -0
  20. gsmap3d-0.1.0a1/src/gsMap/config/report_config.py +81 -0
  21. gsmap3d-0.1.0a1/src/gsMap/config/spatial_ldsc_config.py +334 -0
  22. gsmap3d-0.1.0a1/src/gsMap/config/utils.py +286 -0
  23. gsmap3d-0.1.0a1/src/gsMap/find_latent/__init__.py +3 -0
  24. gsmap3d-0.1.0a1/src/gsMap/find_latent/find_latent_representation.py +312 -0
  25. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/distribution.py +498 -0
  26. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/encoder_decoder.py +186 -0
  27. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/gcn.py +85 -0
  28. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/gene_former.py +164 -0
  29. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/loss.py +18 -0
  30. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/st_model.py +125 -0
  31. gsmap3d-0.1.0a1/src/gsMap/find_latent/gnn/train_step.py +177 -0
  32. gsmap3d-0.1.0a1/src/gsMap/find_latent/st_process.py +781 -0
  33. gsmap3d-0.1.0a1/src/gsMap/format_sumstats.py +446 -0
  34. gsmap3d-0.1.0a1/src/gsMap/generate_ldscore.py +1018 -0
  35. gsmap3d-0.1.0a1/src/gsMap/latent2gene/__init__.py +18 -0
  36. gsmap3d-0.1.0a1/src/gsMap/latent2gene/connectivity.py +781 -0
  37. gsmap3d-0.1.0a1/src/gsMap/latent2gene/entry_point.py +141 -0
  38. gsmap3d-0.1.0a1/src/gsMap/latent2gene/marker_scores.py +1265 -0
  39. gsmap3d-0.1.0a1/src/gsMap/latent2gene/memmap_io.py +766 -0
  40. gsmap3d-0.1.0a1/src/gsMap/latent2gene/rank_calculator.py +590 -0
  41. gsmap3d-0.1.0a1/src/gsMap/latent2gene/row_ordering.py +182 -0
  42. gsmap3d-0.1.0a1/src/gsMap/latent2gene/row_ordering_jax.py +159 -0
  43. gsmap3d-0.1.0a1/src/gsMap/ldscore/__init__.py +1 -0
  44. gsmap3d-0.1.0a1/src/gsMap/ldscore/batch_construction.py +163 -0
  45. gsmap3d-0.1.0a1/src/gsMap/ldscore/compute.py +126 -0
  46. gsmap3d-0.1.0a1/src/gsMap/ldscore/constants.py +70 -0
  47. gsmap3d-0.1.0a1/src/gsMap/ldscore/io.py +262 -0
  48. gsmap3d-0.1.0a1/src/gsMap/ldscore/mapping.py +262 -0
  49. gsmap3d-0.1.0a1/src/gsMap/ldscore/pipeline.py +615 -0
  50. gsmap3d-0.1.0a1/src/gsMap/pipeline/quick_mode.py +134 -0
  51. gsmap3d-0.1.0a1/src/gsMap/report/__init__.py +2 -0
  52. gsmap3d-0.1.0a1/src/gsMap/report/diagnosis.py +375 -0
  53. gsmap3d-0.1.0a1/src/gsMap/report/report.py +100 -0
  54. gsmap3d-0.1.0a1/src/gsMap/report/report_data.py +1832 -0
  55. gsmap3d-0.1.0a1/src/gsMap/report/static/js_lib/alpine.min.js +5 -0
  56. gsmap3d-0.1.0a1/src/gsMap/report/static/js_lib/tailwindcss.js +83 -0
  57. gsmap3d-0.1.0a1/src/gsMap/report/static/template.html +2242 -0
  58. gsmap3d-0.1.0a1/src/gsMap/report/three_d_combine.py +312 -0
  59. gsmap3d-0.1.0a1/src/gsMap/report/three_d_plot/three_d_plot_decorate.py +246 -0
  60. gsmap3d-0.1.0a1/src/gsMap/report/three_d_plot/three_d_plot_prepare.py +202 -0
  61. gsmap3d-0.1.0a1/src/gsMap/report/three_d_plot/three_d_plots.py +425 -0
  62. gsmap3d-0.1.0a1/src/gsMap/report/visualize.py +1409 -0
  63. gsmap3d-0.1.0a1/src/gsMap/setup.py +5 -0
  64. gsmap3d-0.1.0a1/src/gsMap/spatial_ldsc/__init__.py +0 -0
  65. gsmap3d-0.1.0a1/src/gsMap/spatial_ldsc/io.py +656 -0
  66. gsmap3d-0.1.0a1/src/gsMap/spatial_ldsc/ldscore_quick_mode.py +912 -0
  67. gsmap3d-0.1.0a1/src/gsMap/spatial_ldsc/spatial_ldsc_jax.py +382 -0
  68. gsmap3d-0.1.0a1/src/gsMap/spatial_ldsc/spatial_ldsc_multiple_sumstats.py +439 -0
  69. gsmap3d-0.1.0a1/src/gsMap/utils/__init__.py +0 -0
  70. gsmap3d-0.1.0a1/src/gsMap/utils/generate_r2_matrix.py +610 -0
  71. gsmap3d-0.1.0a1/src/gsMap/utils/jackknife.py +518 -0
  72. gsmap3d-0.1.0a1/src/gsMap/utils/manhattan_plot.py +643 -0
  73. gsmap3d-0.1.0a1/src/gsMap/utils/regression_read.py +177 -0
  74. gsmap3d-0.1.0a1/src/gsMap/utils/torch_utils.py +23 -0
@@ -0,0 +1,251 @@
1
+ ### JetBrains+all template
2
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
3
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
4
+
5
+ # User-specific stuff
6
+ .idea/**/workspace.xml
7
+ .idea/**/tasks.xml
8
+ .idea/**/usage.statistics.xml
9
+ .idea/**/dictionaries
10
+ .idea/**/shelf
11
+
12
+ # AWS User-specific
13
+ .idea/**/aws.xml
14
+
15
+ # Generated files
16
+ .idea/**/contentModel.xml
17
+
18
+ # Sensitive or high-churn files
19
+ .idea/**/dataSources/
20
+ .idea/**/dataSources.ids
21
+ .idea/**/dataSources.local.xml
22
+ .idea/**/sqlDataSources.xml
23
+ .idea/**/dynamic.xml
24
+ .idea/**/uiDesigner.xml
25
+ .idea/**/dbnavigator.xml
26
+
27
+ # Gradle
28
+ .idea/**/gradle.xml
29
+ .idea/**/libraries
30
+
31
+ # Gradle and Maven with auto-import
32
+ # When using Gradle or Maven with auto-import, you should exclude module files,
33
+ # since they will be recreated, and may cause churn. Uncomment if using
34
+ # auto-import.
35
+ # .idea/artifacts
36
+ # .idea/compiler.xml
37
+ # .idea/jarRepositories.xml
38
+ # .idea/modules.xml
39
+ # .idea/*.iml
40
+ # .idea/modules
41
+ # *.iml
42
+ # *.ipr
43
+
44
+ # CMake
45
+ cmake-build-*/
46
+
47
+ # Mongo Explorer plugin
48
+ .idea/**/mongoSettings.xml
49
+
50
+ # File-based project format
51
+ *.iws
52
+
53
+ # IntelliJ
54
+ out/
55
+
56
+ # mpeltonen/sbt-idea plugin
57
+ .idea_modules/
58
+
59
+ # JIRA plugin
60
+ atlassian-ide-plugin.xml
61
+
62
+ # Cursive Clojure plugin
63
+ .idea/replstate.xml
64
+
65
+ # SonarLint plugin
66
+ .idea/sonarlint/
67
+
68
+ # Crashlytics plugin (for Android Studio and IntelliJ)
69
+ com_crashlytics_export_strings.xml
70
+ crashlytics.properties
71
+ crashlytics-build.properties
72
+ fabric.properties
73
+
74
+ # Editor-based Rest Client
75
+ .idea/httpRequests
76
+
77
+ # Android studio 3.1+ serialized cache file
78
+ .idea/caches/build_file_checksums.ser
79
+
80
+ ### JupyterNotebooks template
81
+ # gitignore template for Jupyter Notebooks
82
+ # website: http://jupyter.org/
83
+
84
+ .ipynb_checkpoints
85
+ */.ipynb_checkpoints/*
86
+
87
+ # IPython
88
+ profile_default/
89
+ ipython_config.py
90
+
91
+ # Remove previous ipynb_checkpoints
92
+ # git rm -r .ipynb_checkpoints/
93
+
94
+ ### Python template
95
+ # Byte-compiled / optimized / DLL files
96
+ __pycache__/
97
+ *.py[cod]
98
+ *$py.class
99
+
100
+ # C extensions
101
+ *.so
102
+
103
+ # Distribution / packaging
104
+ .Python
105
+ build/
106
+ develop-eggs/
107
+ dist/
108
+ downloads/
109
+ eggs/
110
+ .eggs/
111
+ lib/
112
+ lib64/
113
+ parts/
114
+ sdist/
115
+ var/
116
+ wheels/
117
+ share/python-wheels/
118
+ *.egg-info/
119
+ .installed.cfg
120
+ *.egg
121
+ MANIFEST
122
+
123
+ # PyInstaller
124
+ # Usually these files are written by a python script from a template
125
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
126
+ *.manifest
127
+ *.spec
128
+
129
+ # Installer logs
130
+ pip-log.txt
131
+ pip-delete-this-directory.txt
132
+
133
+ # Unit test / coverage reports
134
+ htmlcov/
135
+ .tox/
136
+ .nox/
137
+ .coverage
138
+ .coverage.*
139
+ .cache
140
+ nosetests.xml
141
+ coverage.xml
142
+ *.cover
143
+ *.py,cover
144
+ .hypothesis/
145
+ .pytest_cache/
146
+ cover/
147
+
148
+ # Translations
149
+ *.mo
150
+ *.pot
151
+
152
+ # Django stuff:
153
+ *.log
154
+ local_settings.py
155
+ db.sqlite3
156
+ db.sqlite3-journal
157
+
158
+ # Flask stuff:
159
+ instance/
160
+ .webassets-cache
161
+
162
+ # Scrapy stuff:
163
+ .scrapy
164
+
165
+ # Sphinx documentation
166
+ docs/_build/
167
+
168
+ # PyBuilder
169
+ .pybuilder/
170
+ target/
171
+
172
+ # Jupyter Notebook
173
+ .ipynb_checkpoints
174
+
175
+ # IPython
176
+ profile_default/
177
+ ipython_config.py
178
+
179
+ # pyenv
180
+ # For a library or package, you might want to ignore these files since the code is
181
+ # intended to run in multiple environments; otherwise, check them in:
182
+ # .python-version
183
+
184
+ # pipenv
185
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
186
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
187
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
188
+ # install all needed dependencies.
189
+ #Pipfile.lock
190
+
191
+ # poetry
192
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
193
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
194
+ # commonly ignored for libraries.
195
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
196
+ #poetry.lock
197
+
198
+ # pdm
199
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
200
+ #pdm.lock
201
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
202
+ # in version control.
203
+ # https://pdm.fming.dev/#use-with-ide
204
+ .pdm.toml
205
+
206
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
207
+ __pypackages__/
208
+
209
+ # Celery stuff
210
+ celerybeat-schedule
211
+ celerybeat.pid
212
+
213
+ # SageMath parsed files
214
+ *.sage.py
215
+
216
+ # Environments
217
+ .env
218
+ .venv
219
+ env/
220
+ venv/
221
+ ENV/
222
+ env.bak/
223
+ venv.bak/
224
+
225
+ # Spyder project settings
226
+ .spyderproject
227
+ .spyproject
228
+
229
+ # Rope project settings
230
+ .ropeproject
231
+
232
+ # mkdocs documentation
233
+ /site
234
+
235
+ # mypy
236
+ .mypy_cache/
237
+ .dmypy.json
238
+ dmypy.json
239
+
240
+ # Pyre type checker
241
+ .pyre/
242
+
243
+ # pytype static type analyzer
244
+ .pytype/
245
+
246
+ # Cython debug symbols
247
+ cython_debug/
248
+
249
+ # vscode
250
+ .vscode
251
+ run_gsmap3d.py
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 JianYang-Lab
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 all
13
+ 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 FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,168 @@
1
+ Metadata-Version: 2.4
2
+ Name: gsMap3D
3
+ Version: 0.1.0a1
4
+ Summary: Genetically informed spatial mapping of cells for complex traits
5
+ Project-URL: Home, https://github.com/Ganten-Hornby/gsMap3D
6
+ Project-URL: Documentation, https://yanglab.westlake.edu.cn/gsmap3d/docs
7
+ Project-URL: Website, https://yanglab.westlake.edu.cn/gsmap3d
8
+ Author-email: liyang <songliyang@westlake.edu.cn>, wenhao <chenwenhao@westlake.edu.cn>
9
+ License: MIT License
10
+
11
+ Copyright (c) 2026 JianYang-Lab
12
+
13
+ Permission is hereby granted, free of charge, to any person obtaining a copy
14
+ of this software and associated documentation files (the "Software"), to deal
15
+ in the Software without restriction, including without limitation the rights
16
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
+ copies of the Software, and to permit persons to whom the Software is
18
+ furnished to do so, subject to the following conditions:
19
+
20
+ The above copyright notice and this permission notice shall be included in all
21
+ copies or substantial portions of the Software.
22
+
23
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
+ SOFTWARE.
30
+ License-File: LICENSE
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Operating System :: POSIX :: Linux
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Requires-Python: >=3.12
38
+ Requires-Dist: anndata>=0.8.0
39
+ Requires-Dist: bitarray<3.0.0,>=2.9.2
40
+ Requires-Dist: distinctipy>=1.3.4
41
+ Requires-Dist: einops
42
+ Requires-Dist: h5py>=3.0.0
43
+ Requires-Dist: jax~=0.9.0
44
+ Requires-Dist: jinja2
45
+ Requires-Dist: kaleido
46
+ Requires-Dist: matplotlib
47
+ Requires-Dist: numba
48
+ Requires-Dist: numpy~=2.2
49
+ Requires-Dist: pandas
50
+ Requires-Dist: pandas-plink
51
+ Requires-Dist: plotly
52
+ Requires-Dist: psutil>=5.8.0
53
+ Requires-Dist: pyarrow
54
+ Requires-Dist: pyfiglet
55
+ Requires-Dist: pyranges
56
+ Requires-Dist: pyvista>=0.35.0
57
+ Requires-Dist: pyyaml
58
+ Requires-Dist: rich>=14.1.0
59
+ Requires-Dist: scanpy>=1.11.0
60
+ Requires-Dist: scikit-learn
61
+ Requires-Dist: scipy
62
+ Requires-Dist: statsmodels>=0.13.0
63
+ Requires-Dist: torch-geometric~=2.7
64
+ Requires-Dist: torch~=2.5
65
+ Requires-Dist: tqdm
66
+ Requires-Dist: typer~=0.20.0
67
+ Requires-Dist: zarr>=2.18.0
68
+ Provides-Extra: cuda
69
+ Requires-Dist: jax[cuda12]>=0.8.1; extra == 'cuda'
70
+ Provides-Extra: doc
71
+ Requires-Dist: furo; extra == 'doc'
72
+ Requires-Dist: myst-parser; extra == 'doc'
73
+ Requires-Dist: nbsphinx; extra == 'doc'
74
+ Requires-Dist: sphinx; extra == 'doc'
75
+ Requires-Dist: sphinx-argparse; extra == 'doc'
76
+ Requires-Dist: sphinx-autobuild; extra == 'doc'
77
+ Requires-Dist: sphinx-autodoc-typehints; extra == 'doc'
78
+ Requires-Dist: sphinx-basic-ng; extra == 'doc'
79
+ Requires-Dist: sphinx-charts; extra == 'doc'
80
+ Requires-Dist: sphinx-copybutton; extra == 'doc'
81
+ Requires-Dist: sphinx-inline-tabs; extra == 'doc'
82
+ Requires-Dist: sphinx-markdown-tables; extra == 'doc'
83
+ Requires-Dist: sphinx-rtd-theme; extra == 'doc'
84
+ Requires-Dist: sphinxcontrib-applehelp; extra == 'doc'
85
+ Requires-Dist: sphinxcontrib-devhelp; extra == 'doc'
86
+ Requires-Dist: sphinxcontrib-htmlhelp; extra == 'doc'
87
+ Requires-Dist: sphinxcontrib-jquery; extra == 'doc'
88
+ Requires-Dist: sphinxcontrib-jsmath; extra == 'doc'
89
+ Requires-Dist: sphinxcontrib-mermaid; extra == 'doc'
90
+ Requires-Dist: sphinxcontrib-qthelp; extra == 'doc'
91
+ Requires-Dist: sphinxcontrib-serializinghtml; extra == 'doc'
92
+ Provides-Extra: tests
93
+ Requires-Dist: coverage; extra == 'tests'
94
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'tests'
95
+ Requires-Dist: pytest>=7.0.0; extra == 'tests'
96
+ Description-Content-Type: text/markdown
97
+
98
+ # gsMap3D
99
+
100
+ **gsMap3D** integrates 3D spatial transcriptomics (ST) data with genome-wide association study (GWAS) summary statistics to map cells associated with human complex traits and diseases.
101
+
102
+ ---
103
+
104
+ ## ✨ What's New
105
+
106
+ - Support for 3D ST data mapping
107
+ - Dual-embedding strategy for more accurate gene specificity scoring
108
+ - Full GPU acceleration across all analysis steps
109
+ ---
110
+
111
+
112
+ ## 🚀 Features
113
+
114
+ - **Spatially-aware High-Resolution Trait Mapping**
115
+ Maps trait-associated cells at single-cell resolution, offering insights into their spatial distributions.
116
+
117
+ - **Spatial Region Identification**
118
+ Aggregates trait–cell association p-values into trait–tissue region association p-values, prioritizing tissue regions relevant to traits of interest.
119
+
120
+ - **Putative Causal Genes Identification**
121
+ Prioritizes putative causal genes by associating gene expression levels with cell–trait relevance.
122
+
123
+ - **Scalability**
124
+ Employs [JAX](https://github.com/google/jax) JIT and GPU/TPU acceleration to scale to million-scale cells (spots) spatial omics datasets.
125
+
126
+ ---
127
+
128
+
129
+ ## đź§  Overview of `gsMap3D`
130
+
131
+ `gsMap3D` operates on a four-step process:
132
+
133
+ #### 1. Gene Specificity Assessment in 3D Spatial Contexts
134
+ To address technical noise and capture spatial correlations of gene expression across consecutive ST sections,
135
+ `gsMap3D` constructs batch-corrected dual embeddings of molecular and spatial features. These embeddings jointly model transcriptomic similarity and local spatial context to identify homogeneous cells in 3D space. Gene specificity scores (GSS) are then computed by aggregating normalized gene expression ranks across these 3D homogeneous cells, enabling robust identification of genes that are both highly and specifically expressed in focal cells.
136
+
137
+ #### 2. Linking Gene Specificity to Genetic Variants
138
+ `gsMap3D` links gene specificity scores to single nucleotide polymorphisms (SNPs) by assigning GSS to SNPs based on their proximity to gene transcription start sites (TSS) and SNP-to-gene epigenetic linking maps, thereby connecting spatially resolved gene expression patterns with trait-associated genetic variation.
139
+
140
+ #### 3. 3D Spatial S-LDSC for Cell–Trait Association
141
+ To quantify cell–trait associations in 3D space, `gsMap3D` integrates the 3D gene specificity scores with GWAS summary statistics using stratified LD score regression (S-LDSC). This framework enables the estimation of trait relevance for individual cells by associating their stratified LD scores with GWAS signals.
142
+
143
+ #### 4. Spatial Region–Trait Association Analysis
144
+ To evaluate associations between traits and spatial regions, `gsMap3D` aggregates p-values from cells within a given 3D spatial region using the Cauchy combination test, yielding region-level association statistics that reflect coordinated genetic effects across spatially organized cell populations.
145
+
146
+
147
+ ![gsMap3D Method Schematic](docs/source/_static/gsMap3D_Method_schematic.png)
148
+
149
+ ---
150
+
151
+ ## 📚 Documentation
152
+ Please see [URL]
153
+
154
+ ---
155
+
156
+ ## 📝 How to Cite
157
+
158
+ If you use `gsMap` in your studies, please cite:
159
+
160
+ - **gsMap3D**: *to be updated.*
161
+
162
+ - **gsMap**:
163
+ Song, L., Chen, W., Hou, J., Guo, M. & Yang, J.
164
+ *Spatially resolved mapping of cells associated with human complex traits.*
165
+ **Nature** (2025).
166
+ [https://doi.org/10.1038/s41586-025-08757-x](https://doi.org/10.1038/s41586-025-08757-x)
167
+
168
+ ---
@@ -0,0 +1,71 @@
1
+ # gsMap3D
2
+
3
+ **gsMap3D** integrates 3D spatial transcriptomics (ST) data with genome-wide association study (GWAS) summary statistics to map cells associated with human complex traits and diseases.
4
+
5
+ ---
6
+
7
+ ## ✨ What's New
8
+
9
+ - Support for 3D ST data mapping
10
+ - Dual-embedding strategy for more accurate gene specificity scoring
11
+ - Full GPU acceleration across all analysis steps
12
+ ---
13
+
14
+
15
+ ## 🚀 Features
16
+
17
+ - **Spatially-aware High-Resolution Trait Mapping**
18
+ Maps trait-associated cells at single-cell resolution, offering insights into their spatial distributions.
19
+
20
+ - **Spatial Region Identification**
21
+ Aggregates trait–cell association p-values into trait–tissue region association p-values, prioritizing tissue regions relevant to traits of interest.
22
+
23
+ - **Putative Causal Genes Identification**
24
+ Prioritizes putative causal genes by associating gene expression levels with cell–trait relevance.
25
+
26
+ - **Scalability**
27
+ Employs [JAX](https://github.com/google/jax) JIT and GPU/TPU acceleration to scale to million-scale cells (spots) spatial omics datasets.
28
+
29
+ ---
30
+
31
+
32
+ ## đź§  Overview of `gsMap3D`
33
+
34
+ `gsMap3D` operates on a four-step process:
35
+
36
+ #### 1. Gene Specificity Assessment in 3D Spatial Contexts
37
+ To address technical noise and capture spatial correlations of gene expression across consecutive ST sections,
38
+ `gsMap3D` constructs batch-corrected dual embeddings of molecular and spatial features. These embeddings jointly model transcriptomic similarity and local spatial context to identify homogeneous cells in 3D space. Gene specificity scores (GSS) are then computed by aggregating normalized gene expression ranks across these 3D homogeneous cells, enabling robust identification of genes that are both highly and specifically expressed in focal cells.
39
+
40
+ #### 2. Linking Gene Specificity to Genetic Variants
41
+ `gsMap3D` links gene specificity scores to single nucleotide polymorphisms (SNPs) by assigning GSS to SNPs based on their proximity to gene transcription start sites (TSS) and SNP-to-gene epigenetic linking maps, thereby connecting spatially resolved gene expression patterns with trait-associated genetic variation.
42
+
43
+ #### 3. 3D Spatial S-LDSC for Cell–Trait Association
44
+ To quantify cell–trait associations in 3D space, `gsMap3D` integrates the 3D gene specificity scores with GWAS summary statistics using stratified LD score regression (S-LDSC). This framework enables the estimation of trait relevance for individual cells by associating their stratified LD scores with GWAS signals.
45
+
46
+ #### 4. Spatial Region–Trait Association Analysis
47
+ To evaluate associations between traits and spatial regions, `gsMap3D` aggregates p-values from cells within a given 3D spatial region using the Cauchy combination test, yielding region-level association statistics that reflect coordinated genetic effects across spatially organized cell populations.
48
+
49
+
50
+ ![gsMap3D Method Schematic](docs/source/_static/gsMap3D_Method_schematic.png)
51
+
52
+ ---
53
+
54
+ ## 📚 Documentation
55
+ Please see [URL]
56
+
57
+ ---
58
+
59
+ ## 📝 How to Cite
60
+
61
+ If you use `gsMap` in your studies, please cite:
62
+
63
+ - **gsMap3D**: *to be updated.*
64
+
65
+ - **gsMap**:
66
+ Song, L., Chen, W., Hou, J., Guo, M. & Yang, J.
67
+ *Spatially resolved mapping of cells associated with human complex traits.*
68
+ **Nature** (2025).
69
+ [https://doi.org/10.1038/s41586-025-08757-x](https://doi.org/10.1038/s41586-025-08757-x)
70
+
71
+ ---