multibench-sc 0.2.1__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 (119) hide show
  1. multibench_sc-0.2.1/LICENSE +202 -0
  2. multibench_sc-0.2.1/PKG-INFO +83 -0
  3. multibench_sc-0.2.1/README.md +60 -0
  4. multibench_sc-0.2.1/multibench/__init__.py +46 -0
  5. multibench_sc-0.2.1/multibench/__main__.py +7 -0
  6. multibench_sc-0.2.1/multibench/cli.py +255 -0
  7. multibench_sc-0.2.1/multibench/config.py +109 -0
  8. multibench_sc-0.2.1/multibench/data/__init__.py +2 -0
  9. multibench_sc-0.2.1/multibench/data/catalog.py +132 -0
  10. multibench_sc-0.2.1/multibench/data/fetch.py +73 -0
  11. multibench_sc-0.2.1/multibench/data/results.py +128 -0
  12. multibench_sc-0.2.1/multibench/discover.py +181 -0
  13. multibench_sc-0.2.1/multibench/engine/__init__.py +0 -0
  14. multibench_sc-0.2.1/multibench/engine/builder.py +52 -0
  15. multibench_sc-0.2.1/multibench/engine/drivers/run_matilda.py +84 -0
  16. multibench_sc-0.2.1/multibench/engine/drivers/run_stabmap.R +71 -0
  17. multibench_sc-0.2.1/multibench/engine/env_groups.yaml +283 -0
  18. multibench_sc-0.2.1/multibench/engine/env_locks/MOFA2_env.yml +418 -0
  19. multibench_sc-0.2.1/multibench/engine/env_locks/env_moETM.yml +189 -0
  20. multibench_sc-0.2.1/multibench/engine/env_locks/env_sciPENN.yml +79 -0
  21. multibench_sc-0.2.1/multibench/engine/env_locks/glue.yml +146 -0
  22. multibench_sc-0.2.1/multibench/engine/env_locks/matilda.post.sh +18 -0
  23. multibench_sc-0.2.1/multibench/engine/env_locks/matilda.yml +117 -0
  24. multibench_sc-0.2.1/multibench/engine/env_locks/paste_envi.yml +210 -0
  25. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_cobolt3.post.sh +9 -0
  26. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_cobolt3.yml +96 -0
  27. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_concerto.yml +114 -0
  28. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_gpsa2.yml +493 -0
  29. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_ipolng2.yml +76 -0
  30. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_mira.yml +131 -0
  31. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_multigrate2.yml +164 -0
  32. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_multivi.yml +141 -0
  33. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_r.post.sh +21 -0
  34. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_r.yml +396 -0
  35. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scican.yml +125 -0
  36. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scjoint.yml +93 -0
  37. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scmdc.yml +94 -0
  38. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scmm2.yml +60 -0
  39. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scmsi.yml +75 -0
  40. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scmvp4.post.sh +13 -0
  41. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scmvp4.yml +71 -0
  42. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_scvi.yml +144 -0
  43. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_seurat4b.yml +305 -0
  44. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_seurat5.yml +160 -0
  45. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_torch.post.sh +17 -0
  46. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_torch.yml +135 -0
  47. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_torch_v2.post.sh +17 -0
  48. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_torch_v2.yml +288 -0
  49. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_vimcca.yml +121 -0
  50. multibench_sc-0.2.1/multibench/engine/env_locks/scmb_vipcca27.yml +115 -0
  51. multibench_sc-0.2.1/multibench/engine/env_locks/spiral_environment.post.sh +17 -0
  52. multibench_sc-0.2.1/multibench/engine/env_locks/spiral_environment.yml +644 -0
  53. multibench_sc-0.2.1/multibench/engine/env_locks/unitednet.yml +342 -0
  54. multibench_sc-0.2.1/multibench/engine/env_specs.yaml +851 -0
  55. multibench_sc-0.2.1/multibench/engine/envs.py +783 -0
  56. multibench_sc-0.2.1/multibench/engine/ingest.py +125 -0
  57. multibench_sc-0.2.1/multibench/engine/io.py +20 -0
  58. multibench_sc-0.2.1/multibench/engine/methods.yaml +955 -0
  59. multibench_sc-0.2.1/multibench/engine/packed_urls.json +31 -0
  60. multibench_sc-0.2.1/multibench/engine/params.yaml +582 -0
  61. multibench_sc-0.2.1/multibench/engine/registry.py +107 -0
  62. multibench_sc-0.2.1/multibench/engine/resolve.py +263 -0
  63. multibench_sc-0.2.1/multibench/engine/runner.py +199 -0
  64. multibench_sc-0.2.1/multibench/engine/runtimes.yaml +306 -0
  65. multibench_sc-0.2.1/multibench/engine/schema.py +81 -0
  66. multibench_sc-0.2.1/multibench/eval/__init__.py +4 -0
  67. multibench_sc-0.2.1/multibench/eval/io.py +42 -0
  68. multibench_sc-0.2.1/multibench/eval/pipeline.py +81 -0
  69. multibench_sc-0.2.1/multibench/eval/scib.py +266 -0
  70. multibench_sc-0.2.1/multibench/files/README_PROVENANCE.txt +5 -0
  71. multibench_sc-0.2.1/multibench/files/dataset.csv +72 -0
  72. multibench_sc-0.2.1/multibench/files/method.csv +41 -0
  73. multibench_sc-0.2.1/multibench/files/metric_full.csv +11 -0
  74. multibench_sc-0.2.1/multibench/plot/__init__.py +32 -0
  75. multibench_sc-0.2.1/multibench/plot/bar.py +125 -0
  76. multibench_sc-0.2.1/multibench/plot/bubble.py +351 -0
  77. multibench_sc-0.2.1/multibench/plot/style.py +28 -0
  78. multibench_sc-0.2.1/multibench/workflow.py +1066 -0
  79. multibench_sc-0.2.1/multibench_sc.egg-info/PKG-INFO +83 -0
  80. multibench_sc-0.2.1/multibench_sc.egg-info/SOURCES.txt +117 -0
  81. multibench_sc-0.2.1/multibench_sc.egg-info/dependency_links.txt +1 -0
  82. multibench_sc-0.2.1/multibench_sc.egg-info/entry_points.txt +2 -0
  83. multibench_sc-0.2.1/multibench_sc.egg-info/requires.txt +16 -0
  84. multibench_sc-0.2.1/multibench_sc.egg-info/top_level.txt +1 -0
  85. multibench_sc-0.2.1/pyproject.toml +29 -0
  86. multibench_sc-0.2.1/setup.cfg +4 -0
  87. multibench_sc-0.2.1/tests/test_api_smoke.py +25 -0
  88. multibench_sc-0.2.1/tests/test_bar.py +44 -0
  89. multibench_sc-0.2.1/tests/test_bubble.py +119 -0
  90. multibench_sc-0.2.1/tests/test_builder.py +224 -0
  91. multibench_sc-0.2.1/tests/test_catalog.py +58 -0
  92. multibench_sc-0.2.1/tests/test_cli.py +44 -0
  93. multibench_sc-0.2.1/tests/test_config.py +35 -0
  94. multibench_sc-0.2.1/tests/test_discover.py +96 -0
  95. multibench_sc-0.2.1/tests/test_discovery_helpers.py +45 -0
  96. multibench_sc-0.2.1/tests/test_env_lockfiles.py +34 -0
  97. multibench_sc-0.2.1/tests/test_eval_io.py +103 -0
  98. multibench_sc-0.2.1/tests/test_eval_isolated_f1.py +72 -0
  99. multibench_sc-0.2.1/tests/test_eval_only.py +122 -0
  100. multibench_sc-0.2.1/tests/test_eval_reshape.py +40 -0
  101. multibench_sc-0.2.1/tests/test_eval_scib.py +85 -0
  102. multibench_sc-0.2.1/tests/test_ingest.py +59 -0
  103. multibench_sc-0.2.1/tests/test_lock_installable.py +121 -0
  104. multibench_sc-0.2.1/tests/test_metric_groups.py +56 -0
  105. multibench_sc-0.2.1/tests/test_mplbackend.py +34 -0
  106. multibench_sc-0.2.1/tests/test_name_consistency.py +13 -0
  107. multibench_sc-0.2.1/tests/test_nousersite.py +49 -0
  108. multibench_sc-0.2.1/tests/test_orientation_preflight.py +74 -0
  109. multibench_sc-0.2.1/tests/test_package_data.py +49 -0
  110. multibench_sc-0.2.1/tests/test_params_api.py +104 -0
  111. multibench_sc-0.2.1/tests/test_registry.py +98 -0
  112. multibench_sc-0.2.1/tests/test_resolve.py +68 -0
  113. multibench_sc-0.2.1/tests/test_results.py +43 -0
  114. multibench_sc-0.2.1/tests/test_run_all_dispatch.py +135 -0
  115. multibench_sc-0.2.1/tests/test_runner.py +111 -0
  116. multibench_sc-0.2.1/tests/test_schema.py +34 -0
  117. multibench_sc-0.2.1/tests/test_style.py +29 -0
  118. multibench_sc-0.2.1/tests/test_workflow.py +76 -0
  119. multibench_sc-0.2.1/tests/test_workflow_extra.py +158 -0
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,83 @@
1
+ Metadata-Version: 2.4
2
+ Name: multibench-sc
3
+ Version: 0.2.1
4
+ Summary: Clean Python API wrapping the scMultiBench benchmark: run methods, evaluate, and plot.
5
+ License: Apache-2.0
6
+ Requires-Python: >=3.9
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: pandas<3,>=2.0
10
+ Requires-Dist: numpy>=1.24
11
+ Requires-Dist: matplotlib>=3.7
12
+ Requires-Dist: h5py>=3.8
13
+ Requires-Dist: anndata>=0.9
14
+ Requires-Dist: pyyaml>=6.0
15
+ Requires-Dist: scanpy>=1.9
16
+ Requires-Dist: scib>=1.1
17
+ Provides-Extra: dev
18
+ Requires-Dist: pytest>=7.4; extra == "dev"
19
+ Provides-Extra: eval
20
+ Provides-Extra: loom
21
+ Requires-Dist: loompy>=3.0; extra == "loom"
22
+ Dynamic: license-file
23
+
24
+ # scMultiBench
25
+
26
+ [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DSichang/scMultiBench/blob/main/notebooks/colab_quickstart.ipynb)
27
+ [![Docs](https://img.shields.io/badge/docs-dsichang.github.io%2FscMultiBench-blue)](https://dsichang.github.io/scMultiBench/)
28
+ [![PyPI](https://img.shields.io/pypi/v/multibench-sc)](https://pypi.org/project/multibench-sc/)
29
+
30
+ A systematic benchmark of single-cell multimodal integration, with `multibench` -
31
+ a typed Python API that runs 40 integration methods across four scenarios
32
+ (vertical, diagonal, mosaic, cross), scores them with scIB metrics, and draws
33
+ the paper's figures.
34
+
35
+ **Documentation and tutorials:** <https://dsichang.github.io/scMultiBench/>
36
+
37
+ ## Quick start
38
+
39
+ ```bash
40
+ pip install multibench-sc # the API (import name: multibench)
41
+ ```
42
+
43
+ For the tutorials (they also use the stored benchmark tables shipped in this
44
+ repository), clone instead: `git clone https://github.com/DSichang/scMultiBench.git
45
+ && cd scMultiBench && pip install -e .`
46
+
47
+ ```python
48
+ import multibench as mtb
49
+
50
+ mtb.list_methods() # the 40-method registry
51
+ mtb.method_info("Matilda") # everything known about one method
52
+ mtb.scan("D11", "vertical") # what can run on a dataset, and why not
53
+ res = mtb.run_all("D11", "vertical", out_dir="out/") # run + score
54
+ res.plot() # the paper-style bubble panel
55
+ ```
56
+
57
+ Running methods needs their conda environments (Linux). The package itself is
58
+ ~2 MB - install only the environments you need:
59
+
60
+ ```bash
61
+ multibench env doctor # what exists / is missing
62
+ multibench env install --methods Matilda --run # one method (2-14 GB)
63
+ multibench env install --category vertical --run # one category (45-101 GB)
64
+ ```
65
+
66
+ The benchmark datasets are downloaded separately - see
67
+ [Get the data](https://dsichang.github.io/scMultiBench/installation/#get-the-data).
68
+
69
+ ## Try it without installing anything
70
+
71
+ The [Colab quickstart](https://colab.research.google.com/github/DSichang/scMultiBench/blob/main/notebooks/colab_quickstart.ipynb)
72
+ installs the API, explores the registry, and reproduces the benchmark figures
73
+ from the shipped result tables - entirely in the browser. The full published
74
+ rankings are browsable in the
75
+ [interactive explorer](https://shiny.maths.usyd.edu.au/scMultiBench/).
76
+
77
+ ## Citation
78
+
79
+ Liu, Ding et al. Benchmarking single-cell multimodal data integrations.
80
+ *Nature Methods* 22, 2449-2460 (2025).
81
+ Every method you run is third-party software with its own paper - please cite
82
+ it alongside the benchmark; `mtb.method_info(name)` points to each method's
83
+ upstream repository and reference.
@@ -0,0 +1,60 @@
1
+ # scMultiBench
2
+
3
+ [![Open in Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/DSichang/scMultiBench/blob/main/notebooks/colab_quickstart.ipynb)
4
+ [![Docs](https://img.shields.io/badge/docs-dsichang.github.io%2FscMultiBench-blue)](https://dsichang.github.io/scMultiBench/)
5
+ [![PyPI](https://img.shields.io/pypi/v/multibench-sc)](https://pypi.org/project/multibench-sc/)
6
+
7
+ A systematic benchmark of single-cell multimodal integration, with `multibench` -
8
+ a typed Python API that runs 40 integration methods across four scenarios
9
+ (vertical, diagonal, mosaic, cross), scores them with scIB metrics, and draws
10
+ the paper's figures.
11
+
12
+ **Documentation and tutorials:** <https://dsichang.github.io/scMultiBench/>
13
+
14
+ ## Quick start
15
+
16
+ ```bash
17
+ pip install multibench-sc # the API (import name: multibench)
18
+ ```
19
+
20
+ For the tutorials (they also use the stored benchmark tables shipped in this
21
+ repository), clone instead: `git clone https://github.com/DSichang/scMultiBench.git
22
+ && cd scMultiBench && pip install -e .`
23
+
24
+ ```python
25
+ import multibench as mtb
26
+
27
+ mtb.list_methods() # the 40-method registry
28
+ mtb.method_info("Matilda") # everything known about one method
29
+ mtb.scan("D11", "vertical") # what can run on a dataset, and why not
30
+ res = mtb.run_all("D11", "vertical", out_dir="out/") # run + score
31
+ res.plot() # the paper-style bubble panel
32
+ ```
33
+
34
+ Running methods needs their conda environments (Linux). The package itself is
35
+ ~2 MB - install only the environments you need:
36
+
37
+ ```bash
38
+ multibench env doctor # what exists / is missing
39
+ multibench env install --methods Matilda --run # one method (2-14 GB)
40
+ multibench env install --category vertical --run # one category (45-101 GB)
41
+ ```
42
+
43
+ The benchmark datasets are downloaded separately - see
44
+ [Get the data](https://dsichang.github.io/scMultiBench/installation/#get-the-data).
45
+
46
+ ## Try it without installing anything
47
+
48
+ The [Colab quickstart](https://colab.research.google.com/github/DSichang/scMultiBench/blob/main/notebooks/colab_quickstart.ipynb)
49
+ installs the API, explores the registry, and reproduces the benchmark figures
50
+ from the shipped result tables - entirely in the browser. The full published
51
+ rankings are browsable in the
52
+ [interactive explorer](https://shiny.maths.usyd.edu.au/scMultiBench/).
53
+
54
+ ## Citation
55
+
56
+ Liu, Ding et al. Benchmarking single-cell multimodal data integrations.
57
+ *Nature Methods* 22, 2449-2460 (2025).
58
+ Every method you run is third-party software with its own paper - please cite
59
+ it alongside the benchmark; `mtb.method_info(name)` points to each method's
60
+ upstream repository and reference.
@@ -0,0 +1,46 @@
1
+ """multibench - run and compare single-cell multimodal integration methods.
2
+
3
+ Quickstart
4
+ ----------
5
+ ::
6
+
7
+ import multibench as mtb
8
+
9
+ mtb.list_categories() # the four integration scenarios
10
+ print(mtb.describe_layout()) # how to lay out YOUR dataset
11
+
12
+ mtb.scan("MYDATA") # which methods can run on it (and why not the rest)
13
+
14
+ res = mtb.run_all("MYDATA", "vertical", out_dir="out/")
15
+ print(res.summary) # per-method status + metrics
16
+ print(res.failures) # what did not finish, and why
17
+ res.plot().savefig("compare.png")
18
+
19
+ The four ``category`` values are ``vertical``, ``diagonal``, ``mosaic`` and
20
+ ``cross`` - see :func:`list_categories` for what each one means, and
21
+ :func:`describe_layout` for the filenames each expects.
22
+ """
23
+
24
+ from . import config
25
+ from . import plot
26
+ from . import eval
27
+ from .data import catalog
28
+ from .data.results import load_results, available_datasets
29
+ from .eval.pipeline import evaluate, to_long
30
+ from .engine.runner import run
31
+ from .engine.registry import list_methods, list_tasks
32
+ from .engine.resolve import inputs_for, labels_for
33
+ from .engine import ingest as io
34
+ from .engine import envs as env
35
+ from .discover import find_methods, method_info, params_for
36
+ from .workflow import (scan, run_all, BatchResult, list_categories,
37
+ describe_layout, load_batch, runtime_hint, sweep)
38
+
39
+ __version__ = "0.2.1"
40
+
41
+ __all__ = ["config", "plot", "eval", "catalog", "load_results", "available_datasets",
42
+ "evaluate", "to_long", "run", "list_methods", "list_tasks", "inputs_for",
43
+ "labels_for", "io", "env", "method_info", "find_methods", "params_for",
44
+ "scan", "run_all", "BatchResult",
45
+ "list_categories", "describe_layout", "load_batch",
46
+ "runtime_hint", "sweep", "__version__"]
@@ -0,0 +1,7 @@
1
+ """Enable ``python -m multibench`` (equivalent to the ``multibench`` console script)."""
2
+ import sys
3
+
4
+ from .cli import main
5
+
6
+ if __name__ == "__main__":
7
+ sys.exit(main())
@@ -0,0 +1,255 @@
1
+ """Thin CLI over the multibench Python API."""
2
+ from __future__ import annotations
3
+
4
+ import argparse
5
+ import shlex
6
+ import os
7
+ import sys
8
+
9
+
10
+
11
+ def _cmd_list(args) -> int:
12
+ from .engine import registry
13
+ for m in registry.list_methods(category=args.category, task=args.task,
14
+ runnable=args.runnable or None):
15
+ print(m)
16
+ return 0
17
+
18
+
19
+ def _cmd_find(args) -> int:
20
+ needs = True if args.needs_labels else None
21
+ from . import discover
22
+ for m in discover.find_methods(category=args.category, task=args.task,
23
+ needs_labels=needs, atac=args.atac,
24
+ runnable=args.runnable or None):
25
+ print(m)
26
+ return 0
27
+
28
+
29
+ def _cmd_plot(args) -> int:
30
+ if args.kind != "bubble":
31
+ raise SystemExit(f"unknown plot kind {args.kind!r}")
32
+ from . import load_results
33
+ from . import plot as plot_ns
34
+ df = load_results(category=args.category, dataset=args.dataset)
35
+ metrics = args.metrics.split(",") if args.metrics else None
36
+ plot_ns.bubble(df, metrics=metrics, aggregate=args.aggregate, save=args.out)
37
+ print(f"wrote {args.out}")
38
+ return 0
39
+
40
+
41
+ def _parse_inputs(pairs) -> dict:
42
+ out = {}
43
+ for p in pairs or []:
44
+ if "=" not in p:
45
+ raise SystemExit(f"--input must be role=path, got {p!r}")
46
+ role, path = p.split("=", 1)
47
+ if role.strip() == "" or path == "":
48
+ raise SystemExit(f"--input must be role=path with non-empty parts, got {p!r}")
49
+ out[role] = path
50
+ return out
51
+
52
+
53
+ def _cmd_run(args) -> int:
54
+ import multibench
55
+ res = multibench.run(method=args.method, category=args.category, task=args.task,
56
+ inputs=_parse_inputs(args.input), out_dir=args.out,
57
+ cmd_template=args.runner)
58
+ print(f"ran {args.method} -> {res.out_dir}")
59
+ return 0
60
+
61
+
62
+ def _cmd_evaluate(args) -> int:
63
+ import multibench
64
+ df = multibench.evaluate(output=args.output, category=args.category, task=args.task,
65
+ labels=args.labels, clustering=args.cluster,
66
+ batch=getattr(args, "batch", None))
67
+ if args.out:
68
+ df.to_csv(args.out)
69
+ print(f"wrote {args.out}")
70
+ else:
71
+ print(df.to_string())
72
+ return 0
73
+
74
+
75
+ def _cmd_env(args) -> int:
76
+ from .engine import envs
77
+ cmd = args.env_cmd
78
+ if cmd == "status":
79
+ for r in envs.status():
80
+ mark = "x" if r["exists"] else " "
81
+ tag = r["difficulty"] + ("*" if r["verified_working"] else "")
82
+ print(f"[{mark}] {r['method']:16} {r['group']:16} {tag}")
83
+ return 0
84
+ if cmd == "groups":
85
+ for name, spec in envs.groups().items():
86
+ if spec.get("shared"):
87
+ print(f"{name:16} ({len(spec['members']):2}): {', '.join(spec['members'])}")
88
+ return 0
89
+ if cmd == "plan":
90
+ _mlist = getattr(args, "methods", None)
91
+ _mlist = [m.strip() for m in _mlist.split(",")] if _mlist else None
92
+ for p in envs.plan(category=getattr(args, "category", None), methods=_mlist):
93
+ tag = "shared" if p["shared"] else "own"
94
+ print(f"{p['env']:16} [{tag:6}] <- {', '.join(p['methods'])}")
95
+ return 0
96
+ if cmd == "doctor":
97
+ _mlist = getattr(args, "methods", None)
98
+ _mlist = [m.strip() for m in _mlist.split(",")] if _mlist else None
99
+ rows = envs.doctor(category=getattr(args, "category", None), methods=_mlist)
100
+ for r in rows:
101
+ mark = "x" if r["exists"] else ("L" if r["has_lock"] else "!")
102
+ print(f"[{mark}] {r['env']:18} ({len(r['methods']):2}) <- {', '.join(r['methods'])}")
103
+ missing = [r for r in rows if not r["exists"]]
104
+ nolock = [r["env"] for r in missing if not r["has_lock"]]
105
+ print(f"# {len(rows)} envs needed, {len(missing)} missing"
106
+ + (f"; NO lockfile for: {', '.join(nolock)}" if nolock else ""))
107
+ print("# legend: [x]=installed [L]=missing, lockfile ready (run `multibench env install --run`) [!]=missing, no lockfile")
108
+ return 0
109
+ if cmd == "install":
110
+ _mlist = getattr(args, "methods", None)
111
+ _mlist = [m.strip() for m in _mlist.split(",")] if _mlist else None
112
+ if getattr(args, "packed", False) and getattr(args, "run", False):
113
+ for r in envs.doctor(category=getattr(args, "category", None),
114
+ methods=_mlist):
115
+ if not r["exists"] and envs.install_packed(r["env"]):
116
+ print(f"{r['env']:18} [PACKED ] <- {', '.join(r['methods'])}")
117
+ try:
118
+ rows = envs.create_all(category=getattr(args, "category", None),
119
+ methods=_mlist,
120
+ dry_run=not getattr(args, "run", False))
121
+ except RuntimeError as e:
122
+ print(f"error: {e}")
123
+ return 1
124
+ for r in rows:
125
+ state = ("have" if r["exists"]
126
+ else ("BUILD" if r["has_lock"] and getattr(args, "run", False)
127
+ else "build(dry-run)" if r["has_lock"] else "NO-LOCK"))
128
+ print(f"{r['env']:18} [{state:14}] <- {', '.join(r['methods'])}")
129
+ if not getattr(args, "run", False):
130
+ print("# dry-run — add --run to create the missing envs from their lockfiles")
131
+ return 0
132
+ if cmd == "freeze":
133
+ if getattr(args, "all", False):
134
+ for env in envs.required_envs(category=getattr(args, "category", None)):
135
+ try:
136
+ print(f"froze {env} -> {envs.freeze(env)}")
137
+ except Exception as e: # noqa: BLE001 - report per-env, keep going
138
+ print(f"SKIP {env}: {str(e)[:120]}")
139
+ else:
140
+ if not getattr(args, "env", None):
141
+ print("error: name an env to freeze, or pass --all")
142
+ return 2
143
+ print(f"froze {args.env} -> {envs.freeze(args.env)}")
144
+ return 0
145
+ if cmd == "create-group":
146
+ cmds = envs.create_group(args.group, dry_run=not getattr(args, "run", False))
147
+ if not getattr(args, "run", False):
148
+ print("# dry-run — add --run to execute:")
149
+ for c in cmds:
150
+ print(shlex.join(c))
151
+ else:
152
+ print(f"created group env {args.group}")
153
+ return 0
154
+ method = getattr(args, "method", None)
155
+ name = getattr(args, "name", None)
156
+ if cmd == "recipe":
157
+ for c in envs.create_commands(method, env_name=name):
158
+ print(shlex.join(c))
159
+ return 0
160
+ if cmd == "yml":
161
+ y = envs.environment_yml(method, env_name=name)
162
+ out = getattr(args, "out", None)
163
+ if out:
164
+ with open(out, "w") as f:
165
+ f.write(y)
166
+ print(f"wrote {out}")
167
+ else:
168
+ print(y, end="")
169
+ return 0
170
+ if cmd == "create":
171
+ cmds = envs.create(method, env_name=name, dry_run=not getattr(args, "run", False))
172
+ if not getattr(args, "run", False):
173
+ print("# dry-run — add --run to execute:")
174
+ for c in cmds:
175
+ print(shlex.join(c))
176
+ else:
177
+ print(f"created environment for {method}")
178
+ return 0
179
+ raise SystemExit(
180
+ "usage: multibench env {status|groups|plan|doctor|install|freeze|recipe|yml|create|create-group}")
181
+
182
+
183
+ def build_parser() -> argparse.ArgumentParser:
184
+ p = argparse.ArgumentParser(prog="multibench")
185
+ sub = p.add_subparsers(dest="command", required=True)
186
+
187
+ pl = sub.add_parser("list"); pl.add_argument("--category"); pl.add_argument("--task")
188
+ pl.add_argument("--runnable", action="store_true",
189
+ help="only methods with a declared variant (usable by run)")
190
+ pl.set_defaults(func=_cmd_list)
191
+
192
+ pf = sub.add_parser("find")
193
+ pf.add_argument("--category"); pf.add_argument("--task")
194
+ pf.add_argument("--needs-labels", action="store_true")
195
+ pf.add_argument("--atac", choices=["peak", "gene_activity"],
196
+ help="filter by ATAC representation the method consumes")
197
+ pf.add_argument("--runnable", action="store_true",
198
+ help="only methods with a declared variant (usable by run)")
199
+ pf.set_defaults(func=_cmd_find)
200
+
201
+ pp = sub.add_parser("plot")
202
+ pp.add_argument("kind")
203
+ pp.add_argument("--category", required=True); pp.add_argument("--dataset")
204
+ pp.add_argument("--metrics"); pp.add_argument("--aggregate", default="dataset")
205
+ pp.add_argument("--out", required=True)
206
+ pp.set_defaults(func=_cmd_plot)
207
+
208
+ pr = sub.add_parser("run")
209
+ pr.add_argument("--method", required=True); pr.add_argument("--category", required=True)
210
+ pr.add_argument("--task", default="clustering")
211
+ pr.add_argument("--input", action="append", help="role=path (repeatable)")
212
+ pr.add_argument("--out", required=True); pr.add_argument("--runner")
213
+ pr.set_defaults(func=_cmd_run)
214
+
215
+ pe = sub.add_parser("evaluate")
216
+ pe.add_argument("--output", required=True)
217
+ pe.add_argument("--category", help="reserved; not used by v1 metrics")
218
+ pe.add_argument("--task", default="clustering")
219
+ pe.add_argument("--batch", help="per-cell batch labels CSV (required for --task batch/all)")
220
+ pe.add_argument("--labels"); pe.add_argument("--cluster"); pe.add_argument("--out")
221
+ pe.set_defaults(func=_cmd_evaluate)
222
+
223
+ pv = sub.add_parser("env", help="per-method environment recipes")
224
+ ev = pv.add_subparsers(dest="env_cmd", required=True)
225
+ ev.add_parser("status").set_defaults(func=_cmd_env)
226
+ ev.add_parser("groups").set_defaults(func=_cmd_env)
227
+ er = ev.add_parser("recipe"); er.add_argument("method"); er.add_argument("--name"); er.set_defaults(func=_cmd_env)
228
+ ey = ev.add_parser("yml"); ey.add_argument("method"); ey.add_argument("--name"); ey.add_argument("--out"); ey.set_defaults(func=_cmd_env)
229
+ ec = ev.add_parser("create"); ec.add_argument("method"); ec.add_argument("--name"); ec.add_argument("--run", action="store_true"); ec.set_defaults(func=_cmd_env)
230
+ ep = ev.add_parser("plan"); ep.add_argument("--category"); ep.add_argument("--methods", help="comma-separated method names; only their envs"); ep.set_defaults(func=_cmd_env)
231
+ eg = ev.add_parser("create-group"); eg.add_argument("group"); eg.add_argument("--run", action="store_true"); eg.set_defaults(func=_cmd_env)
232
+ edoc = ev.add_parser("doctor", help="preflight: which envs are present / need building"); edoc.add_argument("--category"); edoc.add_argument("--methods", help="comma-separated method names; only their envs"); edoc.set_defaults(func=_cmd_env)
233
+ ei = ev.add_parser("install", help="build every needed env from its lockfile"); ei.add_argument("--category"); ei.add_argument("--methods", help="comma-separated method names; only their envs"); ei.add_argument("--packed", action="store_true", help="use prebuilt archives when published; fall back to the lockfile build"); ei.add_argument("--run", action="store_true"); ei.set_defaults(func=_cmd_env)
234
+ ef = ev.add_parser("freeze", help="capture an env (or --all) to a committed lockfile"); ef.add_argument("env", nargs="?"); ef.add_argument("--all", action="store_true"); ef.add_argument("--category"); ef.set_defaults(func=_cmd_env)
235
+ return p
236
+
237
+
238
+ def main(argv=None) -> int:
239
+ args = build_parser().parse_args(argv)
240
+ try:
241
+ return args.func(args)
242
+ except KeyboardInterrupt:
243
+ print("interrupted", file=sys.stderr)
244
+ return 130
245
+ except Exception as e: # noqa: BLE001 - the CLI's single error boundary
246
+ if os.environ.get("MULTIBENCH_DEBUG"):
247
+ raise
248
+ msg = e.args[0] if isinstance(e, KeyError) and e.args else e
249
+ print(f"error: {msg}", file=sys.stderr)
250
+ print("(set MULTIBENCH_DEBUG=1 for the full traceback)", file=sys.stderr)
251
+ return 1
252
+
253
+
254
+ if __name__ == "__main__":
255
+ raise SystemExit(main())