Conversation
Builds ghcr.io/lcr-bccrc/lcr-scripts/mfr:1.0, referenced by both rules in lcr-modules' mfR/1.0. R (clustering) and Python/htslib (tabix-based MAF extraction) share one image since nothing requires them separate and the combined env solves with no conflicts.
Battenberg-style checks (same pattern as sniffles/1.1 and mosdepth/1.0) verifying Rscript and each R package (readr, dplyr, cluster, ggplot2) load, and that python and tabix are on PATH. Verified against a real conda env built from this Dockerfile's exact package list -- all seven checks pass.
The build was failing on the chained `mamba clean --all --yes`: the preceding `mamba install` transaction succeeds (all packages install fine), but pulls in a newer libxml2 as a transitive dependency of r-base/python/htslib than what condaforge/mambaforge:latest's base env was originally linked against. mamba's own libmambapy extension is linked against the original libxml2, so the *next* mamba invocation (the chained `mamba clean`) fails at import time: ImportError: libxml2.so.2: cannot open shared object file Since nothing downstream needs mamba to still work inside the built image, cleaning the package cache via `rm -rf /opt/conda/pkgs/*` avoids depending on a second mamba invocation entirely. This also matches the majority pattern already used elsewhere in this repo (mosdepth, sniffles, battenberg, starfish, etc.) -- this Dockerfile was the outlier, having carried over `mamba clean` unreconsidered from the original prototype.
Runs the same operations mfR's src/python/extract_chrom_maf.py and src/R/cluster_foci.R perform (tabix per-chromosome extraction + coding- variant filtering, then hierarchical clustering into foci) against committed synthetic per-sample MAFs, comparing output to committed golden files -- catches real output-correctness regressions, not just "packages import" like the smoke test did. This immediately caught a real bug: silhouette(lab, d) returns a bare NA (not a matrix) when every cluster is a singleton, which happens at h_min before any merge -- indexing NA[, "sil_width"] crashed uncaught. Fixed here and in the lcr-modules source (companion commit). ggplot2/cairo rendering is exercised (proves the plotting stack works) but not included in the golden-file diff, since PDF output isn't byte-stable across builds.
run_tests.sh was failing in CI when UCSC downloads were unavailable. Read chain files from data/ (committed in a prior commit) instead, and symlink liftover/2.0/data to the 1.0 copy, matching the existing pattern for liftover.yaml and run_tests.sh. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
mfr/1.0/Dockerfile: a single combined R + Python/htslib container for themfRlcr-module (hierarchical clustering of non-coding mutation positions into "foci"), built fromcondaforge/mambaforge:latestpython>=3.9,htslib(providestabix, used for streaming per-chromosome MAF extraction)lcr-modules'mfR/1.0— nothing requires them to run in separate environments, and the combined env solves cleanly with no package conflictsmfr/1.0/run_tests.sh: Battenberg-style smoke tests (same pattern assniffles/1.1/mosdepth/1.0) verifyingRscriptand each R package load, and thatpython/tabixare onPATH. Verified locally against a real conda env built from this Dockerfile's exact package list, all seven checks pass.Builds
ghcr.io/lcr-bccrc/lcr-scripts/mfr:1.0, whichlcr-modules'mfR/1.0config/default.yamlalready points at (see companion PR onlcr-modules).During
liftovertests, chain file downloads usingcurlwere failing, causing the GitHub actions to fail. To fix this, I downloaded the chain files and placed them withinliftover/1.0/data/and symlinked these within2.0/.