Skip to content

Commit 45fb8a3

Browse files
committed
Move meta to Suggests list
1 parent d4d3913 commit 45fb8a3

File tree

4 files changed

+23
-3
lines changed

4 files changed

+23
-3
lines changed

.github/workflows/check-full.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
- uses: r-lib/actions/setup-r-dependencies@v2
6565
with:
6666
extra-packages: >
67-
any::rcmdcheck, MendelianRandomization=?ignore-before-r=4.4.0, car=?ignore-before-r=4.3.2, Cairo=?ignore-before-r=4.3.0
67+
any::rcmdcheck, MendelianRandomization=?ignore-before-r=4.4.0, car=?ignore-before-r=4.3.2, Cairo=?ignore-before-r=4.3.0, meta=?ignore-before-r=4.4.0
6868
needs: check
6969
upgrade: 'TRUE'
7070

DESCRIPTION

Lines changed: 2 additions & 2 deletions
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.24
4+
Version: 0.6.25
55
Authors@R: c(
66
person("Gibran", "Hemani", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0003-0920-1055")),
@@ -40,7 +40,6 @@ Imports:
4040
lattice,
4141
magrittr,
4242
MASS,
43-
meta,
4443
MRMix,
4544
MRPRESSO,
4645
pbapply,
@@ -54,6 +53,7 @@ Suggests:
5453
car,
5554
markdown,
5655
MendelianRandomization,
56+
meta,
5757
mr.raps,
5858
MRInstruments,
5959
randomForest,

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# TwoSampleMR v0.6.25
2+
3+
(Release date 2025-12-05)
4+
5+
* The **meta** package has been moved to a soft (Suggests list) dependency due to installation problems of new versions of its hard dependencies on R 4.1.
6+
17
# TwoSampleMR v0.6.24
28

39
(Release date 2025-10-31)

R/mr.R

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,12 @@ mr_meta_fixed <- function(b_exp, b_out, se_exp, se_out, parameters) {
346346
if (sum(!is.na(b_exp) & !is.na(b_out) & !is.na(se_exp) & !is.na(se_out)) < 1) {
347347
return(list(b = NA, se = NA, pval = NA, nsnp = NA, Q = NA, Q_df = NA, Q_pval = NA))
348348
}
349+
if (!requireNamespace("meta", quietly = TRUE)) {
350+
stop(
351+
"Package \"meta\" must be installed to use this function.",
352+
call. = FALSE
353+
)
354+
}
349355
ratio <- b_out / b_exp
350356
ratio.se <- sqrt(
351357
(se_out^2 / b_exp^2) + (b_out^2 / b_exp^4) * se_exp^2 - 2 * (b_out / b_exp^3) * parameters$Cov
@@ -387,6 +393,14 @@ mr_meta_random <- function(b_exp, b_out, se_exp, se_out, parameters) {
387393
if (sum(!is.na(b_exp) & !is.na(b_out) & !is.na(se_exp) & !is.na(se_out)) < 2) {
388394
return(list(b = NA, se = NA, pval = NA, nsnp = NA, Q = NA, Q_df = NA, Q_pval = NA))
389395
}
396+
397+
if (!requireNamespace("meta", quietly = TRUE)) {
398+
stop(
399+
"Package \"meta\" must be installed to use this function.",
400+
call. = FALSE
401+
)
402+
}
403+
390404
ratio <- b_out / b_exp
391405
ratio.se <- sqrt(
392406
(se_out^2 / b_exp^2) + (b_out^2 / b_exp^4) * se_exp^2 - 2 * (b_out / b_exp^3) * parameters$Cov

0 commit comments

Comments
 (0)