# Medelian Randomization

### &#x20;Mendelian Randomization&#x20;

Mendelian randomisation is a technique that makes a causal inference about exposure on an outcome using only summary statistics from a GWAS. This means you obtain SNPs (the instruments) that are robustly associated with your exposure, obtain a set of GWAS summary associations for the outcome you are interested, extract the instrument SNPs from the outcome GWAS, and by contrasting the effect sizes of the SNPs on the exposure with the effect sizes of the SNPs on the outcome one can estimate the causal effect.<br>

### Workflow

The workflow for performing MR is as follows:

1. select instruments for the exposure (perform LD clumping if necessary);
2. extract the instruments from the MR Base GWAS database for the outcomes of interest;
3. harmonise the effect sizes for the instruments on the exposures and the outcomes to be each for the same reference allele;
4. perform MR analysis, sensitivity analyses, create plots, compile reports.

![](/files/-MDzGC1m6PmcN7N32pCW)

#### User Journey

A few simple steps are needed to run this pipeline:

1. select *2SMR pipeline* from Pipelines section;
2. **Choose Exposure**:

   &#x20;choose existing GWAS;

   &#x20;choose Phenotype and select corresponding columns;
3. **Choose Outcomes**:

   SNPs that were selected for the exposures will be extracted from the outcomes that you select here. \
   Please select the outcomes that you want to test for being causally influenced by the exposures.
4. user provides other parameters for the MR and the job name and finally runs the analysis;

then, you will be redirected to the results page.

![](/files/-MDyAV06occ_YhZyzk3p)

Let's take a look at the **parameters**:

**Exposure data parameters:**

1. **P-value threshold for keeping a SNP**: p-value threshold for keeping a SNP (0.05); *value to be inserted;*
2. **Whether or not to return independent SNPs only**: clumping parameter - Whether or not to return independent SNPs only; *default: true, switch on;*
3. **The maximum LD R-square allowed between returned SNPs**: the maximum LD R-square allowed between returned SNPs; *default input value: 0.01;*
4. **The distance in which to search for LD R-square values**: the distance in which to search for LD R-square values, with clumping window = 10000kb; *default input value: 10000.*

**Outcome data parameters:**

1. **Proxies**: parameters for handling proxies; *default: true, switch on;*
2. **Minimum rsq to find a proxy**: minimum rsq to find a proxy; *default input value: 0.8;*
3. **Allow palindromic SNPs?**: *default: yes, 1;*
4. **Maximum minor allele frequency of palindromes allowed**: **maf\_threshold** = If palindromes allowed then what is the maximum minor allele frequency of palindromes allowed?; *default input value: 0.3;*

![](/files/-MDyAinZ_3UveOdWGFT-)

**Harmonization parameter:**

1. **options to harmonising the data**:

   1. Assume all alleles are presented on the forward strand;
   2. Try to infer the forward strand alleles using allele frequency information;
   3. Correct the strand for non-palindromic SNPs, but drop all palindromic SNPs;

   by *default*, the harmonise\_data function uses *option 2* from the dropdown menu,  but this can be modified using the action argument, e.g. harmonise\_data(exposure\_dat, outcome\_dat, action=3).

**Mendelian Randomization Analysis:**

1. **Perform Mendelian Randomization**: *default: switch on;*
2. **Heterogeneity statistics**: *default: switch on;*
3. **Horizontal pleiotropy**: *default: switch on;*
4. **Single SNP analysis**: *default: switch on;*
5. **Leave One-out analysis**: *default: switch on.*

![](/files/-MDyApr_BZpFr8BJak9m)

### Results

Once you have chosen the pipeline to be used, uploaded the data file and set all the parameters, you can start your analysis using the *Run Analysis* box; at this point, you will be redirected to the *Dashboard*, where you can keep an eye on which works are *In Progress*, which are *Completed*, and choose to carry out a new analysis.&#x20;

![](/files/-ME3S3HQbJfzDdiKFdRV)

By clicking on your *JobName*, you will have access to a page where you can monitor all the processes involved in your analysis.

![](/files/-ME3Rj_M3uekxa18wcRx)

Now, selecting the *Results* box on the right, let's take a look at the demo results obtained using the Default Parameters Set:

**Scatter Plot**&#x20;

![](https://lh6.googleusercontent.com/r9kcB-udiHFn_PYc0SIkzqBo58M6rh3dMJfKgq8pHM_wYqQ3VB7bOzPE1gyfHS_cWLLDnXP1025orZkaGXjAPuxqSJXLDP8ahXW4Z4qrCM6IBhd-cfu9uqn9NxjOm02uBuQdjvBf)

Scatter plot depicting the SNP effects on the exposure against the SNP effects on the outcome.

**Forest plot** to compare the MR estimates using the different MR methods against the single SNP tests.

![](https://lh4.googleusercontent.com/Lz5nRkTAEorNtVyLnGb3_SsTo_63wsw0_yAW3ATPIYnAt0aUQfDrq916jEOkSYYPPYAB7qPIFvmtLuSxDkIl9zWYUo8nY_LVgnZcMfAhFIbwkBdcrLOtQ0I1yPrQMzJwToPriYa-)

The plot shows the causal effect as estimated using each of the SNPs on their own, and comparing against the causal effect as estimated using the methods that use all the SNPs.

**Leave One Out Graph**

![](/files/-ME8av0mwyTEJW8LfhjV)

Finally, using the *Export* box, you will be able to download the results of your analysis in a *.pdf* format file.

#### Reference

1. [**The MR-Base platform supports systematic causal inference across the human phenome. eLife 2018;7:e34408. doi: 10.7554/eLife.34408.**](https://elifesciences.org/articles/34408)
2. [**'Mendelian randomization': can genetic epidemiology contribute to understanding environmental determinants of disease? Int J Epidemiol. 2003 Feb;32(1):1-22**](http://www.ncbi.nlm.nih.gov/pubmed/12689998), Davey Smith G, Ebrahim S.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shivom.gitbook.io/documentation/pipelines/medelian-randomization.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
