BayesPrismExt: Enhanced Chain Storage and CV Computation
An extended version of BayesPrism with practical improvements for RNA-seq deconvolution
I've developed an extended version of the BayesPrism package with practical improvements for handling MCMC chain storage and coefficient-of-variation calculations in bulk RNA-seq deconvolution workflows.
Modifications
BayesPrismExt adds three optional arguments to the main run.prism and run.prism.st functions:
save.chain
Controls chain output with options for "none" (default, fastest), "theta" (cell-type
fractions only), or "all" (both theta and Z expression matrices). Chains are stored in
compressed HDF5 format with automatic chunking.
h5.file
Specifies the HDF5 output path (defaults to gibbs_chain.h5).
compute.z.cv
Enables coefficient-of-variation computation for gene-level Z parameters (disabled by default to reduce
memory overhead). The standard theta.cv remains always computed.
Use Case
This is useful when you need to:
- Inspect posterior distributions directly after deconvolution
- Perform custom convergence diagnostics on MCMC chains
- Compute gene-specific uncertainty metrics without re-running the entire deconvolution
- Handle large chain arrays efficiently using HDF5 compression
The HDF5 format handles large chain arrays efficiently and includes a simple read.h5.chain()
helper for extraction by sample index or name.
Access the Code
BayesPrismExt repository: github.com/sam-zare/BayesPrismExt
Original BayesPrism package: github.com/Danko-Lab/BayesPrism