MyNixOS website logo
Description

Bayesian Quantification of Evidence Sufficiency.

Implements the Quantification Evidence Standard algorithm for computing Bayesian evidence sufficiency from binary evidence matrices. It provides posterior estimates, credible intervals, percentiles, and optional visual summaries. The method is universal, reproducible, and independent of any specific clinical or rule based framework. For details see The Quantitative Omics Epidemiology Group et al. (2025) <doi:10.64898/2025.12.02.25341503>.

quantbayes

quantbayes

quantbayes provides a minimal Bayesian transform for evidence sufficiency from a binary matrix of zero and one entries. The method is simple, portable, and independent of any rule set.

Installation

# Install development version
remotes::install_github("switzerland-omics/quantbayes")

Data layout

quantbayes expects a matrix where:

  • rows are variants
  • columns are evidence rules
  • entries are 0 or 1
  • NA is treated as 0

Example from the built in dataset:

head(core_test_data)

Convert to matrix:

x <- as.matrix(core_test_data[, -1])
rownames(x) <- core_test_data[[1]]

Run quantbayes in one step

res <- quant_es_core(x)

res$global
head(res$variants)

Global contains posterior summaries. Variants contains per variant theta, credible intervals, and percentiles.

Default plots

plots <- quant_es_plots(res, x)

plots$p_global
plots$p_overlay
plots$p_matrix
plots$p_p_hat
plots$p_theta_ci
plots$p_combined

These cover density, overlay of top candidates, evidence matrix, observed proportions, credible intervals, and a combined panel.

Highlight variants of interest

highlight_demo <- list(
  list(id = rownames(x)[1], colour = "#ee4035", size = 4),
  list(id = rownames(x)[5], colour = "#2f4356", size = 4)
)

plots2 <- quant_es_plots(res, x, highlight_points = highlight_demo)
plots2$p_overlay

Custom palettes

pal10 <- colorRampPalette(c("black", "grey"))(10)
pal20 <- colorRampPalette(c("skyblue", "navy"))(20)

plots_custom <- quant_es_plots(
  res,
  x,
  palette10 = pal10,
  palette20 = pal20
)

plots_custom$p_overlay

Any plot returned by quant_es_plots is a standard ggplot, so users can layer themes or labels.

plots$p_overlay + ggplot2::theme_minimal()

File based input

quantbayes can read flat files of binary values:

tmp <- tempfile(fileext = ".tsv")
write.table(core_test_data, tmp, sep = "\t", quote = FALSE, row.names = FALSE)

res_file <- quant_es_from_binary_table(tmp)
res_file$global

Save plots

outdir <- "quantbayes_output"
if (!dir.exists(outdir)) dir.create(outdir)

ggplot2::ggsave(
  file.path(outdir, "overlay.png"),
  plots$p_overlay,
  width = 6,
  height = 4,
  dpi = 120
)

Save tables

write.csv(
  res$variants,
  file.path(outdir, "variants_results.csv"),
  row.names = FALSE
)

write.csv(
  as.data.frame(res$global),
  file.path(outdir, "global_summary.csv"),
  row.names = FALSE
)

Full workflow in six lines

data(core_test_data)

x <- as.matrix(core_test_data[, -1])
rownames(x) <- core_test_data[[1]]

res <- quant_es_core(x)
plots <- quant_es_plots(res, x)
plots$p_combined

Core results example

Clinical genetics example

After Whole Genome Sequencing, a proprietary candidate selection tool identified potential causal variants. A clinical laboratory requires verifiable evidence to support or refute these findings. Each candidate variant was evaluated using a minimal and independent evidence set that records whether supporting evidence is present or absent under a Qualifying Variant Evidence Standard.

res_df <- as.data.frame(res$variants)
global_df <- as.data.frame(res$global)

res_df <- res_df[order(res_df$theta_mean, decreasing = TRUE), ]

head(res_df)
head(global_df)

Example output:

variant_idkmtheta_meantheta_lowertheta_upperpercentile
2-54234474-G-A_AR18240.73080.54870.879399.875
6-72183475-CG-N_AR18240.73080.54870.879399.875
1-14682421-G-A_AD17240.69230.50610.850599.375
7-751853912-C-T_AR17240.69230.50610.850599.375
X-224319469-CT-C_XR16240.65380.46500.820397.000
X-414698664-CT-C_XD16240.65380.46500.820397.000

Scenario: autosomal recessive disease XXX with a primary candidate variant. Variant: 2-54234474-G-A_AR

Estimated values from quantbayes:

  • Posterior evidence sufficiency: 0.731
  • Credible interval: 0.549 to 0.879
  • Percentile: 99.88

These values reflect the relative strength of evidence for this variant within the tested panel.

Total evaluated variants: 400 Global evidence sufficiency: 0.52 Credible interval: 0.38 to 0.65. Across all variants, the mean theta is 0.52 and the median is 0.54.


Vignette

The full vignette includes highlighting, palettes, file input, and plot saving:

vignette("quantbayes")
Metadata

Version

0.1.0

License

Unknown

Platforms (78)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows