Package 'FusioMR'

Title: Flexible, Unified and Versatile Mendelian Randomization
Description: A Bayesian Mendelian Randomization framework for causal effect estimation from GWAS summary statistics. Supports single and multiple exposure/outcome analyses with optional correlated horizontal pleiotropy.
Authors: Bowei Kang [aut, cre], Sihao Feng [aut]
Maintainer: Bowei Kang <[email protected]>
License: MIT + file LICENSE
Version: 2.0.0
Built: 2026-05-23 13:23:25 UTC
Source: https://github.com/kangbw702/FusioMR

Help Index


FusioMR: A Flexible and unified MR framework using summary statistics for single- and multi-outcome, tailored for molecular trait exposures while also applicable to complex trait exposures.

Description

Main function of the FusioMR package. Offer robust estimates the causal effect of an exposure on an outcome from GWAS summary statistics, using Bayesian hierarchical model and uses Gibbs sampling.

Usage

fusiomr(
  b_exp,
  se_exp,
  b_out,
  se_out,
  model = c("seso_uhp_only", "seso_with_chp", "semo", "memo"),
  control = parameter_control(),
  verbose = FALSE
)

Arguments

b_exp

Numeric vector of SNP-exposure effect estimates.

se_exp

Numeric vector of standard errors of b_exp.

b_out

Numeric vector of SNP-outcome effect estimates.

se_out

Numeric vector of standard errors of b_out.

model

Character string. One of "seso_uhp_only", "seso_with_chp", "semo", "memo".

control

A list of advanced prior hyper-parameters returned by parameter_control. Defaults are suitable for most uses.

verbose

Logical; if TRUE, print progress messages.

Value

A list with components

est

causal effect estimation

se

sd of the causal effect.

pval

two-sided p-value

ci

95% empirical credible interval.

model

The model used.

Examples

## Not run: 
set.seed(1)
K <- 50
b_exp  <- rnorm(K, 0, 0.1);  se_exp <- rep(0.01, K)
b_out  <- 0.3 * b_exp + rnorm(K, 0, 0.01); se_out <- rep(0.01, K)
model <- fusiomr(b_exp, se_exp, b_out, se_out,
               model = "seso_uhp_only")
model$est; model$se; model$ci;

## End(Not run)

Control advanced parameters for FusioMR models

Description

Bundles advanced hyper-parameters for the MCMC settings, IV-selection thresholds, and empirical-Bayes variance priors setting ups. Typically, users never need to touch this: fusiomr() uses parameter_control() with sensible defaults tuned for estimation. Pass a customized value of parameters only when needed, e.g., to shorten MCMC niter, burnin prop, tighten IV selection, or correct for winner's curse via z_thresh, account for sample overlap via rho_ov, or tune prior strength via c_gamma/c_theta.

Usage

parameter_control(
  niter = 20000,
  burnin_prop = 0.5,
  c_gamma = 0.5,
  c_theta = 0.8,
  kappa_gamma = 1,
  kappa_theta = 1,
  Kmin = 5,
  Kmax = 20,
  rho_ov = 0,
  z_thresh = NULL,
  trim = 0.1,
  hybrid = FALSE,
  kappa_hybrid = 5,
  global_mean_gamma = NULL,
  global_mean_theta = NULL,
  global_Sigma_gamma = NULL,
  global_Sigma_theta = NULL
)

Arguments

niter

Number of Gibbs iterations. Default 20000 is calibrated for stable posterior estimates;

burnin_prop

Burn-in proportion in [0, 1).

c_gamma

Prior weight per IV for sigma^2_gamma (a_gamma = 1 + c_gamma*K/2), Larger values make the inverse-gamma prior more concentrated around its mean. Default= 0.5;

c_theta

Prior weight per IV for sigma^2_theta (a_theta = 1 + c_theta*K/2), Larger values make the inverse-gamma prior more concentrated around its mean. Default = 0.8;

kappa_gamma

Tunning parameter for prior mean of sigma2_gamma;

kappa_theta

Tunning parameter for prior mean of sigma2_theta;

Kmin, Kmax

Lower and upper bound on K used when computing prior shape.

rho_ov

Sampling correlation between exposure and outcome due to sample overlap, in [-1, 1]. Default = 0;

z_thresh

Optional |Z_gamma| selection threshold used to pick QTLs (winner’s-curse fix). Example: for p=5e-8 two-sided, use qnorm(1 - 5e-8/2).

trim

Tail probability for winsor.

hybrid

Logical; if TRUE, blend local with a global: prior mean = eta*local + (1-eta)*global (eta = K/(K+kappa_hybrid));

kappa_hybrid

Pooling control; larger values shrink more toward the global.

global_mean_gamma, global_mean_theta

Global EB centers for hybrid mode.

global_Sigma_gamma

2x2 numeric matrix. Global empirical-Bayes mean of the SNP-effect covariance Sigma_gamma. Required when hybrid = TRUE for the "memo" model.

global_Sigma_theta

2x2 numeric matrix. Global empirical-Bayes mean of the pleiotropy covariance Sigma_theta. Required when hybrid = TRUE for the "semo" or "memo" model.

Value

A named list of parameters for more advanced setting.

Examples

# defaults
ctrl <- parameter_control()