Skip to content

Commit ffc9964

Browse files
authored
Merge pull request #613 from remlapmot/v0-6-14
TwoSampleMR 0.6.14
2 parents d9c59d0 + 618d461 commit ffc9964

23 files changed

+48
-41
lines changed

.github/workflows/check-full.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ jobs:
2929
matrix:
3030
config:
3131
- {os: macos-latest, r: 'release'}
32-
- {os: macos-13, r: 'release'}
3332
- {os: windows-latest, r: 'release'}
3433
- {os: ubuntu-latest, r: 'release'}
3534
- {os: ubuntu-latest, r: 'oldrel-1'}
3635
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
3736
- {os: ubuntu-latest, r: '4.3.2'}
38-
- {os: ubuntu-24.04-arm, r: 'release', rspm: 'no' }
37+
- {os: macos-13, r: 'release'}
38+
# - {os: ubuntu-24.04-arm, r: 'release', rspm: 'no' }
3939

4040
env:
4141
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: TwoSampleMR
22
Title: Two Sample MR Functions and Interface to MRC Integrative
33
Epidemiology Unit OpenGWAS Database
4-
Version: 0.6.13
4+
Version: 0.6.14
55
Authors@R: c(
66
person("Gibran", "Hemani", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0003-0920-1055")),

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# TwoSampleMR v0.6.14
2+
3+
(Release date 2025-03-28)
4+
5+
* Minor amends to the `mr_grip()` returned object names (thanks @fdudbridge)
6+
* Fixed some typos in the helpfiles and vignettes
7+
18
# TwoSampleMR v0.6.13
29

310
(Release date 2025-03-26)

R/forest_plot2.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ forest_plot_names <- function(dat, section=NULL, bottom=TRUE)
438438
#'
439439
#' @param mr_res Results from [mr()].
440440
#' @param exponentiate Convert effects to OR? Default is `FALSE`.
441-
#' @param single_snp_method Which of the single SNP methosd to use when only 1 SNP was used to estimate the causal effect? The default is `"Wald ratio"`.
441+
#' @param single_snp_method Which of the single SNP methods to use when only 1 SNP was used to estimate the causal effect? The default is `"Wald ratio"`.
442442
#' @param multi_snp_method Which of the multi-SNP methods to use when there was more than 1 SNPs used to estimate the causal effect? The default is `"Inverse variance weighted"`.
443443
#' @param group_single_categories If there are categories with only one outcome, group them together into an "Other" group. The default is `TRUE`.
444444
#' @param by_category Separate the results into sections by category? The default is `TRUE`.

R/forest_plot_1-to-many.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ format_1_to_many <- function(mr_res, b="b",se="se",exponentiate=FALSE, ao_slc=FA
145145
#' @param sort_action Choose how to sort results.
146146
#' \itemize{
147147
#' \item `sort_action = 1`: sort results by effect size within groups. Use the group order supplied by the user.
148-
#' \item `sort_action = 2`: sort results by effect size and group. Overides the group ordering supplied by the user.
148+
#' \item `sort_action = 2`: sort results by effect size and group. Overrides the group ordering supplied by the user.
149149
#' \item `sort_action = 3`: group results for the same trait together (e.g. multiple results for the same trait from different MR methods).
150150
#' \item `sort_action = 4`: sort by decreasing effect size (largest effect size at top and smallest at bottom).
151151
#' \item `sort_action = 5`: sort by increasing effect size (smallest effect size at top and largest at bottom).

R/ld.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ clump_data <- function(dat, clump_kb=10000, clump_r2=0.001, clump_p1=1, clump_p2
3131

3232
if(!is.data.frame(dat))
3333
{
34-
stop("Expecting data frame returned from format_data")
34+
stop("Expecting data frame returned from format_data().")
3535
}
3636

3737
if("pval.exposure" %in% names(dat) && "pval.outcome" %in% names(dat))

R/mr-grip.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#' MR-GRIP: a modified MR-Egger model with the Genotype Recoding Invariant Property
1+
#' MR-GRIP: a modified MR-Egger model with the Genotype Recoding Invariance Property
22
#'
3-
#' This implements the modified MR-Egger model with the Genotype Recoding Invariant Property (MR-GRIP) due to Dudbridge and Bowden et al. (2025).
3+
#' This implements the modified MR-Egger model with the Genotype Recoding Invariance Property (MR-GRIP) due to Dudbridge and Bowden et al. (2025).
44
#' It is well known that the results of MR-Egger are sensitive to which alleles are designated as the effect alleles.
55
#' A pragmatic convention is to orient all SNPs to have positive effects on the exposure, which has some advantages in interpretation but also brings some philosophical limitations.
66
#' The MR-GRIP model is a modification to the MR-Egger model in which each term is multiplied by the genotype-phenotype associations.
@@ -61,17 +61,17 @@ mr_grip <- function(b_exp, b_out, se_exp, se_out, parameters) {
6161
smod <- summary(mod)
6262
b <- stats::coefficients(smod)[2, 1]
6363
se <- stats::coefficients(smod)[2, 2]
64-
b.adj <- NA
65-
se.adj <- NA
66-
pval.adj <- NA
64+
b.wi <- NA
65+
se.wi <- NA
66+
pval.wi <- NA
6767
pval <- 2 * stats::pt(abs(b / se), length(b_exp) - 2L, lower.tail = FALSE)
6868
return(list(
6969
b = b,
7070
se = se,
7171
pval = pval,
72-
b.adj = b.adj,
73-
se.adj = se.adj,
74-
pval.adj = pval.adj,
72+
b.wi = b.wi,
73+
se.wi = se.wi,
74+
pval.wi = pval.wi,
7575
nsnp = length(b_exp),
7676
mod = smod,
7777
dat = dat

R/multivariable_mr.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ mv_extract_exposures <- function(id_exposure, clump_r2=0.001, clump_kb=10000, ha
6666
#' Note that you can provide an array of column names for each column, which is of length `filenames_exposure`
6767
#'
6868
#' @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.
69-
#' @param sep Specify delimeter 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.
69+
#' @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.
7070
#' @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"`.
7171
#' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`.
72-
#' @param beta_col Required for MR. Name of column with effect sizes. THe default is `"beta"`.
72+
#' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`.
7373
#' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`.
7474
#' @param eaf_col Required for MR. Name of column with effect allele frequency. The default is `"eaf"`.
7575
#' @param effect_allele_col Required for MR. Name of column with effect allele. Must be "A", "C", "T" or "G". The default is `"effect_allele"`.

R/other_formats.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ dat_to_MRInput <- function(dat, get_correlations=FALSE, pop="EUR")
7272

7373
#' Harmonise LD matrix against summary data
7474
#'
75-
#' LD matrix returns with rsid_ea_oa identifiers. Make sure that they are oriented to the same effect allele as the summary dataset. Summary dataset can be exposure dataset or harmonised dartaset.
75+
#' LD matrix returns with rsid_ea_oa identifiers. Make sure that they are oriented to the same effect allele as the summary dataset. Summary dataset can be exposure dataset or harmonised dataset.
7676
#'
7777
#' @param x Exposure dataset or harmonised dataset
7878
#' @param ld Output from [ld_matrix()]

R/read_data.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#'
66
#' @param filename Filename. Must have header with at least SNP column present.
77
#' @param snps SNPs to extract. If `NULL`, which the default, then doesn't extract any and keeps all.
8-
#' @param sep Specify delimeter in file. The default is space, i.e. `sep=" "`.
8+
#' @param sep Specify delimiter in file. The default is space, i.e. `sep=" "`.
99
#' @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"`.
1010
#' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`.
11-
#' @param beta_col Required for MR. Name of column with effect sizes. THe default is `"beta"`.
11+
#' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`.
1212
#' @param se_col Required for MR. Name of column with standard errors. The default is `"se"`.
1313
#' @param eaf_col Required for MR. Name of column with effect allele frequency. The default is `"eaf"`.
1414
#' @param effect_allele_col Required for MR. Name of column with effect allele. Must be "A", "C", "T" or "G". The default is `"effect_allele"`.
@@ -64,7 +64,7 @@ read_outcome_data <- function(filename, snps=NULL, sep=" ", phenotype_col="Pheno
6464
#'
6565
#' @param filename Filename. Must have header with at least SNP column present.
6666
#' @param clump Whether to perform LD clumping with [clump_data()] on the exposure data. The default is `FALSE`.
67-
#' @param sep Specify delimeter in file. The default is a space, i.e. `" "`.
67+
#' @param sep Specify delimiter in file. The default is a space, i.e. `" "`.
6868
#' @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"`.
6969
#' @param snp_col Required name of column with SNP rs IDs. The default is `"SNP"`.
7070
#' @param beta_col Required for MR. Name of column with effect sizes. The default is `"beta"`.

0 commit comments

Comments
 (0)