Package 'gsmr'

Title: gsmr - a tool for SMR and HEIDI analysis
Description: A tool perform Generalized Summary-data-based Mendelian Randomization analysis (GSMR) and HEterogeneity In Dependent Instruments analysis to remove pleiotropic outliers (HEIDI-outlier)
Authors: Zhihong Zhu, Zhili Zheng, Futao Zhang, Jian Yang
Maintainer: Zhihong Zhu <[email protected]>
License: GPL (>= 2.0)
Version: 1.0.6
Built: 2024-09-09 05:11:39 UTC
Source: https://github.com/jianyanglab/gsmr

Help Index


gsmr: A tool for GSMR and HEIDI analysis

Description

Perform Generalized Summary-data-based Mendelian Randomization analysis (GSMR) and HEterogeneity In Dependent Instruments analysis to remove pleiotropic outliers (HEIDI-outlier).

Author(s)

Zhihong Zhu <[email protected]>

Zhili Zheng <[email protected]>

Futao Zhang <[email protected]>

Jian Yang <[email protected]>

References

Zhu, Z. et al. Causal associations between risk factors and common diseases inferred from GWAS summary data. Nature Communications, in press. An early verison of the manuscript is available at bioRxiv, 168674.


Bi-directional GSMR analysis

Description

Bi-directional GSMR analysis is composed of a forward-GSMR analysis and a reverse-GSMR analysis that uses SNPs associated with the disease (e.g. at < 5e-8) as the instruments to test for putative causal effect of the disease on the risk factor.

Usage

bi_gsmr(bzx, bzx_se, bzx_pval, bzy, bzy_se, bzy_pval, ldrho, snpid, heidi_outlier_flag=T, gwas_thresh=5e-8, heidi_outlier_thresh=0.01, nsnps_thresh=10)

Arguments

bzx

vector, SNP effects on risk factor

bzx_se

vector, standard errors of bzx

bzx_pval

vector, p values for bzx

bzy

vector, SNP effects on disease

bzy_se

vector, standard errors of bzy

bzy_pval

vector, p values for bzy

ldrho

LD correlation matrix of the SNPs

snpid

genetic instruments

n_ref

sample size of the reference sample

heidi_outlier_flag

flag for HEIDI-outlier analysis

gwas_thresh

threshold p-value to select instruments from GWAS for risk factor

heidi_outlier_thresh

HEIDI-outlier threshold

nsnps_thresh

the minimum number of instruments required for the GSMR analysis (we do not recommend users to set this number smaller than 10)

ld_r2_thresh

LD r2 threshold to remove SNPs in high LD

ld_fdr_thresh

FDR threshold to remove the chance correlations between SNP instruments

Value

Estimate of causative effect of risk factor on disease (forward_bxy), the corresponding standard error (forward_bxy_se), p-value (forward_bxy_pval) and SNP index (forward_index), and estimate of causative effect of disease on risk factor (reverse_bxy), the corresponding standard error (reverse_bxy_se), p-value (reverse_bxy_pval), SNP index (reverse_index), SNPs with missing values, with non-significant p-values and those in LD.

Examples

data("gsmr")
gsmr_result = bi_gsmr(gsmr_data$bzx, gsmr_data$bzx_se, gsmr_data$bzx_pval, gsmr_data$bzy, gsmr_data$bzy_se, gsmr_data$bzy_pval, ldrho, gsmr_data$SNP, n_ref, T, 5e-8, 0.01, 10, 0.1, 0.05)

Generalized Summary-data-based Mendelian Randomization analysis

Description

GSMR (Generalised Summary-data-based Mendelian Randomisation) is a flexible and powerful approach that utilises multiple genetic instruments to test for causal association between a risk factor and disease using summary-level data from independent genome-wide association studies.

Usage

gsmr(bzx, bzx_se, bzx_pval, bzy, bzy_se, ldrho, snpid, heidi_outlier_flag=T, gwas_thresh=5e-8, heidi_outlier_thresh=0.01, nsnps_thresh=10)

Arguments

bzx

vector, SNP effects on risk factor

bzx_se

vector, standard errors of bzx

bzx_pval

vector, p values for bzx

bzy

vector, SNP effects on disease

bzy_se

vector, standard errors of bzy

ldrho

LD correlation matrix of the SNPs

snpid

genetic instruments

n_ref

sample size of the reference sample

heidi_outlier_flag

flag for HEIDI-outlier analysis

gwas_thresh

threshold p-value to select instruments from GWAS for risk factor

heidi_outlier_thresh

HEIDI-outlier threshold

nsnps_thresh

the minimum number of instruments required for the GSMR analysis (we do not recommend users to set this number smaller than 10)

ld_r2_thresh

LD r2 threshold to remove SNPs in high LD

ld_fdr_thresh

FDR threshold to remove the chance correlations between SNP instruments

Value

Estimate of causative effect of risk factor on disease (bxy), the corresponding standard error (bxy_se), p-value (bxy_pval), SNP index (used_index), SNPs with missing values, with non-significant p-values and those in LD.

Examples

data("gsmr")
gsmr_result = gsmr(gsmr_data$bzx, gsmr_data$bzx_se, gsmr_data$bzx_pval, gsmr_data$bzy, gsmr_data$bzy_se, ldrho, gsmr_data$SNP, n_ref, T, 5e-8, 0.01, 10, 0.1, 0.05)

HEIDI-outlier analysis

Description

An analysis to detect and eliminate from the analysis instruments that show significant pleiotropic effects on both risk factor and disease

Usage

heidi_outlier(bzx, bzx_se, bzx_pval, bzy, bzy_se, ldrho, snpid, n_ref, gwas_thresh=5e-8, heidi_outlier_thresh=0.01, nsnps_thresh=10, ld_fdr_thresh=0.05)

Arguments

bzx

vector, SNP effects on risk factor

bzx_se

vector, standard errors of bzx

bzx_pval

vector, p values for bzx

bzy

vector, SNP effects on disease

bzy_se

vector, standard errors of bzy

ldrho

LD correlation matrix of the SNPs

snpid

genetic instruments

n_ref

sample size of the reference sample

gwas_thresh

threshold p-value to select instruments from GWAS for risk factor

heidi_outlier_thresh

threshold p-value to remove pleiotropic outliers (the default value is 0.01)

nsnps_thresh

the minimum number of instruments required for the GSMR analysis (we do not recommend users to set this number smaller than 10)

ld_r2_thresh

LD r2 threshold to remove SNPs in high LD

ld_fdr_thresh

FDR threshold to remove the chance correlations between SNP instruments

Value

Retained index of genetic instruments, SNPs with missing values, with non-significant p-values and those in LD.

Examples

data("gsmr")
filtered_index = heidi_outlier(gsmr_data$bzx, gsmr_data$bzx_se, gsmr_data$bzx_pval, gsmr_data$bzy, gsmr_data$bzy_se, ldrho, gsmr_data$SNP, n_ref, 5e-8, 0.01, 10, 0.1, 0.05)

Standardization of effect size and its standard error

Description

Standardization of SNP effect and its standard error using z-statistic, allele frequency and sample size

Usage

std_effect(snp_freq, b, se, n)

Arguments

snp_freq

vector, allele frequencies

b

vector, SNP effects on risk factor

se

vector, standard errors of b

n

vector, per-SNP sample sizes for GWAS of the risk factor

Value

Standardised effect (b) and standard error (se)

Examples

data("gsmr")
std_effects = std_effect(gsmr_data$a1_freq, gsmr_data$bzx, gsmr_data$bzx_se, gsmr_data$bzx_n)