stat-agent 0.1.26__tar.gz → 2.0.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 (223) hide show
  1. stat_agent-2.0.0/PKG-INFO +335 -0
  2. stat_agent-2.0.0/README.md +248 -0
  3. stat_agent-2.0.0/pyproject.toml +137 -0
  4. stat_agent-2.0.0/src/stat_agent/__init__.py +6 -0
  5. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/_compat.py +0 -1
  6. stat_agent-2.0.0/src/stat_agent/agent/__init__.py +15 -0
  7. stat_agent-2.0.0/src/stat_agent/agent/ablation.py +65 -0
  8. stat_agent-2.0.0/src/stat_agent/agent/agent.py +447 -0
  9. stat_agent-2.0.0/src/stat_agent/agent/graph.py +55 -0
  10. stat_agent-2.0.0/src/stat_agent/agent/llm_backend.py +55 -0
  11. stat_agent-2.0.0/src/stat_agent/agent/loop.py +291 -0
  12. stat_agent-2.0.0/src/stat_agent/agent/nodes/__init__.py +1 -0
  13. stat_agent-2.0.0/src/stat_agent/agent/nodes/common.py +131 -0
  14. stat_agent-2.0.0/src/stat_agent/agent/nodes/execution.py +462 -0
  15. stat_agent-2.0.0/src/stat_agent/agent/nodes/finishing.py +143 -0
  16. stat_agent-2.0.0/src/stat_agent/agent/nodes/planning.py +132 -0
  17. stat_agent-2.0.0/src/stat_agent/agent/nodes/selection.py +300 -0
  18. stat_agent-2.0.0/src/stat_agent/agent/policy.py +220 -0
  19. stat_agent-2.0.0/src/stat_agent/agent/state.py +159 -0
  20. stat_agent-2.0.0/src/stat_agent/cli/__init__.py +1 -0
  21. stat_agent-2.0.0/src/stat_agent/cli/chat.py +87 -0
  22. stat_agent-2.0.0/src/stat_agent/cli/main.py +61 -0
  23. stat_agent-2.0.0/src/stat_agent/cli/session_cmd.py +67 -0
  24. stat_agent-2.0.0/src/stat_agent/config.py +57 -0
  25. stat_agent-2.0.0/src/stat_agent/core/__init__.py +21 -0
  26. stat_agent-2.0.0/src/stat_agent/core/colors.py +150 -0
  27. stat_agent-2.0.0/src/stat_agent/core/data_slice.py +211 -0
  28. stat_agent-2.0.0/src/stat_agent/core/lock.py +69 -0
  29. stat_agent-2.0.0/src/stat_agent/core/roi_manager.py +350 -0
  30. stat_agent-2.0.0/src/stat_agent/core/session.py +347 -0
  31. stat_agent-2.0.0/src/stat_agent/core/view.py +178 -0
  32. stat_agent-2.0.0/src/stat_agent/events/__init__.py +28 -0
  33. stat_agent-2.0.0/src/stat_agent/events/catalogue.py +486 -0
  34. stat_agent-2.0.0/src/stat_agent/events/emit.py +98 -0
  35. stat_agent-2.0.0/src/stat_agent/events/encoding.py +76 -0
  36. stat_agent-2.0.0/src/stat_agent/extras/__init__.py +1 -0
  37. stat_agent-2.0.0/src/stat_agent/extras/deepagents_driver.py +101 -0
  38. stat_agent-2.0.0/src/stat_agent/extras/research.py +66 -0
  39. stat_agent-2.0.0/src/stat_agent/io/__init__.py +21 -0
  40. stat_agent-2.0.0/src/stat_agent/io/dataset.py +341 -0
  41. stat_agent-2.0.0/src/stat_agent/io/session_store.py +63 -0
  42. stat_agent-2.0.0/src/stat_agent/ledger/__init__.py +13 -0
  43. stat_agent-2.0.0/src/stat_agent/ledger/mutator.py +111 -0
  44. stat_agent-2.0.0/src/stat_agent/ledger/provenance.py +417 -0
  45. stat_agent-2.0.0/src/stat_agent/llm/__init__.py +28 -0
  46. stat_agent-2.0.0/src/stat_agent/llm/calllog.py +113 -0
  47. stat_agent-2.0.0/src/stat_agent/llm/client.py +387 -0
  48. stat_agent-2.0.0/src/stat_agent/llm/fake.py +86 -0
  49. stat_agent-2.0.0/src/stat_agent/llm/models.py +193 -0
  50. stat_agent-2.0.0/src/stat_agent/llm/structured.py +206 -0
  51. stat_agent-2.0.0/src/stat_agent/llm/usage.py +82 -0
  52. stat_agent-2.0.0/src/stat_agent/logging/__init__.py +1 -0
  53. stat_agent-2.0.0/src/stat_agent/logging/notebook.py +81 -0
  54. stat_agent-2.0.0/src/stat_agent/logging/report.py +84 -0
  55. stat_agent-2.0.0/src/stat_agent/memory/__init__.py +5 -0
  56. stat_agent-2.0.0/src/stat_agent/memory/context.py +287 -0
  57. stat_agent-2.0.0/src/stat_agent/memory/state.py +210 -0
  58. stat_agent-2.0.0/src/stat_agent/prompts/__init__.py +82 -0
  59. stat_agent-2.0.0/src/stat_agent/prompts/analyzer.v1.md +43 -0
  60. stat_agent-2.0.0/src/stat_agent/prompts/analyzer.v2.md +44 -0
  61. stat_agent-2.0.0/src/stat_agent/prompts/generator_system.v1.md +292 -0
  62. stat_agent-2.0.0/src/stat_agent/prompts/generator_system.v2.md +295 -0
  63. stat_agent-2.0.0/src/stat_agent/prompts/generator_user.v1.md +35 -0
  64. stat_agent-2.0.0/src/stat_agent/prompts/generator_user.v2.md +44 -0
  65. stat_agent-2.0.0/src/stat_agent/prompts/matcher.v1.md +29 -0
  66. stat_agent-2.0.0/src/stat_agent/prompts/matcher.v2.md +30 -0
  67. stat_agent-2.0.0/src/stat_agent/prompts/method_card.v1.md +41 -0
  68. stat_agent-2.0.0/src/stat_agent/prompts/planner.v1.md +89 -0
  69. stat_agent-2.0.0/src/stat_agent/prompts/planner.v2.md +120 -0
  70. stat_agent-2.0.0/src/stat_agent/prompts/reflector.v1.md +69 -0
  71. stat_agent-2.0.0/src/stat_agent/prompts/skill_author.v1.md +30 -0
  72. stat_agent-2.0.0/src/stat_agent/prompts/summarizer.v1.md +27 -0
  73. stat_agent-2.0.0/src/stat_agent/prompts/verifier.v1.md +101 -0
  74. stat_agent-2.0.0/src/stat_agent/roles/__init__.py +39 -0
  75. stat_agent-2.0.0/src/stat_agent/roles/analyzer.py +140 -0
  76. stat_agent-2.0.0/src/stat_agent/roles/base.py +57 -0
  77. stat_agent-2.0.0/src/stat_agent/roles/generator.py +180 -0
  78. stat_agent-2.0.0/src/stat_agent/roles/matcher.py +46 -0
  79. stat_agent-2.0.0/src/stat_agent/roles/method_card.py +31 -0
  80. stat_agent-2.0.0/src/stat_agent/roles/planner.py +129 -0
  81. stat_agent-2.0.0/src/stat_agent/roles/reflector.py +68 -0
  82. stat_agent-2.0.0/src/stat_agent/roles/summarizer.py +28 -0
  83. stat_agent-2.0.0/src/stat_agent/roles/verifier.py +305 -0
  84. stat_agent-2.0.0/src/stat_agent/runtime/__init__.py +29 -0
  85. stat_agent-2.0.0/src/stat_agent/runtime/artifacts.py +85 -0
  86. stat_agent-2.0.0/src/stat_agent/runtime/executor.py +539 -0
  87. stat_agent-2.0.0/src/stat_agent/runtime/plots.py +52 -0
  88. stat_agent-2.0.0/src/stat_agent/runtime/safety.py +152 -0
  89. stat_agent-2.0.0/src/stat_agent/runtime/snapshot.py +248 -0
  90. stat_agent-2.0.0/src/stat_agent/skills/__init__.py +28 -0
  91. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/alignment-STalign/SKILL.md +8 -0
  92. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/annotation-tangram/SKILL.md +10 -1
  93. stat_agent-2.0.0/src/stat_agent/skills/author.py +68 -0
  94. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/cell-communication-CellPhoneDB/SKILL.md +14 -3
  95. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/cell-communication-LIANA/SKILL.md +25 -56
  96. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-annotation-GPT/SKILL.md +8 -1
  97. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-annotation-GPT/celltype_fast/annotation_clustering.py +10 -17
  98. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-annotation-scANVI/SKILL.md +11 -1
  99. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-deconvolution-RCTD/SKILL.md +17 -3
  100. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-deconvolution-RCTD/deconv_rctd/data_utils.py +14 -2
  101. stat_agent-2.0.0/src/stat_agent/skills/cli.py +181 -0
  102. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/deconvolution-cell2location/SKILL.md +11 -1
  103. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/deconvolution-flashdeconv/SKILL.md +9 -1
  104. stat_agent-2.0.0/src/stat_agent/skills/differential-expression/SKILL.md +136 -0
  105. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/enrichment-ora-ssgsea/SKILL.md +9 -0
  106. stat_agent-2.0.0/src/stat_agent/skills/filter.py +100 -0
  107. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/integration-Harmony/SKILL.md +23 -12
  108. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/integration-bbknn/SKILL.md +8 -0
  109. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/integration-scanorama/SKILL.md +8 -0
  110. stat_agent-2.0.0/src/stat_agent/skills/lint.py +707 -0
  111. stat_agent-2.0.0/src/stat_agent/skills/loader.py +57 -0
  112. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/niche-detection-Harmonics/SKILL.md +24 -2
  113. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/pathway-GO-enrichment/SKILL.md +25 -2
  114. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/pathway-enrichment-compare/SKILL.md +9 -0
  115. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/pathway-ssgsea/SKILL.md +9 -0
  116. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/registration-paste/SKILL.md +8 -0
  117. stat_agent-2.0.0/src/stat_agent/skills/registry.py +183 -0
  118. stat_agent-2.0.0/src/stat_agent/skills/schema.py +296 -0
  119. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/spatial-domain-GraphST/SKILL.md +9 -0
  120. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/spatial-domain-STAGATE/SKILL.md +24 -5
  121. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/spatial-domain-SpaGCN/SKILL.md +10 -0
  122. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/spatial-statistics-squidpy/SKILL.md +9 -1
  123. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/spatial-stats-neighborhood-enrichment/SKILL.md +7 -1
  124. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/svg-SpatialDE/SKILL.md +11 -4
  125. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/trajectory-palantir-dpt/SKILL.md +7 -1
  126. stat_agent-2.0.0/src/stat_agent/web/__init__.py +1 -0
  127. stat_agent-2.0.0/src/stat_agent/web/__main__.py +37 -0
  128. stat_agent-2.0.0/src/stat_agent/web/errors.py +45 -0
  129. stat_agent-2.0.0/src/stat_agent/web/events.py +133 -0
  130. stat_agent-2.0.0/src/stat_agent/web/render.py +126 -0
  131. stat_agent-2.0.0/src/stat_agent/web/routes/__init__.py +1 -0
  132. stat_agent-2.0.0/src/stat_agent/web/routes/common.py +72 -0
  133. stat_agent-2.0.0/src/stat_agent/web/routes/data.py +133 -0
  134. stat_agent-2.0.0/src/stat_agent/web/routes/misc.py +178 -0
  135. stat_agent-2.0.0/src/stat_agent/web/routes/rois.py +123 -0
  136. stat_agent-2.0.0/src/stat_agent/web/routes/session.py +136 -0
  137. stat_agent-2.0.0/src/stat_agent/web/routes/turns.py +150 -0
  138. stat_agent-2.0.0/src/stat_agent/web/schemas.py +96 -0
  139. stat_agent-2.0.0/src/stat_agent/web/server.py +97 -0
  140. stat_agent-2.0.0/src/stat_agent/web/state.py +173 -0
  141. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/web/static/css/style.css +69 -1
  142. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/web/static/js/app.js +853 -778
  143. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/web/templates/index.html +23 -1
  144. stat_agent-2.0.0/src/stat_agent/web/turns.py +247 -0
  145. stat_agent-2.0.0/src/stat_agent.egg-info/PKG-INFO +335 -0
  146. stat_agent-2.0.0/src/stat_agent.egg-info/SOURCES.txt +186 -0
  147. stat_agent-2.0.0/src/stat_agent.egg-info/entry_points.txt +4 -0
  148. stat_agent-2.0.0/src/stat_agent.egg-info/requires.txt +72 -0
  149. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent.egg-info/top_level.txt +1 -0
  150. stat_agent-2.0.0/src/stat_bench/__init__.py +6 -0
  151. stat_agent-2.0.0/src/stat_bench/cli.py +151 -0
  152. stat_agent-2.0.0/src/stat_bench/corrupt.py +116 -0
  153. stat_agent-2.0.0/src/stat_bench/judge.py +113 -0
  154. stat_agent-2.0.0/src/stat_bench/replay.py +76 -0
  155. stat_agent-2.0.0/src/stat_bench/result.py +109 -0
  156. stat_agent-2.0.0/src/stat_bench/runner.py +77 -0
  157. stat_agent-2.0.0/src/stat_bench/score/__init__.py +1 -0
  158. stat_agent-2.0.0/src/stat_bench/score/sse.py +99 -0
  159. stat_agent-2.0.0/src/stat_bench/session_bench/__init__.py +6 -0
  160. stat_agent-2.0.0/src/stat_bench/session_bench/runner.py +152 -0
  161. stat_agent-2.0.0/src/stat_bench/session_bench/verifiers.py +93 -0
  162. stat_agent-2.0.0/src/stat_bench/suite.py +130 -0
  163. stat_agent-2.0.0/src/stat_bench/suites/sessionbench/CO-1_correction.yaml +22 -0
  164. stat_agent-2.0.0/src/stat_bench/suites/sessionbench/CR-1_cross_turn_reference.yaml +26 -0
  165. stat_agent-2.0.0/src/stat_bench/suites/sessionbench/OR-1_out_of_registry.yaml +17 -0
  166. stat_agent-2.0.0/src/stat_bench/suites/sessionbench/RE-1_recovery.yaml +17 -0
  167. stat_agent-2.0.0/src/stat_bench/summarize.py +74 -0
  168. stat_agent-2.0.0/src/stat_bench/systems/__init__.py +1 -0
  169. stat_agent-2.0.0/src/stat_bench/systems/base.py +30 -0
  170. stat_agent-2.0.0/src/stat_bench/systems/stat.py +212 -0
  171. stat_agent-2.0.0/src/stat_bench/trace/__init__.py +12 -0
  172. stat_agent-2.0.0/src/stat_bench/trace/parse.py +293 -0
  173. stat_agent-0.1.26/PKG-INFO +0 -289
  174. stat_agent-0.1.26/README.md +0 -218
  175. stat_agent-0.1.26/pyproject.toml +0 -164
  176. stat_agent-0.1.26/stat_agent/__init__.py +0 -50
  177. stat_agent-0.1.26/stat_agent/agent/__init__.py +0 -5
  178. stat_agent-0.1.26/stat_agent/agent/clarification_context.py +0 -445
  179. stat_agent-0.1.26/stat_agent/agent/conversation_orchestrator.py +0 -794
  180. stat_agent-0.1.26/stat_agent/agent/error_reflection.py +0 -284
  181. stat_agent-0.1.26/stat_agent/agent/executor.py +0 -277
  182. stat_agent-0.1.26/stat_agent/agent/llm_backend.py +0 -1773
  183. stat_agent-0.1.26/stat_agent/agent/memory.py +0 -1063
  184. stat_agent-0.1.26/stat_agent/agent/model_config.py +0 -328
  185. stat_agent-0.1.26/stat_agent/agent/notebook_logger.py +0 -289
  186. stat_agent-0.1.26/stat_agent/agent/pipeline_executor.py +0 -730
  187. stat_agent-0.1.26/stat_agent/agent/prompt_logger.py +0 -307
  188. stat_agent-0.1.26/stat_agent/agent/query_planner.py +0 -396
  189. stat_agent-0.1.26/stat_agent/agent/skill_filter.py +0 -235
  190. stat_agent-0.1.26/stat_agent/agent/skill_registry.py +0 -747
  191. stat_agent-0.1.26/stat_agent/agent/skill_verifier.py +0 -420
  192. stat_agent-0.1.26/stat_agent/agent/spatial_agent_core.py +0 -4375
  193. stat_agent-0.1.26/stat_agent/agent/tools.py +0 -484
  194. stat_agent-0.1.26/stat_agent/core/__init__.py +0 -12
  195. stat_agent-0.1.26/stat_agent/core/data_slice.py +0 -344
  196. stat_agent-0.1.26/stat_agent/core/roi_manager.py +0 -447
  197. stat_agent-0.1.26/stat_agent/core/session.py +0 -885
  198. stat_agent-0.1.26/stat_agent/functions/__init__.py +0 -16
  199. stat_agent-0.1.26/stat_agent/functions/io.py +0 -739
  200. stat_agent-0.1.26/stat_agent/skills/alignment-STalign/STalign/__init__.py +0 -0
  201. stat_agent-0.1.26/stat_agent/skills/differential-expression/SKILL.md +0 -78
  202. stat_agent-0.1.26/stat_agent/web/__init__.py +0 -0
  203. stat_agent-0.1.26/stat_agent/web/app.py +0 -2399
  204. stat_agent-0.1.26/stat_agent.egg-info/PKG-INFO +0 -289
  205. stat_agent-0.1.26/stat_agent.egg-info/SOURCES.txt +0 -81
  206. stat_agent-0.1.26/stat_agent.egg-info/entry_points.txt +0 -2
  207. stat_agent-0.1.26/stat_agent.egg-info/requires.txt +0 -50
  208. {stat_agent-0.1.26 → stat_agent-2.0.0}/LICENSE +0 -0
  209. {stat_agent-0.1.26 → stat_agent-2.0.0}/setup.cfg +0 -0
  210. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/alignment-STalign/STalign/STalign.py +0 -0
  211. {stat_agent-0.1.26/stat_agent/skills → stat_agent-2.0.0/src/stat_agent/skills/alignment-STalign/STalign}/__init__.py +0 -0
  212. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/alignment-STalign/STalign/curve_annotator.py +0 -0
  213. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/alignment-STalign/STalign/point_annotator.py +0 -0
  214. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-annotation-GPT/celltype_fast/__init__.py +0 -0
  215. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-annotation-scANVI/celltype_scvi/__init__.py +0 -0
  216. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-annotation-scANVI/celltype_scvi/annotation_scvi.py +0 -0
  217. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-deconvolution-RCTD/deconv_rctd/RCTD.py +0 -0
  218. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/celltype-deconvolution-RCTD/deconv_rctd/__init__.py +0 -0
  219. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/niche-detection-Harmonics/niche_analysis_lib/__init__.py +0 -0
  220. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/niche-detection-Harmonics/niche_analysis_lib/hypo_test.py +0 -0
  221. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/niche-detection-Harmonics/niche_analysis_lib/model.py +0 -0
  222. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent/skills/niche-detection-Harmonics/niche_analysis_lib/utils.py +0 -0
  223. {stat_agent-0.1.26 → stat_agent-2.0.0/src}/stat_agent.egg-info/dependency_links.txt +0 -0
