Skip to content

Commit 49fd1cb

Browse files
authored
Merge pull request #524 from remlapmot/tsmr-0-6-4
TwoSampleMR 0.6.4
2 parents 0c96a35 + 6256e3a commit 49fd1cb

18 files changed

+44
-50
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: TwoSampleMR
22
Title: Two Sample MR Functions and Interface to MR Base Database
3-
Version: 0.6.3
3+
Version: 0.6.4
44
Authors@R: c(
55
person("Gibran", "Hemani", , "g.hemani@bristol.ac.uk", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-0920-1055")),

NEWS.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# TwoSampleMR v0.6.4
2+
3+
(Release date: 2024-06-05)
4+
5+
* Update installation instructions in README.md
6+
7+
* Fixed a bug in which the wrong indels recoding function was called (thanks @ruochiz)
8+
19
# TwoSampleMR v0.6.3
210

311
(Release date: 2024-05-23)

R/harmonise.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ harmonise_12 <- function(SNP, A1, B1, B2, betaA, betaB, fA, fB, tolerance, actio
457457
remove <- palindromic
458458

459459
indel_index <- nchar(B1) > 1 | nchar(B2) > 1 | B1 == "D" | B1 == "I"
460-
temp <- recode_indels_21(A1[indel_index], B1[indel_index], B2[indel_index])
460+
temp <- recode_indels_12(A1[indel_index], B1[indel_index], B2[indel_index])
461461

462462
A1[indel_index] <- temp$A1
463463
A2[indel_index] <- temp$A2
@@ -660,4 +660,3 @@ check_required_columns <- function(dat, type="exposure")
660660
}
661661
return(NULL)
662662
}
663-

README.md

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](h
1111
[![DOI](https://zenodo.org/badge/49515156.svg)](https://zenodo.org/badge/latestdoi/49515156)
1212
[![Codecov test
1313
coverage](https://codecov.io/gh/MRCIEU/TwoSampleMR/branch/master/graph/badge.svg)](https://app.codecov.io/gh/MRCIEU/TwoSampleMR?branch=master)
14+
[![TwoSampleMR status
15+
badge](https://mrcieu.r-universe.dev/badges/TwoSampleMR)](https://mrcieu.r-universe.dev/TwoSampleMR)
1416
<!-- badges: end -->
1517

1618
A package for performing Mendelian randomization using GWAS summary
@@ -28,26 +30,28 @@ reference panels.** For full details of the changes, please visit
2830

2931
## Installation
3032

31-
To install the latest version of TwoSampleMR, perform as normal:
33+
Users running Windows and macOS, to install the latest version of
34+
TwoSampleMR please install from our MRC IEU r-universe
3235

3336
``` r
34-
install.packages("remotes")
35-
remotes::install_github("MRCIEU/TwoSampleMR")
37+
install.packages("TwoSampleMR", repos = c("https://mrcieu.r-universe.dev", "https://cloud.r-project.org"))
3638
```
3739

38-
To update the package just run the
39-
`remotes::install_github("MRCIEU/TwoSampleMR")` command again.
40+
Users running Linux or WebR please see the [following
41+
instructions](https://github.com/MRCIEU/mrcieu.r-universe.dev#readme).
42+
43+
To update the package run the same command again.
4044

41-
We recommend using this new version going forwards but for a limited
42-
time we are enabling backwards compatibility, in case you are in the
43-
middle of analysis or need to reproduce old analysis. In order to use
44-
the legacy version of the package and the database, install using:
45+
### Installing from source
4546

4647
``` r
4748
install.packages("remotes")
48-
remotes::install_github("MRCIEU/TwoSampleMR@0.4.26")
49+
remotes::install_github("MRCIEU/TwoSampleMR")
4950
```
5051

52+
To update the package just run the
53+
`remotes::install_github("MRCIEU/TwoSampleMR")` command again.
54+
5155
## Docker
5256

5357
A docker image containing R with the TwoSampleMR package pre-installed

index.md

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
[![R-CMD-check](https://github.com/MRCIEU/TwoSampleMR/actions/workflows/check-full.yaml/badge.svg)](https://github.com/MRCIEU/TwoSampleMR/actions/workflows/check-full.yaml)
55
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html) [![DOI](https://zenodo.org/badge/49515156.svg)](https://zenodo.org/badge/latestdoi/49515156)
66
[![Codecov test coverage](https://codecov.io/gh/MRCIEU/TwoSampleMR/branch/master/graph/badge.svg)](https://app.codecov.io/gh/MRCIEU/TwoSampleMR?branch=master)
7+
[![TwoSampleMR status badge](https://mrcieu.r-universe.dev/badges/TwoSampleMR)](https://mrcieu.r-universe.dev/TwoSampleMR)
78
<!-- badges: end -->
89

910
A package for performing Mendelian randomization using GWAS summary data. It uses the [IEU GWAS database](https://gwas.mrcieu.ac.uk/) to obtain data automatically, and a wide range of methods to run the analysis. You can use the [MR-Base web app](https://www.mrbase.org/) to try out a limited range of the functionality in this package, but for any serious work we strongly recommend using this R package.
@@ -14,22 +15,25 @@ A package for performing Mendelian randomization using GWAS summary data. It use
1415

1516
## Installation
1617

17-
To install the latest version of TwoSampleMR, perform as normal:
18+
Users running Windows and macOS, to install the latest version of TwoSampleMR please install from our MRC IEU r-universe
1819

19-
``` r
20-
install.packages("remotes")
21-
remotes::install_github("MRCIEU/TwoSampleMR")
20+
```r
21+
install.packages("TwoSampleMR", repos = c("https://mrcieu.r-universe.dev", "https://cloud.r-project.org"))
2222
```
2323

24-
To update the package just run the `remotes::install_github("MRCIEU/TwoSampleMR")` command again.
24+
Users running Linux or WebR please see the [following instructions](https://github.com/MRCIEU/mrcieu.r-universe.dev#readme).
2525

26-
We recommend using this new version going forwards but for a limited time we are enabling backwards compatibility, in case you are in the middle of analysis or need to reproduce old analysis. In order to use the legacy version of the package and the database, install using:
26+
To update the package run the same command again.
27+
28+
### Installing from source
2729

2830
``` r
2931
install.packages("remotes")
30-
remotes::install_github("MRCIEU/TwoSampleMR@0.4.26")
32+
remotes::install_github("MRCIEU/TwoSampleMR")
3133
```
3234

35+
To update the package just run the `remotes::install_github("MRCIEU/TwoSampleMR")` command again.
36+
3337
## Docker
3438

3539
A docker image containing R with the TwoSampleMR package pre-installed is available here: https://hub.docker.com/r/mrcieu/twosamplemr

inst/sandpit/api_alive.r

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,3 @@ toggle_api("release")
115115
pout2 <- extract_outcome_data(snplist[1:5000], 1001, proxies=TRUE)
116116
Sys.time()-t1
117117
# 40sec
118-

inst/sandpit/api_comparisons.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,4 @@ table(out1 == out2)
4141

4242

4343
dat1 <- harmonise_data(exposure_dat, out2)
44-
dat2 <- harmonise_data(inst2, out2)
44+
dat2 <- harmonise_data(inst2, out2)

inst/sandpit/forest_plots.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ forest_plot(mr_result, in_columns=TRUE, by_category=FALSE, exponentiate=TRUE, tr
1717

1818
forest_plot(mr_result, in_columns=FALSE, by_category=TRUE)
1919
forest_plot(mr_result, in_columns=FALSE, by_category=FALSE)
20-

inst/sandpit/harmonise.R

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
2-
31
# Assumptions - effect allele is present in exposure and outcome
42
# Possibilities
53

@@ -29,7 +27,7 @@
2927

3028

3129

32-
a <- read.table("inst/data/alleles.txt", he=T, stringsAsFactors=FALSE)
30+
a <- read.table("inst/extdata/alleles.txt", he=T, stringsAsFactors=FALSE)
3331
SNP <- a$SNP
3432
A1 <- a$A1
3533
A2 <- a$A2
@@ -62,9 +60,9 @@ outcome_dat <- data.frame(
6260
stringsAsFactors=FALSE
6361
)
6462

65-
dat <- harmonise_exposure_outcome(exposure_dat, outcome_dat)
63+
dat <- TwoSampleMR::harmonise_data(exposure_dat, outcome_dat)
6664

67-
a <- read.table("inst/data/alleles.txt", he=T, stringsAsFactors=FALSE)
65+
a <- read.table("inst/extdata/alleles.txt", he=T, stringsAsFactors=FALSE)
6866
SNP <- a$SNP
6967
A1 <- a$A1
7068
A2 <- a$A2
@@ -76,5 +74,5 @@ fA <- a$fA
7674
fB <- a$fB
7775

7876
fA[4] <- NA
79-
harmonise_21(SNP, A1, A2, B1, betaA, betaB, fA, rep(NA, length(SNP)), 0.08, 2)
80-
harmonise_22(SNP, A1, A2, B1, B2, betaA, betaB, fA, fB, 0.08, 3)
77+
TwoSampleMR:::harmonise_21(SNP, A1, A2, B1, betaA, betaB, fA, rep(NA, length(SNP)), 0.08, 2)
78+
TwoSampleMR:::harmonise_22(SNP, A1, A2, B1, B2, betaA, betaB, fA, fB, 0.08, 3)

inst/sandpit/multivariable_mr.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,3 @@ kable(mv_ivw(dat)$result)
8989
```{r}
9090
kable(mv_basic(dat)$result)
9191
```
92-
93-

0 commit comments

Comments
 (0)