gsMap3D 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.
Files changed (70) hide show
  1. gsmap3d-0.1.0/.gitignore +253 -0
  2. gsmap3d-0.1.0/LICENSE +21 -0
  3. gsmap3d-0.1.0/PKG-INFO +175 -0
  4. gsmap3d-0.1.0/README.md +76 -0
  5. gsmap3d-0.1.0/pyproject.toml +206 -0
  6. gsmap3d-0.1.0/src/gsMap/__init__.py +20 -0
  7. gsmap3d-0.1.0/src/gsMap/__main__.py +4 -0
  8. gsmap3d-0.1.0/src/gsMap/cauchy_combination_test.py +359 -0
  9. gsmap3d-0.1.0/src/gsMap/cli.py +368 -0
  10. gsmap3d-0.1.0/src/gsMap/config/__init__.py +69 -0
  11. gsmap3d-0.1.0/src/gsMap/config/base.py +309 -0
  12. gsmap3d-0.1.0/src/gsMap/config/cauchy_config.py +94 -0
  13. gsmap3d-0.1.0/src/gsMap/config/dataclasses.py +254 -0
  14. gsmap3d-0.1.0/src/gsMap/config/decorators.py +306 -0
  15. gsmap3d-0.1.0/src/gsMap/config/find_latent_config.py +261 -0
  16. gsmap3d-0.1.0/src/gsMap/config/format_sumstats_config.py +60 -0
  17. gsmap3d-0.1.0/src/gsMap/config/latent2gene_config.py +539 -0
  18. gsmap3d-0.1.0/src/gsMap/config/ldscore_config.py +253 -0
  19. gsmap3d-0.1.0/src/gsMap/config/quick_mode_config.py +262 -0
  20. gsmap3d-0.1.0/src/gsMap/config/report_config.py +91 -0
  21. gsmap3d-0.1.0/src/gsMap/config/spatial_ldsc_config.py +372 -0
  22. gsmap3d-0.1.0/src/gsMap/config/utils.py +304 -0
  23. gsmap3d-0.1.0/src/gsMap/find_latent/__init__.py +3 -0
  24. gsmap3d-0.1.0/src/gsMap/find_latent/find_latent_representation.py +314 -0
  25. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/distribution.py +489 -0
  26. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/encoder_decoder.py +194 -0
  27. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/gcn.py +83 -0
  28. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/gene_former.py +148 -0
  29. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/loss.py +24 -0
  30. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/st_model.py +132 -0
  31. gsmap3d-0.1.0/src/gsMap/find_latent/gnn/train_step.py +170 -0
  32. gsmap3d-0.1.0/src/gsMap/find_latent/st_process.py +809 -0
  33. gsmap3d-0.1.0/src/gsMap/format_sumstats.py +446 -0
  34. gsmap3d-0.1.0/src/gsMap/latent2gene/__init__.py +16 -0
  35. gsmap3d-0.1.0/src/gsMap/latent2gene/connectivity.py +826 -0
  36. gsmap3d-0.1.0/src/gsMap/latent2gene/entry_point.py +149 -0
  37. gsmap3d-0.1.0/src/gsMap/latent2gene/marker_scores.py +1392 -0
  38. gsmap3d-0.1.0/src/gsMap/latent2gene/memmap_io.py +753 -0
  39. gsmap3d-0.1.0/src/gsMap/latent2gene/rank_calculator.py +618 -0
  40. gsmap3d-0.1.0/src/gsMap/latent2gene/row_ordering.py +184 -0
  41. gsmap3d-0.1.0/src/gsMap/latent2gene/row_ordering_jax.py +157 -0
  42. gsmap3d-0.1.0/src/gsMap/ldscore/__init__.py +1 -0
  43. gsmap3d-0.1.0/src/gsMap/ldscore/batch_construction.py +169 -0
  44. gsmap3d-0.1.0/src/gsMap/ldscore/compute.py +125 -0
  45. gsmap3d-0.1.0/src/gsMap/ldscore/constants.py +70 -0
  46. gsmap3d-0.1.0/src/gsMap/ldscore/io.py +269 -0
  47. gsmap3d-0.1.0/src/gsMap/ldscore/mapping.py +268 -0
  48. gsmap3d-0.1.0/src/gsMap/ldscore/pipeline.py +659 -0
  49. gsmap3d-0.1.0/src/gsMap/pipeline/__init__.py +9 -0
  50. gsmap3d-0.1.0/src/gsMap/pipeline/quick_mode.py +147 -0
  51. gsmap3d-0.1.0/src/gsMap/report/__init__.py +2 -0
  52. gsmap3d-0.1.0/src/gsMap/report/diagnosis.py +373 -0
  53. gsmap3d-0.1.0/src/gsMap/report/report.py +102 -0
  54. gsmap3d-0.1.0/src/gsMap/report/report_data.py +1994 -0
  55. gsmap3d-0.1.0/src/gsMap/report/static/js_lib/alpine.min.js +5 -0
  56. gsmap3d-0.1.0/src/gsMap/report/static/js_lib/tailwindcss.js +83 -0
  57. gsmap3d-0.1.0/src/gsMap/report/static/template.html +2242 -0
  58. gsmap3d-0.1.0/src/gsMap/report/three_d_combine.py +338 -0
  59. gsmap3d-0.1.0/src/gsMap/report/three_d_plot/three_d_plot_decorate.py +240 -0
  60. gsmap3d-0.1.0/src/gsMap/report/three_d_plot/three_d_plot_prepare.py +213 -0
  61. gsmap3d-0.1.0/src/gsMap/report/three_d_plot/three_d_plots.py +434 -0
  62. gsmap3d-0.1.0/src/gsMap/report/visualize.py +1578 -0
  63. gsmap3d-0.1.0/src/gsMap/spatial_ldsc/__init__.py +0 -0
  64. gsmap3d-0.1.0/src/gsMap/spatial_ldsc/io.py +666 -0
  65. gsmap3d-0.1.0/src/gsMap/spatial_ldsc/ldscore_quick_mode.py +951 -0
  66. gsmap3d-0.1.0/src/gsMap/spatial_ldsc/spatial_ldsc_jax.py +403 -0
  67. gsmap3d-0.1.0/src/gsMap/spatial_ldsc/spatial_ldsc_multiple_sumstats.py +449 -0
  68. gsmap3d-0.1.0/src/gsMap/utils/__init__.py +0 -0
  69. gsmap3d-0.1.0/src/gsMap/utils/manhattan_plot.py +665 -0
  70. gsmap3d-0.1.0/src/gsMap/utils/regression_read.py +177 -0
