| Title: | Bayesian Mendelian Randomization with Potentially Pleiotropic Instruments |
|---|---|
| Description: | Bayesian Mendelian randomization using GWAS summary statistics that jointly estimates the causal effect of an exposure on an outcome and the direct pleiotropic effects of genetic instruments, using variational inference. |
| Authors: | Ou Ren [aut, cre] |
| Maintainer: | Ou Ren <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-10-20 09:46:43 UTC |
| Source: | https://github.com/OuRen0104/CaPri |
Extract coefficients from a CaPri fit
## S3 method for class 'capri' coef(object, ...)## S3 method for class 'capri' coef(object, ...)
object |
An object of class |
... |
Additional arguments. |
A named numeric vector.
Fits the CaPri Mendelian randomization model using SNP-level summary statistics. This summary-statistics version assumes independent variants, corresponding to an identity LD matrix by default.
fit_capri_sumstats( muY, betaX, n, allele_mode = c("as_is", "minor"), eaf = NULL, pi_delta = 0.01, pi_c = 0.5, tau_gamma = 1, tau_beta = 0, sigma_Y = 1, max_iter = 2000, eps_theta = 1e-06, patience = 5, verbose = 1 )fit_capri_sumstats( muY, betaX, n, allele_mode = c("as_is", "minor"), eaf = NULL, pi_delta = 0.01, pi_c = 0.5, tau_gamma = 1, tau_beta = 0, sigma_Y = 1, max_iter = 2000, eps_theta = 1e-06, patience = 5, verbose = 1 )
muY |
Numeric vector of SNP-outcome summary association estimates. |
betaX |
Numeric vector of SNP-exposure summary association estimates. |
n |
Sample size used for the summary statistics. |
allele_mode |
Character string specifying allele orientation. If "as_is", summary statistics are used without modification. If "minor", SNP effects are flipped so that effects correspond to the minor allele direction. |
eaf |
Numeric vector of effect allele frequencies. Required when
|
pi_delta |
Prior probability of a causal effect. |
pi_c |
Prior probability that an instrument is pleiotropic. |
tau_gamma |
Prior precision for the causal effect. |
tau_beta |
Prior precision for the pleiotropic effect. |
sigma_Y |
Residual standard deviation of the outcome model. |
max_iter |
Maximum number of variational inference iterations. |
eps_theta |
Parameter convergence threshold. |
patience |
Number of consecutive stable iterations required for convergence. |
verbose |
Whether to print progress during variational inference. |
An object of class capri.
Plot a CaPri fit
## S3 method for class 'capri' plot(x, ...)## S3 method for class 'capri' plot(x, ...)
x |
An object of class |
... |
Additional arguments passed to |
Invisibly returns x.
Print a CaPri fit
## S3 method for class 'capri' print(x, ...)## S3 method for class 'capri' print(x, ...)
x |
An object of class |
... |
Additional arguments. |
Invisibly returns x.
Summarize a CaPri fit
## S3 method for class 'capri' summary(object, ...)## S3 method for class 'capri' summary(object, ...)
object |
An object of class |
... |
Additional arguments. |
Invisibly returns object.