Skip to content

Commit

Permalink
Merge pull request #567 from remlapmot/better-fix-for-vignette
Browse files Browse the repository at this point in the history
Better fix for perform_mr vignette
  • Loading branch information
remlapmot authored Sep 26, 2024
2 parents 10669d7 + 1499a72 commit 5ed1951
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions vignettes/perform_mr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ vignette: >
---

```{r, include=FALSE}
evalinr44 <- getRversion() >= '4.4.0'
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
Expand Down Expand Up @@ -612,7 +613,7 @@ The current plots being generated are not necessarily adequate because while the

### Using your own summary data

If you want to perform analysis with your local summary data (i.e. not in the OpenGWAS database) then use then look up the `mv_extract_exposures_local()` function in replace of the `mv_extract_exposures()` function.
If you want to perform analysis with your local summary data (i.e. not in the OpenGWAS database) then use then look up the `mv_extract_exposures_local()` function instead of the `mv_extract_exposures()` function.

* * *

Expand All @@ -633,7 +634,7 @@ ld_mat

Here `ld_matrix()` returns the LD correlation values (not R^2^) for each pair of variants present in the 1000 genomes data set.

```{r eval=FALSE}
```{r}
dat <- harmonise_data(
exposure_dat = bmi_exp_dat,
outcome_dat = chd_out_dat
Expand All @@ -642,19 +643,19 @@ dat <- harmonise_data(

Convert to the `MRInput` format for the MendelianRandomization package:

```{r eval=FALSE}
```{r eval=evalinr44}
dat2 <- dat_to_MRInput(dat)
```

This produces a list of `MRInput` objects that can be used with the MendelianRandomization functions, e.g.

```{r eval=FALSE}
```{r eval=evalinr44}
MendelianRandomization::mr_ivw(dat2[[1]])
```

Alternatively, convert to the `MRInput` format but also obtaining the LD matrix for the instruments

```{r eval=FALSE}
```{r eval=evalinr44}
dat2 <- dat_to_MRInput(dat, get_correlation = TRUE)
MendelianRandomization::mr_ivw(dat2[[1]], correl = TRUE)
```
Expand Down

0 comments on commit 5ed1951

Please sign in to comment.