@@ -0,0 +1,335 @@
1
+ Metadata-Version: 2.4
2
+ Name: stat-agent
3
+ Version: 2.0.0
4
+ Summary: STAT: Spatial Transcriptomics Analytical agenT - AI-powered, provenance-aware spatial omics analysis
5
+ Author-email: Yihang Chen <ychenlp@connect.ust.hk>
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: Homepage, https://github.com/chenyhvvvv/STAT-agent
8
+ Project-URL: Repository, https://github.com/chenyhvvvv/STAT-agent
9
+ Keywords: spatial transcriptomics,single-cell,agent,AI,bioinformatics,anndata,scanpy,langgraph
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Science/Research
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
16
+ Requires-Python: >=3.11
17
+ Description-Content-Type: text/markdown
18
+ License-File: LICENSE
19
+ Requires-Dist: numpy>=1.24
20
+ Requires-Dist: pandas>=2.0
21
+ Requires-Dist: anndata>=0.10
22
+ Requires-Dist: scipy>=1.10
23
+ Requires-Dist: scanpy>=1.10
24
+ Requires-Dist: geopandas>=0.14
25
+ Requires-Dist: shapely>=2.0
26
+ Requires-Dist: pillow>=9.0
27
+ Requires-Dist: tifffile>=2022.0
28
+ Requires-Dist: matplotlib>=3.7
29
+ Requires-Dist: pyyaml>=6.0
30
+ Requires-Dist: jinja2>=3.1
31
+ Requires-Dist: pydantic<3,>=2.6
32
+ Requires-Dist: langgraph<2,>=1.0
33
+ Requires-Dist: langchain<2,>=1.0
34
+ Requires-Dist: langchain-core<2,>=1.0
35
+ Requires-Dist: langchain-openai<2,>=1.0
36
+ Requires-Dist: langchain-anthropic<2,>=1.0
37
+ Requires-Dist: langchain-google-genai>=2.0
38
+ Requires-Dist: langgraph-checkpoint-sqlite>=2.0
39
+ Requires-Dist: starlette>=0.40
40
+ Requires-Dist: uvicorn>=0.30
41
+ Requires-Dist: sse-starlette>=2.0
42
+ Requires-Dist: python-multipart>=0.0.9
43
+ Requires-Dist: nbformat>=5.9
44
+ Provides-Extra: loop
45
+ Requires-Dist: deepagents<0.8,>=0.7.13; extra == "loop"
46
+ Provides-Extra: research
47
+ Requires-Dist: tavily-python>=0.5; extra == "research"
48
+ Provides-Extra: dev
49
+ Requires-Dist: pytest>=8; extra == "dev"
50
+ Requires-Dist: pytest-timeout>=2.3; extra == "dev"
51
+ Requires-Dist: hypothesis>=6.100; extra == "dev"
52
+ Requires-Dist: ruff>=0.5; extra == "dev"
53
+ Requires-Dist: httpx>=0.27; extra == "dev"
54
+ Requires-Dist: anyio>=4; extra == "dev"
55
+ Provides-Extra: bench
56
+ Requires-Dist: jsonschema>=4; extra == "bench"
57
+ Requires-Dist: tabulate>=0.9; extra == "bench"
58
+ Provides-Extra: skills
59
+ Requires-Dist: squidpy>=1.2; extra == "skills"
60
+ Requires-Dist: esda>=2.4.0; extra == "skills"
61
+ Requires-Dist: gseapy>=1.0; extra == "skills"
62
+ Requires-Dist: liana; extra == "skills"
63
+ Requires-Dist: cellphonedb<6.0,>=5.0; extra == "skills"
64
+ Requires-Dist: plotnine>=0.12; extra == "skills"
65
+ Requires-Dist: harmonypy>=0.0.9; extra == "skills"
66
+ Requires-Dist: bbknn>=1.5.0; extra == "skills"
67
+ Requires-Dist: scanorama>=1.7.0; extra == "skills"
68
+ Requires-Dist: scvi-tools<2.0,>=1.0; extra == "skills"
69
+ Requires-Dist: tangram-sc>=1.0.0; extra == "skills"
70
+ Requires-Dist: qpsolvers[osqp]>=4.0; extra == "skills"
71
+ Requires-Dist: ray>=2.0; extra == "skills"
72
+ Requires-Dist: flashdeconv>=0.1.0; extra == "skills"
73
+ Requires-Dist: cell2location>=0.1.4; extra == "skills"
74
+ Requires-Dist: palantir>=1.0.0; extra == "skills"
75
+ Requires-Dist: NaiveDE>=0.1; extra == "skills"
76
+ Requires-Dist: SpatialDE>=1.1; extra == "skills"
77
+ Requires-Dist: scikit-misc>=0.5; extra == "skills"
78
+ Requires-Dist: igraph<1.0,>=0.9; extra == "skills"
79
+ Requires-Dist: torch>=2.0; extra == "skills"
80
+ Requires-Dist: SpaGCN>=1.2.5; extra == "skills"
81
+ Requires-Dist: GraphST>=1.1.0; extra == "skills"
82
+ Requires-Dist: paste-bio>=1.0.0; extra == "skills"
83
+ Requires-Dist: POT<0.9.5,>=0.9.0; extra == "skills"
84
+ Requires-Dist: plotly>=5; extra == "skills"
85
+ Requires-Dist: pynrrd>=1.0; extra == "skills"
86
+ Dynamic: license-file
87
+
88
+ <!-- BANNER -->
89
+
90
+ <div align="center">
91
+
92
+ # STAT — Spatial Transcriptomics Analytical agenT
93
+
94
+ Ask in natural language, get a planned, verified, and executed analysis of spatial omics data.
95
+
96
+ [![PyPI version](https://img.shields.io/pypi/v/stat-agent.svg?color=blue)](https://pypi.org/project/stat-agent/)
97
+ [![bioRxiv](https://img.shields.io/badge/bioRxiv-10.64898%2F2026.05.01.722244-b31b1b.svg)](https://doi.org/10.64898/2026.05.01.722244)
98
+ [![Demo](https://img.shields.io/badge/demo-statagent.online-2563eb.svg)](https://statagent.online/)
99
+
100
+ </div>
101
+
102
+ STAT is an AI agent for spatial transcriptomics. Ask in plain language, and STAT plans the analysis,
103
+ picks a method, checks your data, runs the code, fixes errors and explains the result, next to an
104
+ interactive tissue viewer.
105
+
106
+ ## Table of contents
107
+
108
+ - [Installation](#installation)
109
+ - [Quick start](#quick-start)
110
+ - [Data format](#data-format)
111
+ - [Built-in skills](#built-in-skills)
112
+ - [LLM providers](#llm-providers)
113
+ - [Benchmarks and reproducibility](#benchmarks-and-reproducibility)
114
+ - [License](#license)
115
+
116
+ ## Installation
117
+
118
+ Python 3.11 or newer.
119
+
120
+ ```bash
121
+ pip install stat-agent
122
+ pip install "git+https://github.com/chenyhvvvv/STAT-agent.git" # or the latest main from GitHub
123
+ ```
124
+
125
+ The analysis skills' dependencies (squidpy, scvi-tools, torch, ...):
126
+
127
+ ```bash
128
+ pip install "stat-agent[skills]"
129
+ ```
130
+
131
+ Some skills need packages that are not on PyPI (STAGATE with PyG wheels matching your torch and
132
+ CUDA build); see the skill's `SKILL.md` and its `dependencies` block.
133
+
134
+ ## Quick start
135
+
136
+ To try STAT without installing it, open the live demo at [statagent.online](https://statagent.online/).
137
+
138
+ ### Web interface
139
+
140
+ ```bash
141
+ stat-web # http://localhost:8889
142
+ ./start_web.sh # also starts a Jupyter Lab alongside on 8890
143
+ ```
144
+
145
+ 1. Enter the path to your dataset directory (or a saved session directory).
146
+ 2. Pick a provider, model and API key, then *Test Connection*.
147
+ 3. Load the dataset and ask in the chat panel:
148
+ - *"Annotate cell types using the breast-cancer reference."*
149
+ - *"Find spatially variable genes."*
150
+ - *"Show CD8A expression in slice 1."*
151
+ - *"Run RCTD deconvolution and overlay the dominant cell type."*
152
+
153
+ The mode selector switches between interactive (questions pause the turn) and auto (questions are
154
+ answered by policy and shown as assumptions you can override). The *Changes* drawer lists what each
155
+ turn produced, what is stale and why.
156
+
157
+ ### Command line
158
+
159
+ ```bash
160
+ export ANTHROPIC_API_KEY=...
161
+ stat-agent chat ./dataset --model anthropic/claude-sonnet-4-6 # REPL
162
+ stat-agent chat ./dataset --model anthropic/claude-sonnet-4-6 -m "annotate cell types" --mode auto
163
+ stat-agent session report ./logs/session_x --format html --out report.html
164
+ stat-agent skill validate --strict
165
+ ```
166
+
167
+ <details>
168
+ <summary>A chat turn in the interface</summary>
169
+
170
+ <p align="center">
171
+ <a href="https://raw.githubusercontent.com/chenyhvvvv/STAT-agent/main/demo_chat_turn.jpg">
172
+ <img src="https://raw.githubusercontent.com/chenyhvvvv/STAT-agent/main/demo_chat_turn.jpg" alt="STAT one chat-turn demo" width="500" />
173
+ </a>
174
+ </p>
175
+
176
+ </details>
177
+
178
+ ## Data format
179
+
180
+ STAT auto-detects your data layout. Place files in a single directory.
181
+
182
+ **Single-slice**
183
+
184
+ ```text
185
+ dataset/
186
+ ├── tissue.h5ad # Required: AnnData with x, y in obs
187
+ └── he.tif # Optional: H&E image (pixel coords = cell coords)
188
+ ```
189
+
190
+ **Multi-slice**
191
+
192
+ ```text
193
+ dataset/
194
+ ├── tissue_slice_0.h5ad
195
+ ├── he_slice_0.tif
196
+ ├── tissue_slice_1.h5ad
197
+ └── he_slice_1.tif
198
+ ```
199
+
200
+ **Multi-omics (gene + protein)**
201
+
202
+ ```text
203
+ dataset/
204
+ ├── tissue.h5ad # Gene expression
205
+ ├── tissue_protein.h5ad # Protein expression
206
+ ├── he.tif
207
+ └── protein_CD3.tif
208
+ ```
209
+
210
+ **Coordinate convention.** Cell coordinates `(x, y)` in `adata.obs` map directly to image pixel
211
+ `(x, y)`. No coordinate transformation. Note the array indexing swap: image array `img[y, x]`
212
+ corresponds to cell `(x, y)`.
213
+
214
+ **Required AnnData fields:** `adata.obs['x']`, `adata.obs['y']`, and the expression matrix
215
+ `adata.X`. `adata.obs['celltype']` is *optional*; annotation skills populate it.
216
+
217
+ ## Built-in skills
218
+
219
+ Skills are discovered from `src/stat_agent/skills/<slug>/SKILL.md` and from `~/.stat_agent/skills/`
220
+ (user skills take precedence). Each skill carries an applicability contract (modalities, data level,
221
+ slice count), prerequisites, declared inputs and outputs, and a templated code body. The catalogue:
222
+
223
+ <!-- SKILLS-TABLE-START -->
224
+ ### Cell type annotation
225
+
226
+ | Skill | Summary |
227
+ | --- | --- |
228
+ | [Cell Type Annotation with scANVI](src/stat_agent/skills/celltype-annotation-scANVI/SKILL.md) | Annotate cell types in spatial transcriptomics data using scANVI transfer learning from a reference scRNA-seq dataset. |
229
+ | [Fast Cell Type Annotation (Clustering + LLM)](src/stat_agent/skills/celltype-annotation-GPT/SKILL.md) | Annotate cell types using unsupervised clustering, marker genes, and LLM-based annotation. |
230
+ | [Cell Type Annotation via Spatial Mapping (Tangram)](src/stat_agent/skills/annotation-tangram/SKILL.md) | Map single-cell reference annotations onto spatial transcriptomics data using Tangram deep learning alignment. |
231
+
232
+ ### Spot deconvolution
233
+
234
+ | Skill | Summary |
235
+ | --- | --- |
236
+ | [Cell Type Deconvolution (RCTD)](src/stat_agent/skills/celltype-deconvolution-RCTD/SKILL.md) | Perform cell type deconvolution (or annotation on spot) on spatial transcriptomics data (Visium spots) using RCTD with a single-cell refere… |
237
+ | [Bayesian Cell Type Deconvolution (Cell2location)](src/stat_agent/skills/deconvolution-cell2location/SKILL.md) | Reference-based Bayesian deconvolution of spot-level spatial transcriptomics using Cell2location. |
238
+ | [Fast Spot Deconvolution (FlashDeconv)](src/stat_agent/skills/deconvolution-flashdeconv/SKILL.md) | Ultra-fast reference-based cell type deconvolution for spot-level spatial data using FlashDeconv. |
239
+
240
+ ### Spatial domains
241
+
242
+ | Skill | Summary |
243
+ | --- | --- |
244
+ | [Spatial Domain Detection (SpaGCN)](src/stat_agent/skills/spatial-domain-SpaGCN/SKILL.md) | Identify spatial domains in spot-level spatial transcriptomics data using SpaGCN, integrating gene expression, spatial location, and H&E hi… |
245
+ | [Spatial Domain Detection (STAGATE)](src/stat_agent/skills/spatial-domain-STAGATE/SKILL.md) | Identify spatial domains using STAGATE (Spatial-Transcriptomics Graph Attention Auto-Encoder). |
246
+ | [Spatial Domain Detection (GraphST)](src/stat_agent/skills/spatial-domain-GraphST/SKILL.md) | Identify spatial domains in spot-level data using GraphST (Graph Self-supervised Transformer). |
247
+
248
+ ### Spatial statistics & niches
249
+
250
+ | Skill | Summary |
251
+ | --- | --- |
252
+ | [Spatial Statistics Analysis](src/stat_agent/skills/spatial-statistics-squidpy/SKILL.md) | Compute spatial statistics including Moran's I (spatial autocorrelation of genes), Ripley's K (spatial point pattern of cell types), co-occ… |
253
+ | [Neighborhood Enrichment Analysis](src/stat_agent/skills/spatial-stats-neighborhood-enrichment/SKILL.md) | Compute neighborhood enrichment z-scores to identify which cell types are spatially co-localized or depleted from each other's neighborhood… |
254
+ | [Spatial Niche Detection](src/stat_agent/skills/niche-detection-Harmonics/SKILL.md) | Identify spatial cellular niches using Harmonics hierarchical model. |
255
+ | [Spatially Variable Genes (SpatialDE)](src/stat_agent/skills/svg-SpatialDE/SKILL.md) | Identify spatially variable genes using SpatialDE Gaussian process regression. |
256
+
257
+ ### Differential expression & pathway
258
+
259
+ | Skill | Summary |
260
+ | --- | --- |
261
+ | [Differential Gene Expression Analysis](src/stat_agent/skills/differential-expression/SKILL.md) | Find differentially expressed marker genes between groups using scanpy rank_genes_groups with Wilcoxon test. |
262
+ | [GO Enrichment Analysis](src/stat_agent/skills/pathway-GO-enrichment/SKILL.md) | Find enriched Gene Ontology (GO) terms for a user-provided gene list. |
263
+ | [Over-Representation & Pathway Enrichment Analysis (ORA)](src/stat_agent/skills/enrichment-ora-ssgsea/SKILL.md) | Test whether a gene list is enriched for specific pathways or gene sets using Over-Representation Analysis (Fisher's exact test). |
264
+ | [Per-Cell Pathway Activity Scoring (ssGSEA)](src/stat_agent/skills/pathway-ssgsea/SKILL.md) | Compute per-cell pathway activity scores using single-sample Gene Set Enrichment Analysis (ssGSEA). |
265
+ | [Two-Group Pathway Enrichment Comparison](src/stat_agent/skills/pathway-enrichment-compare/SKILL.md) | Compare pathway / gene-set enrichment between two user-provided gene lists (typically markers of two cell populations, clusters, or conditi… |
266
+
267
+ ### Cell-cell communication
268
+
269
+ | Skill | Summary |
270
+ | --- | --- |
271
+ | [Cell-Cell Communication Analysis (LIANA+)](src/stat_agent/skills/cell-communication-LIANA/SKILL.md) | Analyze cell-cell communication using LIANA+ to identify significant ligand-receptor interactions between cell types. |
272
+ | [Cell-Cell Communication Analysis (CellPhoneDB)](src/stat_agent/skills/cell-communication-CellPhoneDB/SKILL.md) | Analyze cell-cell communication using CellPhoneDB statistical method to identify significant ligand-receptor interactions between cell type… |
273
+
274
+ ### Multi-slice integration
275
+
276
+ | Skill | Summary |
277
+ | --- | --- |
278
+ | [Batch Integration (Harmony)](src/stat_agent/skills/integration-Harmony/SKILL.md) | Integrate multiple spatial transcriptomics slices using Harmony batch correction. |
279
+ | [Batch Integration (BBKNN)](src/stat_agent/skills/integration-bbknn/SKILL.md) | Correct batch effects across multiple slices using BBKNN (Batch Balanced K-Nearest Neighbors). |
280
+ | [Batch Integration (Scanorama)](src/stat_agent/skills/integration-scanorama/SKILL.md) | Correct batch effects across multiple slices using Scanorama panoramic stitching. |
281
+
282
+ ### Slice alignment & registration
283
+
284
+ | Skill | Summary |
285
+ | --- | --- |
286
+ | [Spatial Alignment (STalign)](src/stat_agent/skills/alignment-STalign/SKILL.md) | Align two cell-level spatial transcriptomics slices using STalign. |
287
+ | [Slice Registration (PASTE)](src/stat_agent/skills/registration-paste/SKILL.md) | Align multiple spatial transcriptomics slices using PASTE (Probabilistic Alignment of ST Experiments). |
288
+
289
+ ### Trajectory inference
290
+
291
+ | Skill | Summary |
292
+ | --- | --- |
293
+ | [Pseudotime Trajectory Analysis (Palantir / DPT)](src/stat_agent/skills/trajectory-palantir-dpt/SKILL.md) | Infer cell developmental trajectories and pseudotime ordering using expression-based methods. |
294
+
295
+ <!-- SKILLS-TABLE-END -->
296
+
297
+ **Adding a skill.** See [docs/adding-a-skill.md](docs/adding-a-skill.md): scaffold with
298
+ `stat-agent skill new <slug>`, fill in the contract, validate with `stat-agent skill validate --strict`.
299
+
300
+ ## LLM providers
301
+
302
+ Models are addressed as `provider/model-id` (a bare id infers the provider). In the web interface
303
+ pick the provider and type the model id; on the command line export the key and pass `--model`
304
+ or set `STAT_MODEL`.
305
+
306
+ | Provider | Env var | Example |
307
+ | --- | --- | --- |
308
+ | OpenAI | `OPENAI_API_KEY` | `openai/gpt-5.4`, `openai/gpt-4o` |
309
+ | Anthropic | `ANTHROPIC_API_KEY` | `anthropic/claude-opus-4-7`, `anthropic/claude-sonnet-4-6` |
310
+ | Google Gemini | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | `google/gemini-3.1-pro-preview`, `google/gemini-2.5-pro` |
311
+ | DeepSeek | `DEEPSEEK_API_KEY` | `deepseek/deepseek-flash` |
312
+ | Poe (gateway) | `POE_API_KEY` | `poe/claude-sonnet-4.5`, `poe/gpt-5.5` |
313
+ | xAI | `XAI_API_KEY` | `xai/grok-4` |
314
+ | Moonshot | `MOONSHOT_API_KEY` | `moonshot/kimi-k2` |
315
+ | Zhipu | `ZHIPU_API_KEY` | `zhipu/glm-4.5` |
316
+ | DashScope | `DASHSCOPE_API_KEY` | `dashscope/qwen3-max` |
317
+ | Any OpenAI-compatible endpoint | `STAT_API_KEY` | `custom/<model>`, with the endpoint in the web interface's *Base URL* field |
318
+
319
+ The staged pipeline uses prompted JSON for structured outputs, so the prompts are identical across
320
+ backbones and no tool calling is required. The benchmark runs replayed at statagent.online used
321
+ Claude Sonnet 4.6 and DeepSeek V4.1 Flash at maximum reasoning effort.
322
+
323
+ Other settings: `STAT_MODE` (`interactive` or `auto`), `STAT_HOME` (default `~/.stat_agent`, holds
324
+ user skills and the RCTD reference cache), `STAT_LOGS_DIR`, `STAT_EXEC_TIMEOUT`, `STAT_SKILL_PATHS`.
325
+
326
+ ## Benchmarks and reproducibility
327
+
328
+ [statagent.online](https://statagent.online/) has the records of all STAT runs on the single-turn and
329
+ multi-turn queries (the single-query benchmark and SessionBench), each replayable step by step in STAT's
330
+ interface, and a download link for the results of the other experiments. The colorectal cancer (CRC)
331
+ demo records are in [STAT-PaperRepro](https://github.com/chenyhvvvv/STAT-PaperRepro).
332
+
333
+ ## License
334
+
335
+ [BSD-3-Clause](LICENSE) © STAT contributors.
@@ -0,0 +1,248 @@
1
+ <!-- BANNER -->
2
+
3
+ <div align="center">
4
+
5
+ # STAT — Spatial Transcriptomics Analytical agenT
6
+
7
+ Ask in natural language, get a planned, verified, and executed analysis of spatial omics data.
8
+
9
+ [![PyPI version](https://img.shields.io/pypi/v/stat-agent.svg?color=blue)](https://pypi.org/project/stat-agent/)
10
+ [![bioRxiv](https://img.shields.io/badge/bioRxiv-10.64898%2F2026.05.01.722244-b31b1b.svg)](https://doi.org/10.64898/2026.05.01.722244)
11
+ [![Demo](https://img.shields.io/badge/demo-statagent.online-2563eb.svg)](https://statagent.online/)
12
+
13
+ </div>
14
+
15
+ STAT is an AI agent for spatial transcriptomics. Ask in plain language, and STAT plans the analysis,
16
+ picks a method, checks your data, runs the code, fixes errors and explains the result, next to an
17
+ interactive tissue viewer.
18
+
19
+ ## Table of contents
20
+
21
+ - [Installation](#installation)
22
+ - [Quick start](#quick-start)
23
+ - [Data format](#data-format)
24
+ - [Built-in skills](#built-in-skills)
25
+ - [LLM providers](#llm-providers)
26
+ - [Benchmarks and reproducibility](#benchmarks-and-reproducibility)
27
+ - [License](#license)
28
+
29
+ ## Installation
30
+
31
+ Python 3.11 or newer.
32
+
33
+ ```bash
34
+ pip install stat-agent
35
+ pip install "git+https://github.com/chenyhvvvv/STAT-agent.git" # or the latest main from GitHub
36
+ ```
37
+
38
+ The analysis skills' dependencies (squidpy, scvi-tools, torch, ...):
39
+
40
+ ```bash
41
+ pip install "stat-agent[skills]"
42
+ ```
43
+
44
+ Some skills need packages that are not on PyPI (STAGATE with PyG wheels matching your torch and
45
+ CUDA build); see the skill's `SKILL.md` and its `dependencies` block.
46
+
47
+ ## Quick start
48
+
49
+ To try STAT without installing it, open the live demo at [statagent.online](https://statagent.online/).
50
+
51
+ ### Web interface
52
+
53
+ ```bash
54
+ stat-web # http://localhost:8889
55
+ ./start_web.sh # also starts a Jupyter Lab alongside on 8890
56
+ ```
57
+
58
+ 1. Enter the path to your dataset directory (or a saved session directory).
59
+ 2. Pick a provider, model and API key, then *Test Connection*.
60
+ 3. Load the dataset and ask in the chat panel:
61
+ - *"Annotate cell types using the breast-cancer reference."*
62
+ - *"Find spatially variable genes."*
63
+ - *"Show CD8A expression in slice 1."*
64
+ - *"Run RCTD deconvolution and overlay the dominant cell type."*
65
+
66
+ The mode selector switches between interactive (questions pause the turn) and auto (questions are
67
+ answered by policy and shown as assumptions you can override). The *Changes* drawer lists what each
68
+ turn produced, what is stale and why.
69
+
70
+ ### Command line
71
+
72
+ ```bash
73
+ export ANTHROPIC_API_KEY=...
74
+ stat-agent chat ./dataset --model anthropic/claude-sonnet-4-6 # REPL
75
+ stat-agent chat ./dataset --model anthropic/claude-sonnet-4-6 -m "annotate cell types" --mode auto
76
+ stat-agent session report ./logs/session_x --format html --out report.html
77
+ stat-agent skill validate --strict
78
+ ```
79
+
80
+ <details>
81
+ <summary>A chat turn in the interface</summary>
82
+
83
+ <p align="center">
84
+ <a href="https://raw.githubusercontent.com/chenyhvvvv/STAT-agent/main/demo_chat_turn.jpg">
85
+ <img src="https://raw.githubusercontent.com/chenyhvvvv/STAT-agent/main/demo_chat_turn.jpg" alt="STAT one chat-turn demo" width="500" />
86
+ </a>
87
+ </p>
88
+
89
+ </details>
90
+
91
+ ## Data format
92
+
93
+ STAT auto-detects your data layout. Place files in a single directory.
94
+
95
+ **Single-slice**
96
+
97
+ ```text
98
+ dataset/
99
+ ├── tissue.h5ad # Required: AnnData with x, y in obs
100
+ └── he.tif # Optional: H&E image (pixel coords = cell coords)
101
+ ```
102
+
103
+ **Multi-slice**
104
+
105
+ ```text
106
+ dataset/
107
+ ├── tissue_slice_0.h5ad
108
+ ├── he_slice_0.tif
109
+ ├── tissue_slice_1.h5ad
110
+ └── he_slice_1.tif
111
+ ```
112
+
113
+ **Multi-omics (gene + protein)**
114
+
115
+ ```text
116
+ dataset/
117
+ ├── tissue.h5ad # Gene expression
118
+ ├── tissue_protein.h5ad # Protein expression
119
+ ├── he.tif
120
+ └── protein_CD3.tif
121
+ ```
122
+
123
+ **Coordinate convention.** Cell coordinates `(x, y)` in `adata.obs` map directly to image pixel
124
+ `(x, y)`. No coordinate transformation. Note the array indexing swap: image array `img[y, x]`
125
+ corresponds to cell `(x, y)`.
126
+
127
+ **Required AnnData fields:** `adata.obs['x']`, `adata.obs['y']`, and the expression matrix
128
+ `adata.X`. `adata.obs['celltype']` is *optional*; annotation skills populate it.
129
+
130
+ ## Built-in skills
131
+
132
+ Skills are discovered from `src/stat_agent/skills/<slug>/SKILL.md` and from `~/.stat_agent/skills/`
133
+ (user skills take precedence). Each skill carries an applicability contract (modalities, data level,
134
+ slice count), prerequisites, declared inputs and outputs, and a templated code body. The catalogue:
135
+
136
+ <!-- SKILLS-TABLE-START -->
137
+ ### Cell type annotation
138
+
139
+ | Skill | Summary |
140
+ | --- | --- |
141
+ | [Cell Type Annotation with scANVI](src/stat_agent/skills/celltype-annotation-scANVI/SKILL.md) | Annotate cell types in spatial transcriptomics data using scANVI transfer learning from a reference scRNA-seq dataset. |
142
+ | [Fast Cell Type Annotation (Clustering + LLM)](src/stat_agent/skills/celltype-annotation-GPT/SKILL.md) | Annotate cell types using unsupervised clustering, marker genes, and LLM-based annotation. |
143
+ | [Cell Type Annotation via Spatial Mapping (Tangram)](src/stat_agent/skills/annotation-tangram/SKILL.md) | Map single-cell reference annotations onto spatial transcriptomics data using Tangram deep learning alignment. |
144
+
145
+ ### Spot deconvolution
146
+
147
+ | Skill | Summary |
148
+ | --- | --- |
149
+ | [Cell Type Deconvolution (RCTD)](src/stat_agent/skills/celltype-deconvolution-RCTD/SKILL.md) | Perform cell type deconvolution (or annotation on spot) on spatial transcriptomics data (Visium spots) using RCTD with a single-cell refere… |
150
+ | [Bayesian Cell Type Deconvolution (Cell2location)](src/stat_agent/skills/deconvolution-cell2location/SKILL.md) | Reference-based Bayesian deconvolution of spot-level spatial transcriptomics using Cell2location. |
151
+ | [Fast Spot Deconvolution (FlashDeconv)](src/stat_agent/skills/deconvolution-flashdeconv/SKILL.md) | Ultra-fast reference-based cell type deconvolution for spot-level spatial data using FlashDeconv. |
152
+
153
+ ### Spatial domains
154
+
155
+ | Skill | Summary |
156
+ | --- | --- |
157
+ | [Spatial Domain Detection (SpaGCN)](src/stat_agent/skills/spatial-domain-SpaGCN/SKILL.md) | Identify spatial domains in spot-level spatial transcriptomics data using SpaGCN, integrating gene expression, spatial location, and H&E hi… |
158
+ | [Spatial Domain Detection (STAGATE)](src/stat_agent/skills/spatial-domain-STAGATE/SKILL.md) | Identify spatial domains using STAGATE (Spatial-Transcriptomics Graph Attention Auto-Encoder). |
159
+ | [Spatial Domain Detection (GraphST)](src/stat_agent/skills/spatial-domain-GraphST/SKILL.md) | Identify spatial domains in spot-level data using GraphST (Graph Self-supervised Transformer). |
160
+
161
+ ### Spatial statistics & niches
162
+
163
+ | Skill | Summary |
164
+ | --- | --- |
165
+ | [Spatial Statistics Analysis](src/stat_agent/skills/spatial-statistics-squidpy/SKILL.md) | Compute spatial statistics including Moran's I (spatial autocorrelation of genes), Ripley's K (spatial point pattern of cell types), co-occ… |
166
+ | [Neighborhood Enrichment Analysis](src/stat_agent/skills/spatial-stats-neighborhood-enrichment/SKILL.md) | Compute neighborhood enrichment z-scores to identify which cell types are spatially co-localized or depleted from each other's neighborhood… |
167
+ | [Spatial Niche Detection](src/stat_agent/skills/niche-detection-Harmonics/SKILL.md) | Identify spatial cellular niches using Harmonics hierarchical model. |
168
+ | [Spatially Variable Genes (SpatialDE)](src/stat_agent/skills/svg-SpatialDE/SKILL.md) | Identify spatially variable genes using SpatialDE Gaussian process regression. |
169
+
170
+ ### Differential expression & pathway
171
+
172
+ | Skill | Summary |
173
+ | --- | --- |
174
+ | [Differential Gene Expression Analysis](src/stat_agent/skills/differential-expression/SKILL.md) | Find differentially expressed marker genes between groups using scanpy rank_genes_groups with Wilcoxon test. |
175
+ | [GO Enrichment Analysis](src/stat_agent/skills/pathway-GO-enrichment/SKILL.md) | Find enriched Gene Ontology (GO) terms for a user-provided gene list. |
176
+ | [Over-Representation & Pathway Enrichment Analysis (ORA)](src/stat_agent/skills/enrichment-ora-ssgsea/SKILL.md) | Test whether a gene list is enriched for specific pathways or gene sets using Over-Representation Analysis (Fisher's exact test). |
177
+ | [Per-Cell Pathway Activity Scoring (ssGSEA)](src/stat_agent/skills/pathway-ssgsea/SKILL.md) | Compute per-cell pathway activity scores using single-sample Gene Set Enrichment Analysis (ssGSEA). |
178
+ | [Two-Group Pathway Enrichment Comparison](src/stat_agent/skills/pathway-enrichment-compare/SKILL.md) | Compare pathway / gene-set enrichment between two user-provided gene lists (typically markers of two cell populations, clusters, or conditi… |
179
+
180
+ ### Cell-cell communication
181
+
182
+ | Skill | Summary |
183
+ | --- | --- |
184
+ | [Cell-Cell Communication Analysis (LIANA+)](src/stat_agent/skills/cell-communication-LIANA/SKILL.md) | Analyze cell-cell communication using LIANA+ to identify significant ligand-receptor interactions between cell types. |
185
+ | [Cell-Cell Communication Analysis (CellPhoneDB)](src/stat_agent/skills/cell-communication-CellPhoneDB/SKILL.md) | Analyze cell-cell communication using CellPhoneDB statistical method to identify significant ligand-receptor interactions between cell type… |
186
+
187
+ ### Multi-slice integration
188
+
189
+ | Skill | Summary |
190
+ | --- | --- |
191
+ | [Batch Integration (Harmony)](src/stat_agent/skills/integration-Harmony/SKILL.md) | Integrate multiple spatial transcriptomics slices using Harmony batch correction. |
192
+ | [Batch Integration (BBKNN)](src/stat_agent/skills/integration-bbknn/SKILL.md) | Correct batch effects across multiple slices using BBKNN (Batch Balanced K-Nearest Neighbors). |
193
+ | [Batch Integration (Scanorama)](src/stat_agent/skills/integration-scanorama/SKILL.md) | Correct batch effects across multiple slices using Scanorama panoramic stitching. |
194
+
195
+ ### Slice alignment & registration
196
+
197
+ | Skill | Summary |
198
+ | --- | --- |
199
+ | [Spatial Alignment (STalign)](src/stat_agent/skills/alignment-STalign/SKILL.md) | Align two cell-level spatial transcriptomics slices using STalign. |
200
+ | [Slice Registration (PASTE)](src/stat_agent/skills/registration-paste/SKILL.md) | Align multiple spatial transcriptomics slices using PASTE (Probabilistic Alignment of ST Experiments). |
201
+
202
+ ### Trajectory inference
203
+
204
+ | Skill | Summary |
205
+ | --- | --- |
206
+ | [Pseudotime Trajectory Analysis (Palantir / DPT)](src/stat_agent/skills/trajectory-palantir-dpt/SKILL.md) | Infer cell developmental trajectories and pseudotime ordering using expression-based methods. |
207
+
208
+ <!-- SKILLS-TABLE-END -->
209
+
210
+ **Adding a skill.** See [docs/adding-a-skill.md](docs/adding-a-skill.md): scaffold with
211
+ `stat-agent skill new <slug>`, fill in the contract, validate with `stat-agent skill validate --strict`.
212
+
213
+ ## LLM providers
214
+
215
+ Models are addressed as `provider/model-id` (a bare id infers the provider). In the web interface
216
+ pick the provider and type the model id; on the command line export the key and pass `--model`
217
+ or set `STAT_MODEL`.
218
+
219
+ | Provider | Env var | Example |
220
+ | --- | --- | --- |
221
+ | OpenAI | `OPENAI_API_KEY` | `openai/gpt-5.4`, `openai/gpt-4o` |
222
+ | Anthropic | `ANTHROPIC_API_KEY` | `anthropic/claude-opus-4-7`, `anthropic/claude-sonnet-4-6` |
223
+ | Google Gemini | `GOOGLE_API_KEY` or `GEMINI_API_KEY` | `google/gemini-3.1-pro-preview`, `google/gemini-2.5-pro` |
224
+ | DeepSeek | `DEEPSEEK_API_KEY` | `deepseek/deepseek-flash` |
225
+ | Poe (gateway) | `POE_API_KEY` | `poe/claude-sonnet-4.5`, `poe/gpt-5.5` |
226
+ | xAI | `XAI_API_KEY` | `xai/grok-4` |
227
+ | Moonshot | `MOONSHOT_API_KEY` | `moonshot/kimi-k2` |
228
+ | Zhipu | `ZHIPU_API_KEY` | `zhipu/glm-4.5` |
229
+ | DashScope | `DASHSCOPE_API_KEY` | `dashscope/qwen3-max` |
230
+ | Any OpenAI-compatible endpoint | `STAT_API_KEY` | `custom/<model>`, with the endpoint in the web interface's *Base URL* field |
231
+
232
+ The staged pipeline uses prompted JSON for structured outputs, so the prompts are identical across
233
+ backbones and no tool calling is required. The benchmark runs replayed at statagent.online used
234
+ Claude Sonnet 4.6 and DeepSeek V4.1 Flash at maximum reasoning effort.
235
+
236
+ Other settings: `STAT_MODE` (`interactive` or `auto`), `STAT_HOME` (default `~/.stat_agent`, holds
237
+ user skills and the RCTD reference cache), `STAT_LOGS_DIR`, `STAT_EXEC_TIMEOUT`, `STAT_SKILL_PATHS`.
238
+
239
+ ## Benchmarks and reproducibility
240
+
241
+ [statagent.online](https://statagent.online/) has the records of all STAT runs on the single-turn and
242
+ multi-turn queries (the single-query benchmark and SessionBench), each replayable step by step in STAT's
243
+ interface, and a download link for the results of the other experiments. The colorectal cancer (CRC)
244
+ demo records are in [STAT-PaperRepro](https://github.com/chenyhvvvv/STAT-PaperRepro).
245
+
246
+ ## License
247
+
248
+ [BSD-3-Clause](LICENSE) © STAT contributors.