@@ -0,0 +1,253 @@
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
+ .claude/
57
+
58
+ # mpeltonen/sbt-idea plugin
59
+ .idea_modules/
60
+
61
+ # JIRA plugin
62
+ atlassian-ide-plugin.xml
63
+
64
+ # Cursive Clojure plugin
65
+ .idea/replstate.xml
66
+
67
+ # SonarLint plugin
68
+ .idea/sonarlint/
69
+
70
+ # Crashlytics plugin (for Android Studio and IntelliJ)
71
+ com_crashlytics_export_strings.xml
72
+ crashlytics.properties
73
+ crashlytics-build.properties
74
+ fabric.properties
75
+
76
+ # Editor-based Rest Client
77
+ .idea/httpRequests
78
+
79
+ # Android studio 3.1+ serialized cache file
80
+ .idea/caches/build_file_checksums.ser
81
+
82
+ ### JupyterNotebooks template
83
+ # gitignore template for Jupyter Notebooks
84
+ # website: http://jupyter.org/
85
+
86
+ .ipynb_checkpoints
87
+ */.ipynb_checkpoints/*
88
+
89
+ # IPython
90
+ profile_default/
91
+ ipython_config.py
92
+
93
+ # Remove previous ipynb_checkpoints
94
+ # git rm -r .ipynb_checkpoints/
95
+
96
+ ### Python template
97
+ # Byte-compiled / optimized / DLL files
98
+ __pycache__/
99
+ *.py[cod]
100
+ *$py.class
101
+
102
+ # C extensions
103
+ *.so
104
+
105
+ # Distribution / packaging
106
+ .Python
107
+ build/
108
+ develop-eggs/
109
+ dist/
110
+ downloads/
111
+ eggs/
112
+ .eggs/
113
+ lib/
114
+ lib64/
115
+ parts/
116
+ sdist/
117
+ var/
118
+ wheels/
119
+ share/python-wheels/
120
+ *.egg-info/
121
+ .installed.cfg
122
+ *.egg
123
+ MANIFEST
124
+
125
+ # PyInstaller
126
+ # Usually these files are written by a python script from a template
127
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
128
+ *.manifest
129
+ *.spec
130
+
131
+ # Installer logs
132
+ pip-log.txt
133
+ pip-delete-this-directory.txt
134
+
135
+ # Unit test / coverage reports
136
+ htmlcov/
137
+ .tox/
138
+ .nox/
139
+ .coverage
140
+ .coverage.*
141
+ .cache
142
+ nosetests.xml
143
+ coverage.xml
144
+ *.cover
145
+ *.py,cover
146
+ .hypothesis/
147
+ .pytest_cache/
148
+ cover/
149
+
150
+ # Translations
151
+ *.mo
152
+ *.pot
153
+
154
+ # Django stuff:
155
+ *.log
156
+ local_settings.py
157
+ db.sqlite3
158
+ db.sqlite3-journal
159
+
160
+ # Flask stuff:
161
+ instance/
162
+ .webassets-cache
163
+
164
+ # Scrapy stuff:
165
+ .scrapy
166
+
167
+ # Sphinx documentation
168
+ docs/_build/
169
+
170
+ # PyBuilder
171
+ .pybuilder/
172
+ target/
173
+
174
+ # Jupyter Notebook
175
+ .ipynb_checkpoints
176
+
177
+ # IPython
178
+ profile_default/
179
+ ipython_config.py
180
+
181
+ # pyenv
182
+ # For a library or package, you might want to ignore these files since the code is
183
+ # intended to run in multiple environments; otherwise, check them in:
184
+ # .python-version
185
+
186
+ # pipenv
187
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
188
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
189
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
190
+ # install all needed dependencies.
191
+ #Pipfile.lock
192
+
193
+ # poetry
194
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
195
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
196
+ # commonly ignored for libraries.
197
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
198
+ #poetry.lock
199
+
200
+ # pdm
201
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
202
+ #pdm.lock
203
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
204
+ # in version control.
205
+ # https://pdm.fming.dev/#use-with-ide
206
+ .pdm.toml
207
+
208
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
209
+ __pypackages__/
210
+
211
+ # Celery stuff
212
+ celerybeat-schedule
213
+ celerybeat.pid
214
+
215
+ # SageMath parsed files
216
+ *.sage.py
217
+
218
+ # Environments
219
+ .env
220
+ .venv
221
+ env/
222
+ venv/
223
+ ENV/
224
+ env.bak/
225
+ venv.bak/
226
+
227
+ # Spyder project settings
228
+ .spyderproject
229
+ .spyproject
230
+
231
+ # Rope project settings
232
+ .ropeproject
233
+
234
+ # mkdocs documentation
235
+ /site
236
+
237
+ # mypy
238
+ .mypy_cache/
239
+ .dmypy.json
240
+ dmypy.json
241
+
242
+ # Pyre type checker
243
+ .pyre/
244
+
245
+ # pytype static type analyzer
246
+ .pytype/
247
+
248
+ # Cython debug symbols
249
+ cython_debug/
250
+
251
+ # vscode
252
+ .vscode
253
+ run_gsmap3d.py
gsmap3d-0.1.0/LICENSE ADDED
@@ -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.
gsmap3d-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,175 @@
1
+ Metadata-Version: 2.4
2
+ Name: gsMap3D
3
+ Version: 0.1.0
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 :: 4 - Beta
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<1.0.0,>=0.7.2
44
+ Requires-Dist: jinja2
45
+ Requires-Dist: kaleido
46
+ Requires-Dist: matplotlib
47
+ Requires-Dist: numba>=0.60
48
+ Requires-Dist: numpy~=2.2
49
+ Requires-Dist: pandas-plink
50
+ Requires-Dist: pandas>=2.0
51
+ Requires-Dist: plotly
52
+ Requires-Dist: psutil>=5.8.0
53
+ Requires-Dist: pyarrow
54
+ Requires-Dist: pyfiglet
55
+ Requires-Dist: pyranges1~=1.2.0
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: scipy>=1.11
61
+ Requires-Dist: statsmodels>=0.13.0
62
+ Requires-Dist: torch-geometric~=2.7
63
+ Requires-Dist: torch~=2.5
64
+ Requires-Dist: tqdm
65
+ Requires-Dist: typer~=0.20.0
66
+ Requires-Dist: xarray
67
+ Requires-Dist: zarr>=2.18.0
68
+ Provides-Extra: cuda
69
+ Requires-Dist: jax[cuda13]<1.0.0,>=0.7.2; 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
+ Provides-Extra: tpu
97
+ Requires-Dist: jax[tpu]<1.0.0,>=0.7.2; extra == 'tpu'
98
+ Description-Content-Type: text/markdown
99
+
100
+ # gsMap3D
101
+
102
+ **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.
103
+
104
+ ______________________________________________________________________
105
+
106
+ ## ✨ What's New
107
+
108
+ ```text
109
+ - Support for 3D ST data mapping
110
+ - Dual-embedding strategy for more accurate gene specificity scoring
111
+ - Full GPU acceleration across all analysis steps
112
+ ```
113
+
114
+ ______________________________________________________________________
115
+
116
+ ## 🚀 Features
117
+
118
+ - **Spatially-aware High-Resolution Trait Mapping**\
119
+ Maps trait-associated cells at single-cell resolution, offering insights into their spatial distributions.
120
+
121
+ - **Spatial Region Identification**\
122
+ Aggregates trait–cell association p-values into trait–tissue region association p-values, prioritizing tissue regions relevant to traits of interest.
123
+
124
+ - **Putative Causal Genes Identification**\
125
+ Prioritizes putative causal genes by associating gene expression levels with cell–trait relevance.
126
+
127
+ - **Scalability**\
128
+ Employs [JAX](https://github.com/google/jax) JIT and GPU/TPU acceleration to scale to million-scale cells (spots) spatial omics datasets.
129
+
130
+ ______________________________________________________________________
131
+
132
+ ## đź§  Overview of `gsMap3D`
133
+
134
+ `gsMap3D` operates on a four-step process:
135
+
136
+ ### 1. Gene Specificity Assessment in 3D Spatial Contexts
137
+
138
+ To address technical noise and capture spatial correlations of gene expression across consecutive ST sections,\
139
+ `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.
140
+
141
+ ### 2. Linking Gene Specificity to Genetic Variants
142
+
143
+ `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.
144
+
145
+ ### 3. 3D Spatial S-LDSC for Cell–Trait Association
146
+
147
+ 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.
148
+
149
+ ### 4. Spatial Region–Trait Association Analysis
150
+
151
+ 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.
152
+
153
+ ![gsMap3D Method Schematic](docs/source/_static/gsMap3D_Method_schematic.png)
154
+
155
+ ______________________________________________________________________
156
+
157
+ ## 📚 Documentation
158
+
159
+ Please see our [Documentation](https://yanglab.westlake.edu.cn/gsmap3d-portal/docs) and [Website](https://yanglab.westlake.edu.cn/gsmap3d-portal).
160
+
161
+ ______________________________________________________________________
162
+
163
+ ## 📝 How to Cite
164
+
165
+ If you use `gsMap3D` in your studies, please cite:
166
+
167
+ - **gsMap3D**: *to be updated.*
168
+
169
+ - **gsMap**:\
170
+ Song, L., Chen, W., Hou, J., Guo, M. & Yang, J.\
171
+ *Spatially resolved mapping of cells associated with human complex traits.*\
172
+ **Nature** (2025).\
173
+ [https://doi.org/10.1038/s41586-025-08757-x](https://doi.org/10.1038/s41586-025-08757-x)
174
+
175
+ ______________________________________________________________________
@@ -0,0 +1,76 @@
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
+ ```text
10
+ - Support for 3D ST data mapping
11
+ - Dual-embedding strategy for more accurate gene specificity scoring
12
+ - Full GPU acceleration across all analysis steps
13
+ ```
14
+
15
+ ______________________________________________________________________
16
+
17
+ ## 🚀 Features
18
+
19
+ - **Spatially-aware High-Resolution Trait Mapping**\
20
+ Maps trait-associated cells at single-cell resolution, offering insights into their spatial distributions.
21
+
22
+ - **Spatial Region Identification**\
23
+ Aggregates trait–cell association p-values into trait–tissue region association p-values, prioritizing tissue regions relevant to traits of interest.
24
+
25
+ - **Putative Causal Genes Identification**\
26
+ Prioritizes putative causal genes by associating gene expression levels with cell–trait relevance.
27
+
28
+ - **Scalability**\
29
+ Employs [JAX](https://github.com/google/jax) JIT and GPU/TPU acceleration to scale to million-scale cells (spots) spatial omics datasets.
30
+
31
+ ______________________________________________________________________
32
+
33
+ ## đź§  Overview of `gsMap3D`
34
+
35
+ `gsMap3D` operates on a four-step process:
36
+
37
+ ### 1. Gene Specificity Assessment in 3D Spatial Contexts
38
+
39
+ To address technical noise and capture spatial correlations of gene expression across consecutive ST sections,\
40
+ `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.
41
+
42
+ ### 2. Linking Gene Specificity to Genetic Variants
43
+
44
+ `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.
45
+
46
+ ### 3. 3D Spatial S-LDSC for Cell–Trait Association
47
+
48
+ 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.
49
+
50
+ ### 4. Spatial Region–Trait Association Analysis
51
+
52
+ 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.
53
+
54
+ ![gsMap3D Method Schematic](docs/source/_static/gsMap3D_Method_schematic.png)
55
+
56
+ ______________________________________________________________________
57
+
58
+ ## 📚 Documentation
59
+
60
+ Please see our [Documentation](https://yanglab.westlake.edu.cn/gsmap3d-portal/docs) and [Website](https://yanglab.westlake.edu.cn/gsmap3d-portal).
61
+
62
+ ______________________________________________________________________
63
+
64
+ ## 📝 How to Cite
65
+
66
+ If you use `gsMap3D` in your studies, please cite:
67
+
68
+ - **gsMap3D**: *to be updated.*
69
+
70
+ - **gsMap**:\
71
+ Song, L., Chen, W., Hou, J., Guo, M. & Yang, J.\
72
+ *Spatially resolved mapping of cells associated with human complex traits.*\
73
+ **Nature** (2025).\
74
+ [https://doi.org/10.1038/s41586-025-08757-x](https://doi.org/10.1038/s41586-025-08757-x)
75
+
76
+ ______________________________________________________________________