TwoSampleMR
Two Sample MR Functions and Interface to MRC Integrative Epidemiology Unit OpenGWAS Database
The flagship Mendelian randomization package is auditing its own estimators, one bootstrap at a time.
◆Recent moves
- 1mo ago
Bootstrap standard errors corrected in mode and Rucker estimators
Fixes a layout bug present since v0.6.30 in which the pre-generated rnorm() matrix was filled column-by-column while per-SNP means and standard errors recycled element-wise, so each bootstrap draw came from the wrong SNP's distribution and standard errors and p-values came out inflated. Point estimates were unaffected, but inference from mr_mode() and mr_rucker_bootstrap() shifts. Two Rucker functions that accessed per-combination results directly are also unwrapped correctly.
View source ↗ - 2mo ago
Wrong weight vector and chunking fixes across the estimator set
A dense correctness release: ldsc_rg() was passing trait 1's weight vector into the trait-2 heritability call, extract_split() produced zero chunks for SNP lists smaller than half the split size, and the penalised mode recycled the mode vector across SNPs for vector-valued phi. Results are unchanged at the default scalar phi, which is how a bug like that survives.
View source ↗ - 2mo ago
Deprecated ggplot2 idioms and dead code removed
Replaces aes_string(), the deprecated size argument and reshape2::dcast() with current equivalents, and removes an unreachable mr_mode_broken() function. Cleanup that clears check warnings without changing any result.
View source ↗ - 3mo ago
OpenGWAS URLs migrated and Wald ratio warnings quieted
Moves gwas.mrcieu.ac.uk references to opengwas.io and stops mr_wald_ratio() from firing its multi-SNP warning during default multi-method mr() runs while preserving it when the method is requested alone. Also hardens loop indices against empty vectors across the singlesnp, leaveoneout, rucker and multivariable code paths.
View source ↗ - 4mo ago
Categorized forest plots aligned with the published figures
Cosmetic adjustments bringing the categorized forest plots closer to the versions in the original article, plus an expanded multivariable MR vignette section.
View source ↗ - 4mo ago
Further internal code optimizations
A one-line release note covering unspecified code optimizations, shipped a day after the previous release during the densest stretch of the modernization pass.
View source ↗