|
| 1 | +# SelectSim (Python) 0.1.0 |
| 2 | + |
| 3 | +Initial feature-complete Python port of the [SelectSim R package](https://github.com/CSOgroup/SelectSim). |
| 4 | + |
| 5 | +* Ported the core algorithm: `selectX()` end-to-end pipeline, `AlterationLandscape`, |
| 6 | + template-matrix generation (`template.py`), TMB-based weighting (`weights.py`), |
| 7 | + the permutation null model (`null_model.py`), and all overlap / effect-size / |
| 8 | + FDR statistics (`stats.py`). |
| 9 | +* Added an optional accelerated backend for `null_model_parallel` |
| 10 | + (`backend="jax"`, via the `selectsim[fast]` extra) alongside the default |
| 11 | + NumPy backend, and an optional on-disk Zarr store for large null-model runs |
| 12 | + (`store="zarr"`, via the `selectsim[storage]` extra) so simulations no |
| 13 | + longer need to be held entirely in memory. |
| 14 | +* Added `selectsim.gam`: a full port of `R/gam_utils.r`'s MAF-ingestion |
| 15 | + pipeline (`filter_maf_*`, `stat_maf_*`, `maf_to_gam`, `TCGA_maf_schema`, |
| 16 | + `GENIE_maf_schema`, `mutation_type`) for building Gene Alteration Matrices |
| 17 | + (GAMs) directly from raw MAF files. |
| 18 | +* Added `selectsim.plotting`: matplotlib/seaborn ports of the R package's |
| 19 | + visualization helpers -- `theme_publication`, `obs_exp_scatter`, |
| 20 | + `overlap_pair_extract`, `ridge_plot_ed`, `ridge_plot_ed_compare`. |
| 21 | +* Added `selectsim.io`: Parquet read/write helpers and Zarr null-model store |
| 22 | + utilities. |
| 23 | +* Bundled real TCGA LUAD example data (`tests/data/*.parquet`, exported from |
| 24 | + the R package's `luad_run_data`/`luad_result`/`luad_maf` datasets) and |
| 25 | + added an R-parity test suite (`TestSelectXWithRData` in |
| 26 | + `tests/test_selectsim.py`) validating the Python port's output against a |
| 27 | + real `SelectSim::selectX()` R reference run. |
| 28 | +* 126 tests passing across algorithm, statistics, GAM ingestion, plotting, |
| 29 | + and I/O modules. |
| 30 | +* Added Sphinx documentation (`docs/`) with a full API reference, an |
| 31 | + "Overview" quick-start, and two tutorial notebooks (`introduction`, |
| 32 | + `data_processing`) mirroring the R package's vignettes, plus standard |
| 33 | + open-source project scaffolding (`LICENSE`, `CITATION.cff`, CI workflows, |
| 34 | + issue templates). |
| 35 | +* Supports Python 3.10-3.12 (`requires-python = ">=3.10,<3.13"`). The upper |
| 36 | + bound is intentional, not a typo: numpy/scipy/jax/zarr don't all publish |
| 37 | + prebuilt wheels for 3.13+ yet, and installing on an unsupported interpreter |
| 38 | + can silently trigger a slow (or failing) from-source build of numpy. |
| 39 | + 3.10/3.11/3.12 were each verified to resolve prebuilt wheels and pass the |
| 40 | + full test suite. |
| 41 | + |
| 42 | +# SelectSim (Python) 0.2.0 |
| 43 | + |
| 44 | +* Fixed several correctness bugs found in code review: `filter_maf_column` |
| 45 | + computed a union instead of an intersection when excluding rows matching |
| 46 | + several substring values (`inclusive=False, fixed=False`); `store="zarr"` |
| 47 | + fully materialized all permutations in memory before writing them to disk, |
| 48 | + defeating its own purpose (now streams in bounded batches, ~5x lower peak |
| 49 | + memory); the jax backend recompiled from scratch on every call instead of |
| 50 | + reusing JAX's compilation cache; `n_cores` was silently ignored with |
| 51 | + `backend="jax"` (now warns); `ridge_plot_ed` crashed on an empty null |
| 52 | + model; and `retrieve_outliers`'s `n_sim` parameter was dead code and its |
| 53 | + 90th-percentile threshold was off-by-one relative to the R original. |
| 54 | +* This round of work (the fixes above, plus the earlier module ports, |
| 55 | + documentation, and uv migration) was developed with the assistance of |
| 56 | + Claude Code (Anthropic), directed and verified by Arvind Iyer throughout; |
| 57 | + see `git log` for detailed commit history. |
| 58 | + |
| 59 | +# SelectSim (Python) 0.3.0 |
| 60 | + |
| 61 | +* **Performance**: the default numpy null-model backend |
| 62 | + (`null_model_parallel`, `store="memory"` or `"zarr"`) no longer loops |
| 63 | + over genes in Python to pick each row's top-k residual columns; |
| 64 | + it now uses the same vectorized double-argsort rank trick the (now |
| 65 | + removed) jax backend used, with no per-gene Python loop. Benchmarked |
| 66 | + as bit-identical to the old implementation (full R-parity test suite |
| 67 | + still passes) and consistently faster, especially at higher `n_cores`. |
| 68 | +* **Performance**: `store="zarr"` null-model runs now chunk the on-disk |
| 69 | + Zarr array to match the internal write-batch size instead of |
| 70 | + defaulting to one chunk per permutation; writing in batches of 200 |
| 71 | + (the default) previously forced 200 separate compress/write calls per |
| 72 | + batch. Benchmarked at ~2.5x faster zarr writes in isolation. |
| 73 | +* **Performance**: `estimate_p_val`'s `gene_names: List[str]` parameter |
| 74 | + is now `gene_index: Dict[str, int]` -- callers looking up many pairs |
| 75 | + (as `estimate_pairwise_p` does, used when `estimate_pairwise=True`) |
| 76 | + now build the name-to-index mapping once instead of doing an O(n_genes) |
| 77 | + list scan per gene per pair. |
| 78 | +* **Removed**: the jax null-model backend (`backend="jax"` on |
| 79 | + `null_model_parallel`, the `selectsim[fast]` extra). Benchmarked |
| 80 | + against the numpy backend on real LUAD-sized data on CPU (no GPU): |
| 81 | + jax was consistently 5-10x *slower*, dominated by per-call JIT |
| 82 | + dispatch overhead that this workload's array sizes never amortize. |
| 83 | + If GPU-backed acceleration is needed in the future, it should be |
| 84 | + re-evaluated against the current (vectorized) numpy backend on |
| 85 | + representative GPU hardware, not reintroduced by default. |
| 86 | +* **Fixed**: `significance_heatmap` was implemented and tested but never |
| 87 | + exported from the top-level `selectsim` package (only reachable via |
| 88 | + `selectsim.plotting.significance_heatmap`); it's now `ss.significance_heatmap`. |
| 89 | +* Added `null_model_parallel`/`selectX` `store="auto"`: estimates the |
| 90 | + null model's memory footprint from cohort size and `n_permut` and |
| 91 | + picks `"memory"` or `"zarr"` automatically against a detected (or |
| 92 | + configured, `memory_budget_gb`) RAM budget, so one call scales safely |
| 93 | + across machines without the caller needing to know cohort dimensions |
| 94 | + up front. |
| 95 | +* Added `oncoprint` and `oncoprint_pair`: new (not present in the R |
| 96 | + package) multi-gene and two-gene co-mutation visualizations comparing |
| 97 | + the observed alteration pattern to a retained null-model simulation, |
| 98 | + with a per-sample TMB track. |
| 99 | +* Extended the `introduction` tutorial notebook with `significance_heatmap`, |
| 100 | + `oncoprint`, `oncoprint_pair`, and `ridge_plot_ed_compare` (previously |
| 101 | + only `obs_exp_scatter` and `ridge_plot_ed` were demonstrated). |
| 102 | +* This round of work was developed with the assistance of Claude Code |
| 103 | + (Anthropic), directed and verified by Arvind Iyer throughout; see |
| 104 | + `git log` for detailed commit history. |
0 commit comments