From 867c3d6c985d943005d1462c7ac3a888bd18e8c7 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:45:01 +0100 Subject: [PATCH 1/9] Grammar --- vignettes/introduction.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/introduction.Rmd b/vignettes/introduction.Rmd index d2bf7259..02adb54c 100644 --- a/vignettes/introduction.Rmd +++ b/vignettes/introduction.Rmd @@ -83,7 +83,7 @@ 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 [IEU GWAS database](https://opengwas.io) 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 +3. Harmonise the effect sizes for the instruments on the exposures and the outcomes to be aligned to the same reference allele 4. Perform MR analysis, sensitivity analyses, create plots, compile reports A diagrammatic overview is shown here: From 424720c0569566bc0d847b0bd95595abfb0fe395 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:45:14 +0100 Subject: [PATCH 2/9] Delete repeated word --- vignettes/exposure.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/exposure.Rmd b/vignettes/exposure.Rmd index e33af969..59b94c11 100644 --- a/vignettes/exposure.Rmd +++ b/vignettes/exposure.Rmd @@ -60,7 +60,7 @@ You can also provide the following extra information: - `ncontrol` - Number of controls - `pval` - The P-value for the SNP's association with the exposure - `units` - The units in which the effects are presented -- `gene` - The gene or other annotation for the the SNP +- `gene` - The gene or other annotation for the SNP ## Reading in from a file From e7164dac75688ed2a89717c7095078711921794a Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:45:36 +0100 Subject: [PATCH 3/9] Amend the to to --- R/multivariable_mr.R | 2 +- R/read_data.R | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/multivariable_mr.R b/R/multivariable_mr.R index b4e56601..cec18d5d 100644 --- a/R/multivariable_mr.R +++ b/R/multivariable_mr.R @@ -123,7 +123,7 @@ mv_extract_exposures <- function( #' #' @param filenames_exposure Filenames for each exposure dataset. Must have header with at least SNP column present. Following arguments are used for determining how to read the filename and clumping etc. #' @param sep Specify delimiter in file. The default is space, i.e. `sep=" "`. If length is 1 it will use the same `sep` value for each exposure dataset. You can provide a vector of values, one for each exposure dataset, if the values are different across datasets. The same applies to all dataset-formatting options listed below. -#' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value `"Outcome"`. Default is `"Phenotype"`. +#' @param phenotype_col Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value `"Outcome"`. Default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. #' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. #' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`. diff --git a/R/read_data.R b/R/read_data.R index 342df17f..fa64fe1e 100644 --- a/R/read_data.R +++ b/R/read_data.R @@ -6,7 +6,7 @@ #' @param filename Filename. Must have header with at least SNP column present. #' @param snps SNPs to extract. If `NULL`, which the default, then doesn't extract any and keeps all. #' @param sep Specify delimiter in file. The default is space, i.e. `sep=" "`. -#' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value `"Outcome"`. Default is `"Phenotype"`. +#' @param phenotype_col Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value `"Outcome"`. Default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. #' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. #' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`. @@ -86,7 +86,7 @@ read_outcome_data <- function( #' @param filename Filename. Must have header with at least SNP column present. #' @param clump Whether to perform LD clumping with [clump_data()] on the exposure data. The default is `FALSE`. #' @param sep Specify delimiter in file. The default is a space, i.e. `" "`. -#' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value "Outcome". The default is `"Phenotype"`. +#' @param phenotype_col Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value "Outcome". The default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. #' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. #' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`. @@ -184,7 +184,7 @@ read_exposure_data <- function( #' @param type Is this the exposure or the outcome data that is being read in? The default is `"exposure"`. #' @param snps SNPs to extract. If NULL then doesn't extract any and keeps all. The default is `NULL`. #' @param header The default is `TRUE`. -#' @param phenotype_col Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value `"Outcome"`. The default is `"Phenotype"`. +#' @param phenotype_col Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value `"Outcome"`. The default is `"Phenotype"`. #' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`. #' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`. #' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`. From 611564b09c6fc5771bd1edfd07086859ea35eab5 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:46:13 +0100 Subject: [PATCH 4/9] Fix grammar in comment --- R/forest_plot2.R | 2 +- R/forest_plot_1-to-many.R | 2 +- R/format_mr_results2.R | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/forest_plot2.R b/R/forest_plot2.R index 9cfd674c..31e81156 100644 --- a/R/forest_plot2.R +++ b/R/forest_plot2.R @@ -69,7 +69,7 @@ format_mr_results <- function( #generate a simple trait column. this contains only the outcome name (ie excludes consortium and year from the outcome column generated by mr()). This step caters to the possibility that a user's results contain a mixture of results obtained via MR-Base and correspondence. The later won't be present in the MR-Base database. However, still need to split the outcome name into trait, year and consortium. if (!ao_slc) { dat$trait <- dat$outcome - Pos <- grep("\\|\\|", dat$trait) #this indicates the outcome column was derived from data in MR-Base. Sometimes it wont look like this e.g. if the user has supplied their own outcomes + Pos <- grep("\\|\\|", dat$trait) #this indicates the outcome column was derived from data in MR-Base. Sometimes it won't look like this e.g. if the user has supplied their own outcomes if (sum(Pos) != 0) { Outcome <- dat$trait[Pos] Outcome <- unlist(strsplit(Outcome, split = "\\|\\|")) diff --git a/R/forest_plot_1-to-many.R b/R/forest_plot_1-to-many.R index d40a9d7f..c4e98568 100644 --- a/R/forest_plot_1-to-many.R +++ b/R/forest_plot_1-to-many.R @@ -97,7 +97,7 @@ format_1_to_many <- function( #generate a simple trait column. this contains only the outcome name (ie excludes consortium and year from the outcome column generated by mr()). This step caters to the possibility that a user's results contain a mixture of results obtained via MR-Base and correspondence. The later won't be present in the MR-Base database. However, still need to split the outcome name into trait, year and consortium. if (!ao_slc) { dat$trait <- as.character(dat[, TraitM]) - Pos <- grep("\\|\\|", dat$trait) #this indicates the outcome column was derived from data in MR-Base. Sometimes it wont look like this e.g. if the user has supplied their own outcomes + Pos <- grep("\\|\\|", dat$trait) #this indicates the outcome column was derived from data in MR-Base. Sometimes it won't look like this e.g. if the user has supplied their own outcomes if (sum(Pos) != 0) { Outcome <- dat$trait[Pos] Outcome <- unlist(strsplit(Outcome, split = "\\|\\|")) diff --git a/R/format_mr_results2.R b/R/format_mr_results2.R index 4c6e73c2..1a1ad782 100644 --- a/R/format_mr_results2.R +++ b/R/format_mr_results2.R @@ -7,7 +7,7 @@ #' @export #' @return data frame split_outcome <- function(mr_res) { - Pos <- grep("\\|\\|", mr_res$outcome) #the "||"" indicates that the outcome column was derived from summary data in MR-Base. Sometimes it wont look like this e.g. if the user has supplied their own outcomes + Pos <- grep("\\|\\|", mr_res$outcome) #the "||"" indicates that the outcome column was derived from summary data in MR-Base. Sometimes it won't look like this e.g. if the user has supplied their own outcomes if (sum(Pos) != 0) { Outcome <- as.character(mr_res$outcome[Pos]) Vars <- strsplit(Outcome, split = "\\|\\|") @@ -30,7 +30,7 @@ split_outcome <- function(mr_res) { #' @export #' @return data frame split_exposure <- function(mr_res) { - Pos <- grep("\\|\\|", mr_res$exposure) #the "||"" indicates that the outcome column was derived from summary data in MR-Base. Sometimes it wont look like this e.g. if the user has supplied their own outcomes + Pos <- grep("\\|\\|", mr_res$exposure) #the "||"" indicates that the outcome column was derived from summary data in MR-Base. Sometimes it won't look like this e.g. if the user has supplied their own outcomes # Pos2<-grep("\\|\\|",mr_res$exposure,invert=T) # mr_res2 <-mr_res[Pos2,] # mr_res1<-mr_res[Pos,] From 6a23db1d90fd0ce58b9e80ac84459fd47a544f8f Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:46:51 +0100 Subject: [PATCH 5/9] Delete repeated word --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 1105bdb0..945abe6c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -62,7 +62,7 @@ * Optimized `mr_mode()` * Replaced `apply(..., any(is.na()))` with `complete.case()` * Optimized the `mr()` function -* Optimized the `Optimize get_r_from_lor()` function +* Optimized the `get_r_from_lor()` function * Optimized the `mr_rucker_bootstrap()` and `mr_rucker_jackknife_internal()` functions * Replaced `sapply()` with `vapply()` in several cases * Optimized the `simple_cap()` function From 7eb28089bf583066376a413db780d0f4aa8a175b Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:47:01 +0100 Subject: [PATCH 6/9] Delete word --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 945abe6c..113dbbbb 100644 --- a/NEWS.md +++ b/NEWS.md @@ -406,7 +406,7 @@ TwoSampleMR v0.5.4 * All datasets now re-instated * Added options for different populations in LD operations -* When converting to MRInput format and supplying an LD matrix, it is possible that multi-allelic variants will be represented differently on in the GWAS and the LD reference panel. Ambiguous alignments were not being removed, now fixed. Credit goes to Mona Almramhi for spotting and fixing this issue. +* When converting to MRInput format and supplying an LD matrix, it is possible that multi-allelic variants will be represented differently in the GWAS and the LD reference panel. Ambiguous alignments were not being removed, now fixed. Credit goes to Mona Almramhi for spotting and fixing this issue. TwoSampleMR v0.5.3 ============== From 4f88df74612c1f57447a15b6b2ff7d62cc3daf63 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Thu, 14 May 2026 19:47:07 +0100 Subject: [PATCH 7/9] Document --- man/format_data.Rd | 2 +- man/mv_extract_exposures_local.Rd | 2 +- man/read_exposure_data.Rd | 2 +- man/read_outcome_data.Rd | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/man/format_data.Rd b/man/format_data.Rd index 011e66f4..d15bb5f8 100644 --- a/man/format_data.Rd +++ b/man/format_data.Rd @@ -40,7 +40,7 @@ format_data( \item{header}{The default is \code{TRUE}.} -\item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value \code{"Outcome"}. The default is \code{"Phenotype"}.} +\item{phenotype_col}{Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value \code{"Outcome"}. The default is \code{"Phenotype"}.} \item{snp_col}{Required name of column with SNP rs IDs. The default is \code{"SNP"}.} diff --git a/man/mv_extract_exposures_local.Rd b/man/mv_extract_exposures_local.Rd index 595ea553..d9adff4a 100644 --- a/man/mv_extract_exposures_local.Rd +++ b/man/mv_extract_exposures_local.Rd @@ -37,7 +37,7 @@ mv_extract_exposures_local( \item{sep}{Specify delimiter in file. The default is space, i.e. \code{sep=" "}. If length is 1 it will use the same \code{sep} value for each exposure dataset. You can provide a vector of values, one for each exposure dataset, if the values are different across datasets. The same applies to all dataset-formatting options listed below.} -\item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value \code{"Outcome"}. Default is \code{"Phenotype"}.} +\item{phenotype_col}{Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value \code{"Outcome"}. Default is \code{"Phenotype"}.} \item{snp_col}{Required name of column with SNP rs IDs. The default is \code{"SNP"}.} diff --git a/man/read_exposure_data.Rd b/man/read_exposure_data.Rd index e66a5e52..862b97a9 100644 --- a/man/read_exposure_data.Rd +++ b/man/read_exposure_data.Rd @@ -41,7 +41,7 @@ read_exposure_data( \item{sep}{Specify delimiter in file. The default is a space, i.e. \code{" "}.} -\item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value "Outcome". The default is \code{"Phenotype"}.} +\item{phenotype_col}{Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value "Outcome". The default is \code{"Phenotype"}.} \item{snp_col}{Required name of column with SNP rs IDs. The default is \code{"SNP"}.} diff --git a/man/read_outcome_data.Rd b/man/read_outcome_data.Rd index 4e8879d1..453126d5 100644 --- a/man/read_outcome_data.Rd +++ b/man/read_outcome_data.Rd @@ -35,7 +35,7 @@ read_outcome_data( \item{sep}{Specify delimiter in file. The default is space, i.e. \code{sep=" "}.} -\item{phenotype_col}{Optional column name for the column with phenotype name corresponding the the SNP. If not present then will be created with the value \code{"Outcome"}. Default is \code{"Phenotype"}.} +\item{phenotype_col}{Optional column name for the column with phenotype name corresponding to the SNP. If not present then will be created with the value \code{"Outcome"}. Default is \code{"Phenotype"}.} \item{snp_col}{Required name of column with SNP rs IDs. The default is \code{"SNP"}.} From 6dffb41ad99edab48bc35974e1d218d2b0229dc9 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Fri, 15 May 2026 15:54:57 +0100 Subject: [PATCH 8/9] Bump version --- DESCRIPTION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 81857575..c38a3923 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: TwoSampleMR Title: Two Sample MR Functions and Interface to MRC Integrative Epidemiology Unit OpenGWAS Database -Version: 0.7.5 +Version: 0.7.6 Authors@R: c( person("Gibran", "Hemani", , "g.hemani@bristol.ac.uk", role = c("aut", "cre"), comment = c(ORCID = "0000-0003-0920-1055")), From 1aefa0e1f15dc256aa4ec9a3be6cb8ac49b6edf3 Mon Sep 17 00:00:00 2001 From: Tom Palmer Date: Fri, 15 May 2026 15:55:02 +0100 Subject: [PATCH 9/9] Update NEWS.md --- NEWS.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/NEWS.md b/NEWS.md index 113dbbbb..9cc5f630 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,9 @@ +# TwoSampleMR v0.7.6 + +(Release date 2026-05-15) + +* Fix some typos + # TwoSampleMR v0.7.5 (Release date 2026-05-04)