Package 'MVMRcMLSuSiE'

Title: Implementation of MVMR-cML-SuSiE
Description: Implements the first three steps of constrained Maximum Likelihood (cML) based Mendelian randomization approach for highly correlated exposures
Authors: Lap Sum Chan
Maintainer: Lap Sum Chan <[email protected]>
License: GPL (>= 3)
Version: 0.1.0
Built: 2026-05-14 05:54:28 UTC
Source: https://github.com/lapsumchan/MVMR-cML-SuSiE

Help Index


Step 1 of MVMR-cML-SuSiE

Description

This function performs the first step of the MVMR-cML-SuSiE approach to obtain each exposure's univariable Mendelian randomization (UVMR) p-value, used for initial filtering of exposures. You can choose to pull GWAS data using OpenGWAS (by setting use.openGWAS = TRUE) or provide your own summary statistics (by setting use.openGWAS = FALSE)

Usage

mvmr.cml.susie.step1(
  exposure.ids = NULL,
  outcome.id = NULL,
  sample.sizes,
  beta.exposure.ls = NULL,
  se.exposure.ls = NULL,
  beta.outcome.ls = NULL,
  se.outcome.ls = NULL,
  use.openGWAS = TRUE
)

Arguments

exposure.ids

A length LL character vector of openGWAS IDs corresponding to the exposures, where LL is the number of intended exposures

outcome.id

A character corresponding to the outcome openGWAS ID

sample.sizes

A numeric vector of sample sizes corresponding to each exposure and outcome If use.openGWAS = TRUE, the length should be LL (exposures only). Otherwise, the length should be L+1L + 1, with the last element for the outcome sample size

beta.exposure.ls

A list (length LL) of numeric vectors with effect sizes (betas) for each SNP on exposure

se.exposure.ls

A list (length LL) of numeric vectors with standard errors for each SNP on exposure

beta.outcome.ls

A list (length LL) of numeric vectors with effect sizes (betas) for each SNP on outcome

se.outcome.ls

A list (length LL) of numeric vectors with standard errors for each SNP on outcome

use.openGWAS

A logical indicating whether to use OpenGWAS to extract GWAS data based on exposure.ids and outcome.id. If FALSE, requires user-provided summary statistics (lists for beta.exposure.ls, se.exposure.ls, beta.outcome.ls, and se.outcome.ls) Default is TRUE

Value

A numeric vector (length LL) of p-values, each corresponding to the UVMR p-value for one exposure


Step 2 of MVMR-cML-SuSiE

Description

This function performs the second step of the MVMR-cML-SuSiE approach. After identifying exposures of interest in Step 1 (e.g., by filtering UVMR p-values), step 2 extracts the relevant instruments for those exposures, identifies invalid instruments (if any), and obtains an initial estimate from univariable Mendelian randomization (UVMR) for each exposure

Usage

mvmr.cml.susie.step2(
  exposure.ids.subset = NULL,
  outcome.id = NULL,
  sample.sizes.subset,
  beta.exposure.mat = NULL,
  se.exposure.mat = NULL,
  beta.outcome.vec = NULL,
  se.outcome.vec = NULL,
  pval.exposure.mat = NULL,
  use.openGWAS = TRUE,
  cutoff = 5e-08
)

Arguments

exposure.ids.subset

A length LL^{*} character vector of exposure IDs (a subset from step 1)

outcome.id

A character specifying the outcome ID

sample.sizes.subset

A length LL^{*} numeric vector of sample sizes corresponding to exposure.ids.subset (and optionally the outcome as the last element if user-provided data)

beta.exposure.mat

A size m×Lm^{*} \times L^{*} matrix of exposure effect sizes, where mm^{*} is the number of SNPs

se.exposure.mat

A size m×Lm^{*} \times L^{*} matrix of exposure standard errors

beta.outcome.vec

A length mm^{*} numeric vector of outcome effect sizes for the same SNPs

se.outcome.vec

A length mm^{*} numeric vector of standard errors for beta.outcome.vec

pval.exposure.mat

A m×Lm^{*} \times L^{*} matrix of exposure p-values

use.openGWAS

A logical indicating whether to extract data via OpenGWAS. If FALSE, you must supply the *.mat and *.vec arguments. Default is TRUE

cutoff

A numeric threshold for instrument selection. Default is 5×1085 \times 10^{-8}

Value

A list containing:

mvdat

A list containing the relevant data (exposure/outcome betas, SEs, etc)

invalid.idx

A vector of indices of invalid instruments identified based off the UVMR procedure

theta.vec

A numeric vector of initial values for each exposure


Step 3 of MVMR-cML-SuSiE (Iterative SuSiE)

Description

This function performs the iterative SuSiE algorithm to identify potential exposure signal clusters

Usage

mvmr.cml.susie.step3(
  mvdat,
  invalid.idx,
  theta.vec,
  rho.mat,
  S = 10,
  max.iter = 200,
  tol = 1e-10
)

Arguments

mvdat

A list returned by mvmr.cml.susie.step2, containing exposure and outcome summary statistics

invalid.idx

An integer vector of invalid IV indices as identified in step 2

theta.vec

A numeric vector of initial exposure effect estimates from step 2

rho.mat

A genetic correlation matrix of size (L+1)×(L+1)(L^{*} + 1) \times (L^{*} + 1), where LL^{*} is the number of exposures. The last row/column corresponds to the outcome

S

The number of single effects (signal clusters) in SuSiE. Default is 10.

max.iter

The maximum number of iterations for SuSiE. Default is 200.

tol

A numeric value indicating the convergence threshold for the iterative procedure. Default is 1×10101 \times 10^{-10}.

Value

A fitted susie object. The key SuSiE output is the posterior inclusion probability (PIP) matrix alpha used for determining signal clusters