Skip to content

Add optional MissBayes Bayesian missingness workflow - #10

Draft
AmosMoses777 wants to merge 1 commit into
computproteomics:mainfrom
AmosMoses777:missbayes-current-upstream
Draft

Add optional MissBayes Bayesian missingness workflow#10
AmosMoses777 wants to merge 1 commit into
computproteomics:mainfrom
AmosMoses777:missbayes-current-upstream

Conversation

@AmosMoses777

Copy link
Copy Markdown

Summary

This PR adds an optional MissBayes workflow to the PolySTest Shiny application.

MissBayes provides empirical-Bayes/Bayesian modelling of missingness and
differential expression without imputation. The integration is kept separate
from the existing PolySTest statistical workflow and does not change current
upstream PolySTest statistical outputs.

Main changes

  • Adds a MissBayes adapter with strict feature/sample identity validation.
  • Keeps a clean experiment input separate from result-bearing PolySTest state.
  • Runs MissBayes asynchronously using Shiny ExtendedTask + mirai.
  • Uses a bounded worker pool and disables MissBayes internal parallelism.
  • Adds:
    • comparison selection
    • configurable ROPE half-width
    • posterior-error cutoff
    • result/status table
    • CSV export
    • convergence/fit-status reporting
  • Adds explicit posterior plotting as a fresh background MCMC refit for the
    selected feature.
  • Adds stale/superseded-result protection for long-running background jobs.
  • Explicitly blocks paired designs because the current MissBayes API does not
    support paired/blocking structure.
  • Adds development and deployment Dockerfiles with pinned MissBayes/JAGS
    dependencies.
  • Adds comprehensive unit and real-runtime contract tests.

Upstream compatibility

This branch was forward-ported onto current upstream main
(eb044c06772e8f242f949ebc163b939b1c1a1e9a).

Current-upstream PolySTest behaviour was measured before the port and compared
afterwards. Canonical regulated-feature counts were unchanged.

A pre-existing regression test was also corrected so paired and unpaired
workflows are tested from independent clean inputs rather than chaining the
paired result into the unpaired analysis.

Existing newer upstream fixes, including the global q-value/BH handling and
Shiny/plotting fixes, have been retained rather than replaced by older versions
from the original development branch.

Verification

Final forward-port verification:

  • Complete suite: 24 files, 78 test blocks, 452/452 expectations passed
  • MissBayes focused tests: 386/386 passed
  • Real MissBayes/JAGS contract: PASS
  • ExtendedTask/mirai background contract: PASS
  • Posterior-refit plot contract: PASS
  • Strict single-session PolySTest → MissBayes → PolySTest E2E: PASS
  • Final Docker image launches without source mounts or custom R_LIBS
  • Shiny app returns HTTP 200
  • No developer-local absolute paths remain in the package/deployment image
  • MissBayes execution does not modify PolySTest analysis state

Statistical notes

  • MissBayes is optional and separate from the existing PolySTest statistics.
  • Paired designs are currently unsupported and explicitly blocked.
  • ROPE and posterior-error decisions are Bayesian quantities and are not
    presented as conventional p-values or BH q-values.
  • Directional local FDR is reported only for directional calls.
  • Posterior plots are new MCMC refits and do not reuse samples from the table
    analysis.
  • MissBayes internal parallelism is disabled because execution already occurs
    in a background mirai worker.

MissBayes version

Pinned MissBayes revision:

cd283693a16336d49e49a4132acc05822f92b2d6

Tested with:

  • R 4.4.2
  • PolySTest 1.7.3
  • Shiny 1.10.0
  • mirai 2.1.0
  • missBayes 0.99.0
  • rjags 4.16
  • JAGS 4.3.2

@AmosMoses777
AmosMoses777 marked this pull request as draft August 5, 2026 12:31
@veitveit

veitveit commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Interesting and thank you!

I might need a bit of time to go through it.

@AmosMoses777

AmosMoses777 commented Aug 7, 2026 via email

Copy link
Copy Markdown
Author

@veitveit

veitveit commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

What a surprise! I hope all is well!

I already was wondering who might be implementing the competition into PolySTest :-). No harm done, don't worry.

Also all good to your family, and maybe there is a chance to actually meet at some point. Maybe EuPA in Würzburg?

Cheers
Veit

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.

2 participants