appfl-bio-suite 0.3.0__py3-none-any.whl

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 (146) hide show
  1. appfl_bio_suite/__init__.py +78 -0
  2. appfl_bio_suite/cli.py +1435 -0
  3. appfl_bio_suite/core/__init__.py +0 -0
  4. appfl_bio_suite/core/compat.py +217 -0
  5. appfl_bio_suite/core/config.py +972 -0
  6. appfl_bio_suite/core/drivers/__init__.py +14 -0
  7. appfl_bio_suite/core/drivers/globus_compute_driver.py +228 -0
  8. appfl_bio_suite/core/drivers/serial_driver.py +168 -0
  9. appfl_bio_suite/core/drivers/tes_driver.py +306 -0
  10. appfl_bio_suite/core/endpoint.py +280 -0
  11. appfl_bio_suite/core/experiments.py +319 -0
  12. appfl_bio_suite/core/ga4gh/__init__.py +70 -0
  13. appfl_bio_suite/core/ga4gh/data/duo.json +399 -0
  14. appfl_bio_suite/core/ga4gh/drs.py +805 -0
  15. appfl_bio_suite/core/ga4gh/duo.py +762 -0
  16. appfl_bio_suite/core/ga4gh/resolve.py +282 -0
  17. appfl_bio_suite/core/ga4gh/tes.py +456 -0
  18. appfl_bio_suite/core/ga4gh/trs.py +772 -0
  19. appfl_bio_suite/core/identity.py +273 -0
  20. appfl_bio_suite/core/join.py +214 -0
  21. appfl_bio_suite/core/launch.py +638 -0
  22. appfl_bio_suite/core/loopback.py +336 -0
  23. appfl_bio_suite/core/onboarding.py +669 -0
  24. appfl_bio_suite/core/onboarding_cli.py +174 -0
  25. appfl_bio_suite/core/partner.py +410 -0
  26. appfl_bio_suite/core/plot_assets/argonne-palette.css +206 -0
  27. appfl_bio_suite/core/plot_style.py +92 -0
  28. appfl_bio_suite/core/preflight.py +961 -0
  29. appfl_bio_suite/core/simulation.py +412 -0
  30. appfl_bio_suite/core/site_credentials.py +171 -0
  31. appfl_bio_suite/core/site_trial.py +198 -0
  32. appfl_bio_suite/core/watch.py +849 -0
  33. appfl_bio_suite/core/watch_assets/THIRD_PARTY.md +39 -0
  34. appfl_bio_suite/core/watch_assets/globe.js +489 -0
  35. appfl_bio_suite/core/watch_assets/land.js +2 -0
  36. appfl_bio_suite/core/watch_assets/results.js +162 -0
  37. appfl_bio_suite/core/watch_assets/suite-logo.png +0 -0
  38. appfl_bio_suite/core/watch_assets/vendor.js +2 -0
  39. appfl_bio_suite/core/watch_assets/viewer.css +372 -0
  40. appfl_bio_suite/core/watch_assets/viewer.js +601 -0
  41. appfl_bio_suite/core/watch_catalog.py +209 -0
  42. appfl_bio_suite/experiments/__init__.py +0 -0
  43. appfl_bio_suite/experiments/fine_mapping/__init__.py +59 -0
  44. appfl_bio_suite/experiments/fine_mapping/aggregator.py +860 -0
  45. appfl_bio_suite/experiments/fine_mapping/arms.py +787 -0
  46. appfl_bio_suite/experiments/fine_mapping/backend_outputs.py +124 -0
  47. appfl_bio_suite/experiments/fine_mapping/composition.py +675 -0
  48. appfl_bio_suite/experiments/fine_mapping/configs/clients.template.yaml +37 -0
  49. appfl_bio_suite/experiments/fine_mapping/configs/server.loopback.yaml +77 -0
  50. appfl_bio_suite/experiments/fine_mapping/configs/server.yaml +108 -0
  51. appfl_bio_suite/experiments/fine_mapping/configs/simulation/ci-tiny.yaml +188 -0
  52. appfl_bio_suite/experiments/fine_mapping/configs/simulation/three-site-hapnest.yaml +195 -0
  53. appfl_bio_suite/experiments/fine_mapping/dataset.py +777 -0
  54. appfl_bio_suite/experiments/fine_mapping/fedfm/UPSTREAM.json +40 -0
  55. appfl_bio_suite/experiments/fine_mapping/fedfm/__init__.py +18 -0
  56. appfl_bio_suite/experiments/fine_mapping/fedfm/fed_fine_mapping.py +1096 -0
  57. appfl_bio_suite/experiments/fine_mapping/fedfm/fine_mapping.py +739 -0
  58. appfl_bio_suite/experiments/fine_mapping/fedfm/locus_selection.py +696 -0
  59. appfl_bio_suite/experiments/fine_mapping/fedfm/phenotype_sim.py +870 -0
  60. appfl_bio_suite/experiments/fine_mapping/fedfm/qc.py +357 -0
  61. appfl_bio_suite/experiments/fine_mapping/fedfm/sampling.py +300 -0
  62. appfl_bio_suite/experiments/fine_mapping/fedfm/utils.py +601 -0
  63. appfl_bio_suite/experiments/fine_mapping/fedfm/validation.py +731 -0
  64. appfl_bio_suite/experiments/fine_mapping/figures/__init__.py +16 -0
  65. appfl_bio_suite/experiments/fine_mapping/figures/detail.py +453 -0
  66. appfl_bio_suite/experiments/fine_mapping/figures/eda.py +974 -0
  67. appfl_bio_suite/experiments/fine_mapping/figures/federation.py +1055 -0
  68. appfl_bio_suite/experiments/fine_mapping/figures/figstyle.py +526 -0
  69. appfl_bio_suite/experiments/fine_mapping/figures/paper_plots.py +1954 -0
  70. appfl_bio_suite/experiments/fine_mapping/figures/render.py +201 -0
  71. appfl_bio_suite/experiments/fine_mapping/inference.py +258 -0
  72. appfl_bio_suite/experiments/fine_mapping/matched_comparison.py +526 -0
  73. appfl_bio_suite/experiments/fine_mapping/multisusie.py +245 -0
  74. appfl_bio_suite/experiments/fine_mapping/multisusie_batch.py +259 -0
  75. appfl_bio_suite/experiments/fine_mapping/multisusie_compare.py +328 -0
  76. appfl_bio_suite/experiments/fine_mapping/multisusie_experiment.py +137 -0
  77. appfl_bio_suite/experiments/fine_mapping/multisusie_pipeline.py +508 -0
  78. appfl_bio_suite/experiments/fine_mapping/plotting.py +104 -0
  79. appfl_bio_suite/experiments/fine_mapping/reporting.py +271 -0
  80. appfl_bio_suite/experiments/fine_mapping/rerun.py +408 -0
  81. appfl_bio_suite/experiments/fine_mapping/secure_aggregation.py +74 -0
  82. appfl_bio_suite/experiments/fine_mapping/simulation/__init__.py +399 -0
  83. appfl_bio_suite/experiments/fine_mapping/simulation/bundler.py +227 -0
  84. appfl_bio_suite/experiments/fine_mapping/simulation/cohort.py +299 -0
  85. appfl_bio_suite/experiments/fine_mapping/simulation/schema.py +393 -0
  86. appfl_bio_suite/experiments/fine_mapping/simulation/stages.py +232 -0
  87. appfl_bio_suite/experiments/fine_mapping/site_stage.py +260 -0
  88. appfl_bio_suite/experiments/fine_mapping/trainer.py +798 -0
  89. appfl_bio_suite/experiments/flamby_heart_disease/__init__.py +8 -0
  90. appfl_bio_suite/experiments/flamby_heart_disease/configs/clients.template.yaml +32 -0
  91. appfl_bio_suite/experiments/flamby_heart_disease/configs/server.fedcompass.yaml +92 -0
  92. appfl_bio_suite/experiments/flamby_heart_disease/configs/server.loopback.yaml +57 -0
  93. appfl_bio_suite/experiments/flamby_heart_disease/configs/server.yaml +80 -0
  94. appfl_bio_suite/experiments/flamby_heart_disease/dataset.py +100 -0
  95. appfl_bio_suite/experiments/flamby_heart_disease/model.py +61 -0
  96. appfl_bio_suite/experiments/gwas/__init__.py +17 -0
  97. appfl_bio_suite/experiments/gwas/aggregator.py +312 -0
  98. appfl_bio_suite/experiments/gwas/configs/clients.template.yaml +30 -0
  99. appfl_bio_suite/experiments/gwas/configs/server.loopback.yaml +42 -0
  100. appfl_bio_suite/experiments/gwas/configs/server.yaml +48 -0
  101. appfl_bio_suite/experiments/gwas/configs/simulation/ci-tiny.yaml +28 -0
  102. appfl_bio_suite/experiments/gwas/configs/simulation/published-five-site.yaml +53 -0
  103. appfl_bio_suite/experiments/gwas/configs/simulation/three-site-skewed.yaml +24 -0
  104. appfl_bio_suite/experiments/gwas/configs/simulation/two-site-balanced.yaml +24 -0
  105. appfl_bio_suite/experiments/gwas/dataset.py +109 -0
  106. appfl_bio_suite/experiments/gwas/plotting.py +143 -0
  107. appfl_bio_suite/experiments/gwas/simulation/__init__.py +310 -0
  108. appfl_bio_suite/experiments/gwas/simulation/bundler.py +252 -0
  109. appfl_bio_suite/experiments/gwas/simulation/cohort.py +303 -0
  110. appfl_bio_suite/experiments/gwas/simulation/phenotypes.py +429 -0
  111. appfl_bio_suite/experiments/gwas/simulation/schema.py +205 -0
  112. appfl_bio_suite/experiments/gwas/trainer.py +575 -0
  113. appfl_bio_suite/experiments/methylation/__init__.py +4 -0
  114. appfl_bio_suite/experiments/methylation/__main__.py +68 -0
  115. appfl_bio_suite/experiments/methylation/configs/ci-tiny.yaml +13 -0
  116. appfl_bio_suite/experiments/methylation/configs/poc.yaml +13 -0
  117. appfl_bio_suite/experiments/methylation/configs/stress.yaml +19 -0
  118. appfl_bio_suite/experiments/methylation/configs/tcga-laml.yaml +13 -0
  119. appfl_bio_suite/experiments/methylation/configs/uneven-curves.yaml +39 -0
  120. appfl_bio_suite/experiments/methylation/configs/uneven.yaml +36 -0
  121. appfl_bio_suite/experiments/methylation/dataset.py +155 -0
  122. appfl_bio_suite/experiments/methylation/evaluation.py +55 -0
  123. appfl_bio_suite/experiments/methylation/figures.py +806 -0
  124. appfl_bio_suite/experiments/methylation/gdc.py +234 -0
  125. appfl_bio_suite/experiments/methylation/model.py +32 -0
  126. appfl_bio_suite/experiments/methylation/pipeline.py +479 -0
  127. appfl_bio_suite/experiments/methylation/preprocessing.py +152 -0
  128. appfl_bio_suite/experiments/methylation/reporting.py +122 -0
  129. appfl_bio_suite/experiments/methylation/runner.py +25 -0
  130. appfl_bio_suite/experiments/methylation/simulation.py +85 -0
  131. appfl_bio_suite/experiments/methylation/stress.py +95 -0
  132. appfl_bio_suite/resources/constraints.txt +163 -0
  133. appfl_bio_suite/resources/partner/endpoint-setup.md +297 -0
  134. appfl_bio_suite/resources/partner/experiments/fine-mapping.md +234 -0
  135. appfl_bio_suite/resources/partner/experiments/flamby-heart-disease.md +166 -0
  136. appfl_bio_suite/resources/partner/experiments/gwas.md +124 -0
  137. appfl_bio_suite/resources/partner/experiments/methylation.md +10 -0
  138. appfl_bio_suite/resources/partner/onboarding.md +172 -0
  139. appfl_bio_suite/resources/templates/user_config_template.yaml.j2 +71 -0
  140. appfl_bio_suite/resources/templates/validate_mapping.py +120 -0
  141. appfl_bio_suite-0.3.0.dist-info/METADATA +349 -0
  142. appfl_bio_suite-0.3.0.dist-info/RECORD +146 -0
  143. appfl_bio_suite-0.3.0.dist-info/WHEEL +5 -0
  144. appfl_bio_suite-0.3.0.dist-info/entry_points.txt +2 -0
  145. appfl_bio_suite-0.3.0.dist-info/licenses/LICENSE +33 -0
  146. appfl_bio_suite-0.3.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,78 @@
