Skip to content

Add Logistic PCA (LPCA) analysis#500

Draft
Jeebjean wants to merge 2 commits into
Reed-CompBio:mainfrom
Jeebjean:lpca-integration
Draft

Add Logistic PCA (LPCA) analysis#500
Jeebjean wants to merge 2 commits into
Reed-CompBio:mainfrom
Jeebjean:lpca-integration

Conversation

@Jeebjean

Copy link
Copy Markdown

Summary

Adds Logistic PCA (LPCA) as a new SPRAS analysis, reducing the binary
edge-by-run matrix built from pathway reconstruction outputs and reporting the
proportion of deviance explained. LPCA is the binary-data counterpart to the
existing PCA analysis.

Changes

  • New analysis.lpca config block (include, k, m, cv, transpose) with
    a matching LpcaAnalysis schema and wiring in config.py.
  • lpca_analysis Snakemake rule, restricted to algorithms with multiple
    parameter combinations (same guard as the per-algorithm PCA analysis).
  • spras/analysis/lpca.py: builds the binary matrix via summarize_networks
    and runs the logisticPCA container through run_container_and_log. m is
    fixed by default; cross-validation (cv: true) and matrix transposition
    (transpose: true, giving runs x edges to mirror the classic PCA analysis)
    are opt-in.
  • docker-wrappers/lpca/: pinned rocker/r-base Dockerfile installing
    logisticPCA and its ggplot2 dependencies, the run_lpca.R / run_cv.R
    scripts, and a README.

Testing

Testing this PR locally

The wrapper is included in this PR, so you can build the image locally and run
LPCA without waiting for anything to be published:

docker build -t reedcompbio/lpca:v1 docker-wrappers/lpca/

Docker uses the local image without pulling, so once it is built, enable
analysis.lpca.include: true in your config and run the pipeline as usual.
I built and tested this end to end locally on pathlinker and omicsintegrator1.

Before / at merge

For users who do not build locally, the image needs to be published to
reedcompbio/lpca:v1 on Docker Hub by a maintainer with organization access:

docker build -t reedcompbio/lpca:v1 docker-wrappers/lpca/
docker push reedcompbio/lpca:v1

cc @agitter @ntalluri

Jeebjean added 2 commits July 10, 2026 11:28
Adds an analysis.lpca config block (include, k, m, cv, transpose) with a matching LpcaAnalysis schema, an lpca_analysis Snakemake rule restricted to algorithms with multiple parameter combinations, and an LPCA analysis module that builds the binary edge-by-run matrix via summarize_networks and runs the logisticPCA container through run_container_and_log. m is fixed by default; cross-validation and matrix transposition are opt-in.
Adds docker-wrappers/lpca with a pinned rocker/r-base Dockerfile that installs logisticPCA and its ggplot2 dependencies, the run_lpca.R and run_cv.R scripts under /app, and a README documenting the config options, script contracts, and how to build and publish reedcompbio/lpca:v1.
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 spras | 🛠️ Build #33534855 | 📁 Comparing bb338a8 against latest (1cb9d03)

  🔍 Preview build  

3 files changed
± genindex.html
± fordevs/spras.config.html
± fordevs/spras.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant