Short answer: not without real work, and the obstacle is R, not Python. This records what was actually tested, so the question does not have to be re-investigated from scratch.
| Component | Bundling difficulty |
|---|---|
| IgBLAST binaries | Trivial, already bundled via extraResources |
| Reference databases | Trivial, already in the repository |
| Python + changeo/presto/pandas/… | Easy, see below |
| R + alakazam/shazam/ape | Hard, see below |
python-build-standalone
publishes relocatable CPython builds for macOS on both architectures
(cpython-3.11.x-aarch64-apple-darwin-install_only.tar.gz and the x86_64
equivalent, current as of release 20260728). Unpack it into the app bundle,
pip install -r backend/requirements.txt into it, point AUTOAB_PYTHON at it.
Nothing is patched, so no code-signature issues arise. Roughly 250 MB.
R installs to a fixed location and bakes that path into its own files. A relocation attempt was carried out and got most of the way:
bin/Ris a shell script withR_HOME_DIR=/Library/Frameworks/...hardcoded. Patchable withsed. ✅bin/Rscriptis a Mach-O binary containing the absolute path as a string. Not patchable in place, but avoidable by invokingbin/R -f script.Rinstead. ✅- The shared libraries carry absolute install names. Rewriting them to
@loader_pathwithinstall_name_toolworks. Afterwardsotool -Lshowed zero absolute references, and base R ran correctly from an arbitrary directory, reporting the relocatedR_HOMEand computing normally. ✅ - Apple Silicon kills modified binaries.
install_name_toolinvalidates the code signature, and the process is then terminated with SIGKILL (observed: exit 137, no output at all). Every touched Mach-O must be re-signed ad hoc withcodesign --force --sign -.⚠️ - Doing this across the package tree is where it broke. The 109 required
packages contain 107
.sofiles. After rewriting their references and re-signing, R segfaulted (invalid permissions). The naive@rpath+add_rpathapproach is not sufficient; getting this right needs a more careful, tested bundling script. ❌
Size, measured: base R is ~48 MB, the 109 required packages are ~459 MB (alakazam pulls in a substantial Bioconductor subtree: Biostrings, GenomicRanges, SummarizedExperiment and friends). So an R bundle is roughly 500 MB, and a fully standalone app would land near 1 GB.
conda env create -f backend/environment.yml installs Python, R, all R
packages, Change-O, pRESTO and IgBLAST in one command. That is the normal
distribution mechanism for bioinformatics tooling, it is cross-platform, and it
sidesteps every problem above.
Note that this file previously listed bioconductor-alakazam and
bioconductor-shazam, which do not exist on any channel. The correct package
names are r-alakazam and r-shazam. The environment could never have been
created as specified; it has been corrected.
In rough order of effort:
- Bundle Python only (easy) and keep conda or a single
install.packages()line for R. Removes most of the setup burden for little risk. - Add a first-run bootstrap: detect missing dependencies on launch and install them, rather than failing with a blank backend.
- Full bundling: relocate R with a proper, tested script that rewrites install names and re-signs every binary, then sign and notarise the whole app with an Apple Developer ID. Expect days rather than hours, and expect it to break again on the next R version.
- Remove R altogether by porting
calculateDistribution.R, the tree-building scripts and the visualisation to Python. This is the only option that makes the app genuinely self-contained, but it changes scientific code and would need its results re-validated against the current ones.