Skip to contents

Performs MR using fine-mapping credible sets. For each exposure gene, computes PIP-weighted composite Wald ratio estimates within each credible set, then meta-analyzes across credible sets with inverse-variance weighting. Reports Cochran's Q and I-squared heterogeneity statistics.

Usage

fine_mr(formatted_input, cpip_cutoff = 0.5)

Arguments

formatted_input

A data.frame/tibble with columns: X_ID (gene ID), cs (credible set index), pip (posterior inclusion probability), bhat_x (exposure effect), sbhat_x (exposure SE), bhat_y (outcome effect), sbhat_y (outcome SE), snp (variant ID).

cpip_cutoff

Minimum cumulative PIP to retain a credible set (default 0.5).

Value

A tibble with columns: X_ID, num_CS, num_IV, cpip, composite_bhat, composite_sbhat, meta_eff, se_meta_eff, Q, I2.