1
+ """appfl-bio-suite: cross-silo federated learning experiments in computational biology.
2
+
3
+ A downstream extension package for APPFL. Custom trainers, aggregators, models, and
4
+ dataset loaders live here and are referenced by path from configuration; nothing needs to
5
+ be merged into APPFL for an experiment in this suite to run.
6
+
7
+ Layout:
8
+ core/ experiment-agnostic infrastructure (endpoints, identity, preflight,
9
+ launch, partner bundles, simulation contract, config)
10
+ experiments/ one package per experiment; the science lives here
11
+
12
+ Start at docs/coordinator/new-federation.md.
13
+ """
14
+
15
+ from __future__ import annotations
16
+
17
+ import os
18
+ from pathlib import Path
19
+
20
+ from appfl_bio_suite.core.compat import ensure_appfl_globus_compute_importable
21
+
22
+ __version__ = "0.3.0"
23
+
24
+ # Where partners install from.
25
+ #
26
+ # Release wheels are also published on PyPI. Generated partner bundles continue to
27
+ # use an immutable Git tag so their existing installation contract stays consistent.
28
+ #
29
+ # A tag, not a branch. `main` moves, and a federation whose sites installed from `main`
30
+ # on different days is running different code with no way to say which. Every site
31
+ # installing `v0.2.0` is running byte-identical source, for the same reason the Globus
32
+ # Compute stack is pinned in constraints.txt: skew here does not fail at install time,
33
+ # it fails as a deserialization error partway into someone else's run.
34
+ #
35
+ # Bump INSTALL_TAG with __version__ and push the matching git tag; the release checklist
36
+ # in docs/coordinator/releasing.md is what keeps those three in step.
37
+ REPO_URL = "https://github.com/mfjoel01/appfl-bio-suite"
38
+ INSTALL_TAG = f"v{__version__}"
39
+
40
+
41
+ def install_spec(extras: str = "") -> str:
42
+ """The pip requirement a partner installs, as a PEP 508 direct reference.
43
+
44
+ ``extras`` is a comma-separated string ("gwas", "flamby"), matching the shape the
45
+ experiment registry already stores. Empty means no extras -- ``pkg[]`` is not valid
46
+ requirement syntax, so it must be omitted rather than rendered empty.
47
+ """
48
+ name = f"appfl-bio-suite[{extras}]" if extras else "appfl-bio-suite"
49
+ return f"{name} @ git+{REPO_URL}.git@{INSTALL_TAG}"
50
+
51
+
52
+ # Vendored command-line tools, put on PATH at import time.
53
+ #
54
+ # scripts/fine-mapping/install_plink.sh and install_susiex.sh drop static binaries into
55
+ # vendor/bin/, and preflight resolves them as "on PATH *or* in vendor/bin". The code that
56
+ # actually shells out -- run_plink in the vendored fedfm tree -- only ever looks at PATH.
57
+ # Those two disagreed, so a green `preflight --check env` was followed by
58
+ # `PlinkError: PLINK binary not found on PATH: plink` on the very next command.
59
+ #
60
+ # Prepending once here is what makes them agree, and it is done at import rather than in
61
+ # the CLI so that pytest, the drivers, and programmatic callers get it too. In an
62
+ # installed-only environment there is no checkout and nothing vendored, so this is a
63
+ # no-op. Prepended, not appended: a vendored build is chosen deliberately and should win
64
+ # over whatever a cluster module happens to expose.
65
+ _vendor_bin = Path(__file__).resolve().parents[2] / "vendor" / "bin"
66
+ if _vendor_bin.is_dir():
67
+ _entries = os.environ.get("PATH", "").split(os.pathsep)
68
+ if str(_vendor_bin) not in _entries:
69
+ os.environ["PATH"] = os.pathsep.join([str(_vendor_bin), *filter(None, _entries)])
70
+
71
+ # Applied at import time, before anything can reach APPFL's Globus Compute communicator.
72
+ #
73
+ # appfl 1.10.0 imports a globus-compute-sdk module that 4.9.0 does not ship, and this
74
+ # suite pins both. A no-op on any version pair where that is not true. See core/compat.py
75
+ # for the full explanation and the deletion criteria.
76
+ ensure_appfl_globus_compute_importable()
77
+
78
+ __all__ = ["INSTALL_TAG", "REPO_URL", "__version__", "install_spec"]