Title: | Mendelian Randomization based on the core gene hypothesis for polygenic exposures |
---|---|
Description: | This package performs Mendelian Randomization (MR) analyses based on the core gene hypothesis for polygenic exposures. MR CORGE identifies a small number of putative core instruments that are more likely to affect genes with a direct biological role in an exposure and obtains causal effect estimates based on these instruments, thereby reducing the risk of horizontal pleiotropy. |
Authors: | Wenmin Zhang [aut, cre], Tianyuan Lu [aut] |
Maintainer: | Wenmin Zhang <[email protected]> |
License: | CC-BY-NC-ND 4.0 |
Version: | 0.1.0 |
Built: | 2025-02-19 06:16:46 UTC |
Source: | https://github.com/zhwm/MRCorge |
This function performs Mendelian Randomization (MR) analyses based on the core gene hypothesis for polygenic exposures. MR Corge identifies a small number of putative core instruments that are more likely to affect genes with a direct biological role in an exposure and obtains causal effect estimates based on these instruments, thereby reducing the risk of horizontal pleiotropy.
mrcorge( harmonized_data, rank = "beta", K = 5, method_list = c("mr_ivw", "mr_weighted_mode", "mr_weighted_median"), seed = 1 )
mrcorge( harmonized_data, rank = "beta", K = 5, method_list = c("mr_ivw", "mr_weighted_mode", "mr_weighted_median"), seed = 1 )
harmonized_data |
Data frame containing the harmonized data from the TwoSampleMR package. |
rank |
Character, method to rank instruments, one of 'beta' (absolute per-allele effect size), 'h2' (per-variant heritability), 'pval' (significance), or 'zscore' (sample size-normalized z-score). Default is 'beta'. |
K |
Integer, number of instrument groups. Default is 5. |
method_list |
Character vector, list of MR methods to apply. Default is c("mr_ivw", "mr_weighted_mode", "mr_weighted_median"). |
seed |
Integer, seed for random number generation. Default is 1. |
A list containing:
The main MR results.
All MR results including group-specific and cumulative estimates.
Data frame of instruments with their respective groups.
Q statistics for heterogeneity.
I2 statistics for heterogeneity.
P-values for heterogeneity tests.
# Example usage: library(MRCorge) data("HDL_CAD") res <- mrcorge(HDL_CAD, rank='beta', K=20, method_list = c("mr_ivw"))
# Example usage: library(MRCorge) data("HDL_CAD") res <- mrcorge(HDL_CAD, rank='beta', K=20, method_list = c("mr_ivw"))
This function plots the results of MR CORGE.
plot_mrcorge(mrcorge_result, scale = "linear")
plot_mrcorge(mrcorge_result, scale = "linear")
mrcorge_result |
List, result from the mrcorge function. |
scale |
Character, scale for the plot, either "linear" or "exp". Default is "linear". |
ggplot object, the plot of MR sensitivity analysis results.
# Example usage: library(MRCorge) data("HDL_CAD") res <- mrcorge(HDL_CAD, rank='beta', K=20, method_list = c("mr_ivw")) plot_mrcorge(res, scale='exp')
# Example usage: library(MRCorge) data("HDL_CAD") res <- mrcorge(HDL_CAD, rank='beta', K=20, method_list = c("mr_ivw")) plot_mrcorge(res, scale='exp')
This function calculates the Q statistic for heterogeneity in Mendelian Randomization analysis.
Qstatistic(b_group, se_group, b_overall)
Qstatistic(b_group, se_group, b_overall)
b_group |
Numeric vector, effect sizes for each group. |
se_group |
Numeric vector, standard errors for each group. |
b_overall |
Numeric, overall effect size. |
Numeric, Q statistic for heterogeneity.