| Title: | Bayesian multi-response Mendelian randomisation |
|---|---|
| Description: | This package performs two-sample summary-level data Bayesian multi-response Mendelian randomisation with the selection of important exposures shared or distinct across responses. Post-processing and selection of exposures based on an in-house FDR implementation are also provided. The graphical-model Markov chain Monte Carlo engine can be accelerated with a compiled Rcpp/RcppArmadillo implementation. |
| Authors: | Leonardo Bottolo [aut, cre] (ORCID: <https://orcid.org/0000-0002-6381-2327>), Verena Zuber [aut, ctb] (ORCID: <https://orcid.org/0000-0001-9827-1877>) |
| Maintainer: | Leonardo Bottolo <[email protected]> |
| License: | GPL-2 | file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-11-04 22:21:19 UTC |
| Source: | https://github.com/lb664/MR2 |
Post-processing of MR2 Markov chain Monte Carlo output. Beta density finite mixture model of the marginal posterior inclusion probability (mPIP) or posterior edge inclusion probability (PEIP)
BMM_EM( PIP, K = 2, iter_max = 1000, tol = 1e-06, plotting = 0, printing = FALSE, digits = 3, cex_list = list(cex = 1, cex.axis = 1.375, cex.lab = 1.375) )BMM_EM( PIP, K = 2, iter_max = 1000, tol = 1e-06, plotting = 0, printing = FALSE, digits = 3, cex_list = list(cex = 1, cex.axis = 1.375, cex.lab = 1.375) )
PIP |
The mPIP or PEIP returned by
|
K |
Number of components. Default value set at |
iter_max |
Maximum number of iterations of the EM algorithm. Default value set at |
tol |
Stopping criterion tolerance of the EM algorithm. Default value set at |
plotting |
|
printing |
Print parameter values at each iteration of the EM algorithm. Default value set at |
digits |
Integer indicating the number of decimal places |
cex_list |
List of plotting options used |
For details regarding the Beta density finite mixture model, see Broët et al. (2004). For details regarding its use to classify the mPIP and PEIP in MR2, see Zuber et al. (2023)
The value returned is a list object list(PIP, w, a, b, p, Llik, aStore, bStore, pStore, LlikStore, stopcode, opt)
PIPOrdered vector of the mPIP or PEIP
wMatrix of allocation probabilities
aVector of estimated first parameters of the beta components
bVector of estimated second parameters of the beta components
pVector of estimated mixing proportions of the beta components
LlikFinal log-likelihood estimated by the EM algorithm
aStoreStored vectors of the estimated first parameters of the beta components for each iteration
bStoreStored vectors of the estimated second parameters of the beta components for each iteration
pStoreStored vectors of estimated mixing probabilities for each iteration
LlikStoreStored values of the log-likelihood for each iteration
stopcodeMessage describing how the EM algorithm terminated
opt List of options used list(iter_max, tol, plotting, printing)
Broët P, Lewin A, Richardson S, Dalmasso C, Magdelenat H (2004).
“A mixture model-based strategy for selecting sets of genes in multiclass response microarray experiments.”
Bioinformatics, 20(16), 2562–2571.
doi:10.1093/bioinformatics/bth285.
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023).
“Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.”
Am. J. Hum. Genet., 110(7), 1177–1199.
doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example 1: Analysis of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs. The number of # expected exposures directly associated with each response is set at 2 and its variance at 2, # with a priori range of direct association ranging between 0 and 8 Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) betaHat_Y <- Sim_Confounding$betaHat_Y betaHat_X <- Sim_Confounding$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(2, 2), niter = 7500, burnin = 2500, thin = 5, monitor = 1000, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) # Example 2: Analysis of one replication of simulated Scenario IV-Directed pleiotropy with q = # 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect of # the shared pleiotropic pathway on the responses set as \code{2}. The number of expected # exposures directly associated with each response is set at 1 and its variance at 2, # with a priori range of direct associations ranging between 0 and 7. A non- # decomposable graph for the inverse of the residual correlation between responses is selected Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, seed = 280610971) betaHat_Y <- Sim_Pleiotropy$betaHat_Y betaHat_X <- Sim_Pleiotropy$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(1, 3), niter = 15000, burnin = 5000, thin = 10, monitor = 1000, nonDecomp = TRUE, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) ## End(Not run)## Not run: # Example 1: Analysis of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs. The number of # expected exposures directly associated with each response is set at 2 and its variance at 2, # with a priori range of direct association ranging between 0 and 8 Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) betaHat_Y <- Sim_Confounding$betaHat_Y betaHat_X <- Sim_Confounding$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(2, 2), niter = 7500, burnin = 2500, thin = 5, monitor = 1000, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) # Example 2: Analysis of one replication of simulated Scenario IV-Directed pleiotropy with q = # 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect of # the shared pleiotropic pathway on the responses set as \code{2}. The number of expected # exposures directly associated with each response is set at 1 and its variance at 2, # with a priori range of direct associations ranging between 0 and 7. A non- # decomposable graph for the inverse of the residual correlation between responses is selected Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, seed = 280610971) betaHat_Y <- Sim_Pleiotropy$betaHat_Y betaHat_X <- Sim_Pleiotropy$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(1, 3), niter = 15000, burnin = 5000, thin = 10, monitor = 1000, nonDecomp = TRUE, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) ## End(Not run)
Post-processing of MR2 Markov chain Monte Carlo output. Estimation of the cutoff of the marginal posterior inclusion probability (mPIP) or posterior edge inclusion probability (PEIP) for a given nominal False Discovery Rate level
FDR_BMM(PIP, w, FDR_nominal = 0.05, plotting = FALSE)FDR_BMM(PIP, w, FDR_nominal = 0.05, plotting = FALSE)
PIP |
Ordered mPIP or PEIP returned by
|
w |
Matrix of allocation probabilities returned by |
FDR_nominal |
Nominal level of False Discovery Rate to be controlled. Default value set at |
plotting |
Logical; whether to plot the estimated FDR curve. Default |
For details regarding the False Discovery Rate control based on the Beta densities finite mixture model, see Broët et al. (2004) and Zuber et al. (2023)
The value returned is a list object list(cutoff, cutoff_idx, FDR_est, FNR_est, opt)
cutoffCutoff of the mPIP or PEIP for a given nominal FDR level
cutoff_idxIndex of the ordered mPIP or PEIP that corresponds to the estimated cutoff
FDR_estEstimated False Discovery Rate
FNR_estEstimated False Negative Rate
opt List of options used list(FDR_nominal, plotting)
Broët P, Lewin A, Richardson S, Dalmasso C, Magdelenat H (2004).
“A mixture model-based strategy for selecting sets of genes in multiclass response microarray experiments.”
Bioinformatics, 20(16), 2562–2571.
doi:10.1093/bioinformatics/bth285.
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023).
“Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.”
Am. J. Hum. Genet., 110(7), 1177–1199.
doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example 1: Analysis of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs. The number of # expected exposures directly associated with each response is set at 2 and its variance at 2, # with a priori range of direct association ranging between 0 and 8 Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) betaHat_Y <- Sim_Confounding$betaHat_Y betaHat_X <- Sim_Confounding$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(2, 2), niter = 7500, burnin = 2500, thin = 5, monitor = 1000, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) FDR_BMM_output <- FDR_BMM(BMM_EM_output$PIP, BMM_EM_output$w) PostProc_output$thetaPost * (PostProc_output$gammaPost > FDR_BMM_output$cutoff) * 1 # Example 2: Analysis of one replication of simulated Scenario IV-Directed pleiotropy with q = # 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect of # the shared pleiotropic pathway on the responses set as \code{2}. The number of expected # exposures directly associated with each response is set at 1 and its variance at 2, # with a priori range of direct associations ranging between 0 and 7. A non-decomposable # graph for the inverse of the residual correlation between responses is selected Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, seed = 280610971) betaHat_Y <- Sim_Pleiotropy$betaHat_Y betaHat_X <- Sim_Pleiotropy$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(1, 3), niter = 15000, burnin = 5000, thin = 10, monitor = 1000, nonDecomp = TRUE, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) FDR_BMM_output <- FDR_BMM(BMM_EM_output$PIP, BMM_EM_output$w) PostProc_output$thetaPost * (PostProc_output$gammaPost > FDR_BMM_output$cutoff) * 1 ## End(Not run)## Not run: # Example 1: Analysis of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs. The number of # expected exposures directly associated with each response is set at 2 and its variance at 2, # with a priori range of direct association ranging between 0 and 8 Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) betaHat_Y <- Sim_Confounding$betaHat_Y betaHat_X <- Sim_Confounding$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(2, 2), niter = 7500, burnin = 2500, thin = 5, monitor = 1000, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) FDR_BMM_output <- FDR_BMM(BMM_EM_output$PIP, BMM_EM_output$w) PostProc_output$thetaPost * (PostProc_output$gammaPost > FDR_BMM_output$cutoff) * 1 # Example 2: Analysis of one replication of simulated Scenario IV-Directed pleiotropy with q = # 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect of # the shared pleiotropic pathway on the responses set as \code{2}. The number of expected # exposures directly associated with each response is set at 1 and its variance at 2, # with a priori range of direct associations ranging between 0 and 7. A non-decomposable # graph for the inverse of the residual correlation between responses is selected Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, seed = 280610971) betaHat_Y <- Sim_Pleiotropy$betaHat_Y betaHat_X <- Sim_Pleiotropy$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(1, 3), niter = 15000, burnin = 5000, thin = 10, monitor = 1000, nonDecomp = TRUE, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) BMM_EM_output <- BMM_EM(PostProc_output$gammaPost) FDR_BMM_output <- FDR_BMM(BMM_EM_output$PIP, BMM_EM_output$w) PostProc_output$thetaPost * (PostProc_output$gammaPost > FDR_BMM_output$cutoff) * 1 ## End(Not run)
Markov chain Monte Carlo implementation of Bayesian Multi-response Mendelian randomisation model for two-sample summary-level data
MR2( betaHat_Y, betaHat_X, EVgamma = c(2, 2), tau = NULL, tauPar = c(alpha = 2, g = 0.2, h = 10), niter, burnin, thin, monitor, nonDecomp = FALSE, alpha = 0.05, probAddDel = 0.9, probAdd = 0.5, probMix = 0.25, geomMean = EVgamma[1], graphParNiter = NULL, seed = 31122021 )MR2( betaHat_Y, betaHat_X, EVgamma = c(2, 2), tau = NULL, tauPar = c(alpha = 2, g = 0.2, h = 10), niter, burnin, thin, monitor, nonDecomp = FALSE, alpha = 0.05, probAddDel = 0.9, probAdd = 0.5, probMix = 0.25, geomMean = EVgamma[1], graphParNiter = NULL, seed = 31122021 )
betaHat_Y |
(number of IVs) times (number of responses) matrix of summary-level responses |
betaHat_X |
(number of IVs) times (number of exposures) matrix of summary-level exposures |
EVgamma |
A priori number of expected exposures directly associated with each response and its variance |
tau |
Prior variance of the direct effects theta. Default |
tauPar |
Hyperparameters |
niter |
Number of Markov chain Monte Carlo iterations (including burn-in) |
burnin |
Number of Markov chain Monte Carlo iterations to be discarded as burn-in |
thin |
Store the Markov chain Monte Carlo output at every thin-th iteration |
monitor |
Refresh the console progress bar every monitored-th iteration |
nonDecomp |
Logical, |
alpha |
Level of significance ( |
probAddDel |
Probability ( |
probAdd |
Probability ( |
probMix |
Probability ( |
geomMean |
Mean of the geometric proposal distribution. Default is |
graphParNiter |
Number of MCMC internal iterations for the graphical model. Default |
seed |
Seed used to initialise the Markov chain Monte Carlo algorithm |
Alexopoulos and Bottolo (2021)
A list list(theta, G, R, D, postMean, timeMR2, hyperPar, samplerPar, opt); see package documentation for details
of each element
Alexopoulos A, Bottolo L (2021). “Bayesian Variable Selection for Gaussian copula regression models.” J. Comput. Graph. Stat., 30(3), 578–593. doi:10.1080/10618600.2020.1840997.
Post-processing of MR2 Markov chain Monte Carlo output
PostProc(output, betaHat_Y, betaHat_X, alpha = 0.05, digits = 3)PostProc(output, betaHat_Y, betaHat_X, alpha = 0.05, digits = 3)
output |
Object returned by |
betaHat_Y |
(number of IVs) times (number of responses) matrix of summary-level responses |
betaHat_X |
(number of IVs) times (number of exposures) matrix of summary-level exposures |
alpha |
Area of the tails of a symmetric credible interval ( |
digits |
Integer indicating the number of decimal places |
For details regarding the post-processing of the Markov chain Monte Carlo output, see Zuber et al. (2023)
The value returned is a list object
list(gammaPost, thetaPost, thetaPost_CI, DPost, GPost, SigmaPost, SigmaPost_CI,
RPost, RPost_CI, Rm1Post, Rm1Post_CI, decomposability_freq, CPO, scaleCPO,
freq_outliers, PLML, stability_PLML, DIC, timePostProc, opt)
gammaPostMarginal posterior inclusion probability (mPIP)
thetaPostPosterior mean of the direct effects
thetaPost_CICredible interval of the direct effects
DPostPosterior mean of the standard deviations of each response
GPostPosterior edge inclusion probability (PEIP)
SigmaPostPosterior mean of the variance-covariance matrix between the responses after conditioning on the direct effects
SigmaPost_CI (1 - ) credible interval of the variance-covariance matrix
RPostPosterior mean of the correlation matrix between the responses
RPost_CI (1 - ) credible interval of the correlation matrix
Rm1PostPosterior mean of the partial correlation matrix between the responses
Rm1Post_CI (1 - ) credible interval of the partial correlation matrix
decomposability_freqFrequency of visited decomposable models during the Markov chain Monte Carlo
CPOConditional predictive ordinate for each instrumental variable
scaleCPOScaled conditional predictive ordinate for each instrumental variable
PLMLPseudo log-marginal likelihood
freq_outliersFrequency of outlier or high-leverage instrumental variables (scaleCPO < 0.01)
stability_PLMLStability of the pseudo log-marginal likelihood
DICDeviance Information Criterion
timePostProc Time in minutes employed by PostProc
opt List of options used list(alpha, digits)
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023). “Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.” Am. J. Hum. Genet., 110(7), 1177–1199. doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example 1: Analysis of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs. The number of # expected exposures directly associated with each response is set at 2 and its variance at 2, # with a priori range of direct association ranging between 0 and 8 Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) betaHat_Y <- Sim_Confounding$betaHat_Y betaHat_X <- Sim_Confounding$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(2, 2), niter = 7500, burnin = 2500, thin = 5, monitor = 1000, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) # Example 2: Analysis of one replication of simulated Scenario IV-Directed pleiotropy with q = # 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect of # the shared pleiotropic pathway on the responses set as \code{2}. The number of expected # exposures directly associated with each response is set at 1 and its variance at 3, # with a priori range of direct associations ranging between 0 and 7. A non-decomposable # graph for the inverse of the residual correlation between responses is selected Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, seed = 280610971) betaHat_Y <- Sim_Pleiotropy$betaHat_Y betaHat_X <- Sim_Pleiotropy$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(1, 3), niter = 15000, burnin = 5000, thin = 10, monitor = 1000, nonDecomp = TRUE, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) ## End(Not run)## Not run: # Example 1: Analysis of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs. The number of # expected exposures directly associated with each response is set at 2 and its variance at 2, # with a priori range of direct association ranging between 0 and 8 Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) betaHat_Y <- Sim_Confounding$betaHat_Y betaHat_X <- Sim_Confounding$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(2, 2), niter = 7500, burnin = 2500, thin = 5, monitor = 1000, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) # Example 2: Analysis of one replication of simulated Scenario IV-Directed pleiotropy with q = # 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect of # the shared pleiotropic pathway on the responses set as \code{2}. The number of expected # exposures directly associated with each response is set at 1 and its variance at 3, # with a priori range of direct associations ranging between 0 and 7. A non-decomposable # graph for the inverse of the residual correlation between responses is selected Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, seed = 280610971) betaHat_Y <- Sim_Pleiotropy$betaHat_Y betaHat_X <- Sim_Pleiotropy$betaHat_X MR2_output <- MR2(betaHat_Y, betaHat_X, EVgamma = c(1, 3), niter = 15000, burnin = 5000, thin = 10, monitor = 1000, nonDecomp = TRUE, seed = 280610971) PostProc_output <- PostProc(MR2_output, betaHat_Y, betaHat_X) ## End(Not run)
Simulator to generate multiple responses and multiple exposures two-sample summary-level data with confounding effects
Scenario_Confounding( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, psi_Y = 1, psi_X = 2, seed = 31122021 )Scenario_Confounding( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, psi_Y = 1, psi_X = 2, seed = 31122021 )
nRep |
Number of simulated replicates |
q |
Number of simulated summary-level responses |
p |
Number of simulated summary-level exposures |
nIV |
Number of genetic variants used as instrumental variables |
nSubject |
Number of individuals in each sample of individual-level data |
MAF |
Minor allele frequency used in the simulation of the genotypes in each sample individual-level data. Default value sets
at |
thetaRange |
Sought range of the simulated direct effects. Default value sets at |
thetaSparsness |
Proportion of simulated direct associations between exposures and responses. Default value sets at |
herit_Y |
Heritability of the responses. Default value sets at |
betaHatRange_X |
Sought range of the simulated genetic effects on the exposures. Default value sets at |
herit_X |
Heritability of the exposures. Default value sets at |
rho_X |
Correlation between the exposures. Default value sets at |
psi_Y |
Impact of the confounder on the responses. Default value sets at |
psi_X |
Impact of the confounder on the exposures. Default value sets at |
seed |
Seed used to initialise the simulation |
For details regarding the simulated scenario, see details in Zuber et al. (2023)
The value returned is a list object list(betaHat_Y, betaHat_X, theta, parSim)
betaHat_Y3D array (IVs times responses times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each response
betaHat_X3D array (IVs times exposures times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each exposure
thetaMatrix (exposure-response pairs times replicates) of the simulated direct effects
parSim List of all parameters used in the simulation list(nRep, q, p, nIV, nSubject, MAF, thetaRange,
thetaSparsness, herit_Y, betaHatRange_X, herit_X, rho_X, psi_Y, psi_X, seed)
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023). “Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.” Am. J. Hum. Genet., 110(7), 1177–1199. doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example: Simulation of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) head(Sim_Confounding$theta) Sim_Confounding$parSim ## End(Not run)## Not run: # Example: Simulation of one replication of simulated Scenario II-Confounding with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs Sim_Confounding <- Scenario_Confounding(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) head(Sim_Confounding$theta) Sim_Confounding$parSim ## End(Not run)
Simulator to generate multiple responses and multiple exposures two-sample summary-level data with confounding and dependence between the responses not due to any unmeasured pleiotropic pathway
Scenario_Dependence( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, rho_Y = 0.6, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, psi_Y = 1, psi_X = 2, seed = 31122021 )Scenario_Dependence( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, rho_Y = 0.6, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, psi_Y = 1, psi_X = 2, seed = 31122021 )
nRep |
Number of simulated replicates |
q |
Number of simulated summary-level responses |
p |
Number of simulated summary-level exposures |
nIV |
Number of genetic variants used as instrumental variables |
nSubject |
Number of individuals in each sample of individual-level data |
MAF |
Minor allele frequency used in the simulation of the genotypes in each sample individual-level data. Default value sets
at |
thetaRange |
Sought range of the simulated direct effects. Default value sets at |
thetaSparsness |
Proportion of simulated direct associations between exposures and responses. Default value sets at |
herit_Y |
Heritability of the responses. Default value sets at |
rho_Y |
Correlation between the responses not due to any unmeasured pleiotropic pathway. Default value sets at |
betaHatRange_X |
Sought range of the simulated genetic effects on the exposures. Default value sets at |
herit_X |
Heritability of the exposures. Default value sets at |
rho_X |
Correlation between the exposures. Default value sets at |
psi_Y |
Impact of the confounder on the responses. Default value sets at |
psi_X |
Impact of the confounder on the exposures. Default value sets at |
seed |
Seed used to initialise the simulation |
For details regarding the simulated scenario, see details in Zuber et al. (2023)
The value returned is a list object list(betaHat_Y, betaHat_X, theta, parSim)
betaHat_Y3D array (IVs times responses times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each response
betaHat_X3D array (IVs times exposures times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each exposure
thetaMatrix (exposure-response pairs times replicates) of the simulated direct effects
parSim List of all parameters used in the simulation list(nRep, q, p, nIV, nSubject, MAF, thetaRange,
thetaSparsness, herit_Y, rho_Y, betaHatRange_X, herit_X, rho_X, psi_Y, psi_X, seed)
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023). “Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.” Am. J. Hum. Genet., 110(7), 1177–1199. doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example: Simulation of one replication of simulated Scenario V-Dependence with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs Sim_Dependence <- Scenario_Dependence(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) head(Sim_Dependence$theta) Sim_Dependence$parSim ## End(Not run)## Not run: # Example: Simulation of one replication of simulated Scenario V-Dependence with q = 5 # responses, p = 15 exposures and nIV = 100 genetic variants used as IVs Sim_Dependence <- Scenario_Dependence(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) head(Sim_Dependence$theta) Sim_Dependence$parSim ## End(Not run)
Simulator to generate multiple responses and multiple exposures two-sample summary-level data with confounding and pleiotropic effects as well as the effect of one response on another one
Scenario_Mediation( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, rho_Y = 0.6, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, undirected_A = TRUE, delta_A = 1, gamma_Y = 1, psi_Y = 1, psi_X = 2, seed = 31122021 )Scenario_Mediation( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, rho_Y = 0.6, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, undirected_A = TRUE, delta_A = 1, gamma_Y = 1, psi_Y = 1, psi_X = 2, seed = 31122021 )
nRep |
Number of simulated replicates |
q |
Number of simulated summary-level responses |
p |
Number of simulated summary-level exposures |
nIV |
Number of genetic variants used as instrumental variables |
nSubject |
Number of individuals in each sample of individual-level data |
MAF |
Minor allele frequency used in the simulation of the genotypes in each sample individual-level data. Default value sets
at |
thetaRange |
Sought range of the simulated direct effects. Default value sets at |
thetaSparsness |
Proportion of simulated direct associations between exposures and responses. Default value sets at |
herit_Y |
Heritability of the responses. Default value sets at |
rho_Y |
Correlation between the responses not due to any unmeasured pleiotropic pathway. Default value sets at |
betaHatRange_X |
Sought range of the simulated genetic effects on the exposures. Default value sets at |
herit_X |
Heritability of the exposures. Default value sets at |
rho_X |
Correlation between the exposures. Default value sets at |
undirected_A |
Logical parameter for simulating an undirected ( |
delta_A |
Effect of the shared pleiotropic pathway on the responses. Default value sets at |
gamma_Y |
Effect of one response on another one, both selected at random. Default value sets at |
psi_Y |
Impact of the confounder on the responses. Default value sets at |
psi_X |
Impact of the confounder on the exposures. Default value sets at |
seed |
Seed used to initialise the simulation |
For details regarding the simulated scenario, see details in Zuber et al. (2023)
The value returned is a list object list(betaHat_Y, betaHat_X, theta, mediation, parSim)
betaHat_Y3D array (IVs times responses times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each response
betaHat_X3D array (IVs times exposures times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each exposure
thetaMatrix (exposure-response pairs times replicates) of the simulated direct effects
mediationMatrix (mediator-mediated times replicates) of the selected responses to be the mediated response and the mediator
parSim List of all parameters used in the simulation list(nRep, q, p, nIV, nSubject, MAF, thetaRange,
thetaSparsness, herit_Y, rho_Y, betaHatRange_X, herit_X, rho_X, undirected_A, delta_A, gamma_Y, psi_Y, psi_X, seed)
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023). “Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.” Am. J. Hum. Genet., 110(7), 1177–1199. doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example 1: Simulation of one replication of simulated Scenario Undirected pleiotropy with # Mediation and with q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as # IVs Sim_Mediation <- Scenario_Mediation(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) Sim_Mediation$mediation head(Sim_Mediation$theta) Sim_Mediation$parSim # Example 2: Simulation of one replication of simulated Scenario Directed pleiotropy with # Mediation and with q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as # IVs and the effect of the shared pleiotropic pathway on the responses set as \code{2} Sim_Mediation <- Scenario_Mediation(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, delta_A = 2, seed = 280610971) Sim_Mediation$mediation head(Sim_Mediation$theta) Sim_Mediation$parSim ## End(Not run)## Not run: # Example 1: Simulation of one replication of simulated Scenario Undirected pleiotropy with # Mediation and with q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as # IVs Sim_Mediation <- Scenario_Mediation(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) Sim_Mediation$mediation head(Sim_Mediation$theta) Sim_Mediation$parSim # Example 2: Simulation of one replication of simulated Scenario Directed pleiotropy with # Mediation and with q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as # IVs and the effect of the shared pleiotropic pathway on the responses set as \code{2} Sim_Mediation <- Scenario_Mediation(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, delta_A = 2, seed = 280610971) Sim_Mediation$mediation head(Sim_Mediation$theta) Sim_Mediation$parSim ## End(Not run)
Simulator to generate multiple responses and multiple exposures two-sample summary-level data with confounding and pleiotropic effects
Scenario_Pleiotropy( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, undirected_A = TRUE, delta_A = 1, psi_Y = 1, psi_X = 2, seed = 31122021 )Scenario_Pleiotropy( nRep = 2, q = 5, p = 10, nIV = 100, nSubject = 50000, MAF = 0.05, thetaRange = c(-2, 2), thetaSparsness = 0.3, herit_Y = 0.25, betaHatRange_X = c(-2, 2), herit_X = 0.1, rho_X = 0.6, undirected_A = TRUE, delta_A = 1, psi_Y = 1, psi_X = 2, seed = 31122021 )
nRep |
Number of simulated replicates |
q |
Number of simulated summary-level responses |
p |
Number of simulated summary-level exposures |
nIV |
Number of genetic variants used as instrumental variables |
nSubject |
Number of individuals in each sample of individual-level data |
MAF |
Minor allele frequency used in the simulation of the genotypes in each sample individual-level data. Default value sets
at |
thetaRange |
Sought range of the simulated direct effects. Default value sets at |
thetaSparsness |
Proportion of simulated direct associations between exposures and responses. Default value sets at |
herit_Y |
Heritability of the responses. Default value sets at |
betaHatRange_X |
Sought range of the simulated genetic effects on the exposures. Default value sets at |
herit_X |
Heritability of the exposures. Default value sets at |
rho_X |
Correlation between the exposures. Default value sets at |
undirected_A |
Logical parameter for simulating an undirected ( |
delta_A |
Effect of the shared pleiotropic pathway on the responses. Default value sets at |
psi_Y |
Impact of the confounder on the responses. Default value sets at |
psi_X |
Impact of the confounder on the exposures. Default value sets at |
seed |
Seed used to initialise the simulation |
For details regarding the simulated scenario, see details in Zuber et al. (2023)
The value returned is a list object list(betaHat_Y, betaHat_X, theta, parSim)
betaHat_Y3D array (IVs times responses times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each response
betaHat_X3D array (IVs times exposures times replicates) of the simulated (summary-level) regression coefficients of the genetic effects on each exposure
thetaMatrix (exposure-response pairs times replicates) of the simulated direct effects
parSim List of all parameters used in the simulation list(nRep, q, p, nIV, nSubject, MAF, thetaRange,
thetaSparsness, herit_Y, betaHatRange_X, herit_X, rho_X, undirected_A, delta_A, psi_Y, psi_X, seed)
Zuber V, Lewin A, Levin MG, Haglund A, Ben-Aicha S, Emanueli C, Damrauer S, Burgess S, Gill D, Bottolo L (2023). “Multi-response Mendelian randomization: Identification of shared and distinct exposures for multimorbidity and multiple related disease outcomes.” Am. J. Hum. Genet., 110(7), 1177–1199. doi:10.1016/j.ajhg.2023.06.005.
## Not run: # Example 1: Simulation of one replication of simulated Scenario III-Undirected pleiotropy with # q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) head(Sim_Pleiotropy$theta) Sim_Pleiotropy$parSim # Example 2: Simulation of one replication of simulated Scenario IV-Directed pleiotropy with # q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect # of the shared pleiotropic pathway on the responses set as \code{2} Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, delta_A = 2, seed = 280610971) head(Sim_Pleiotropy$theta) Sim_Pleiotropy$parSim ## End(Not run)## Not run: # Example 1: Simulation of one replication of simulated Scenario III-Undirected pleiotropy with # q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, seed = 280610971) head(Sim_Pleiotropy$theta) Sim_Pleiotropy$parSim # Example 2: Simulation of one replication of simulated Scenario IV-Directed pleiotropy with # q = 5 responses, p = 15 exposures and nIV = 100 genetic variants used as IVs and the effect # of the shared pleiotropic pathway on the responses set as \code{2} Sim_Pleiotropy <- Scenario_Pleiotropy(nRep = 1, q = 5, p = 15, nIV = 100, undirected_A = FALSE, delta_A = 2, seed = 280610971) head(Sim_Pleiotropy$theta) Sim_Pleiotropy$parSim ## End(Not run)