Skip to content

TwoSampleMR 0.7.8#682

Merged
remlapmot merged 22 commits into
MRCIEU:masterfrom
remlapmot:devel-2026-06-09
Jun 10, 2026
Merged

TwoSampleMR 0.7.8#682
remlapmot merged 22 commits into
MRCIEU:masterfrom
remlapmot:devel-2026-06-09

Conversation

@remlapmot

Copy link
Copy Markdown
Contributor
  • Fixed a copy-paste bug in ldsc_rg() which passed d1$l2 instead of d2$l2 as the weight vector to the trait-2 ldsc_h2_internal() call
  • Fixed extract_split() chunking which gave nsplit = 0 for SNP lists smaller than half the splitsize; now uses ceiling() with contiguous chunk ids
  • Fixed the penalised mode in mr_mode() for vector-valued phi: each SNP is now penalised against the weighted-mode estimate for the same phi rather than recycling the mode vector across SNPs (results unchanged for the default scalar phi = 1)
  • Fixed row order restoration in add_metadata() to use dat[order(dat[[order_col]]), ]
  • Qualified a bare aes() call as ggplot2::aes() in test_r_from_pn()
  • Used isTRUE(all.equal()) instead of all.equal() == TRUE inside ifelse() for null-line detection in the forest plot functions, which could otherwise return a multi-element vector
  • Simplified the group Index assignment in forest_plot_1_to_many() using Letters[match()], which is also robust to non-contiguous group rows
  • Collapsed a duplicated || condition in extract_outcome_data_internal()
  • Removed dead TAUsq accumulation in PM() in rucker.R
  • Fixed an error message typo in combine_data() and switched its sapply() to vapply()
  • Replaced superseded tidyr::gather() with tidyr::pivot_longer() in test_r_from_pn() and dropped a redundant requireNamespace("tidyr") guard
  • Lint package with Jarl

remlapmot added 22 commits June 9, 2026 11:59
Pass d2$l2 instead of d1$l2 as the weight vector in the trait-2 ldsc_h2_internal() call
This is for null_line detection in forest plot functions, which could return a multi-element vector when the comparison produced multiple difference messages
round() gave nsplit = 0 for SNP lists under half the splitsize causing split(snplist, 1:0) to misgroup; use ceiling() with contiguous chunk ids matching the query.R idiom
Penalise each SNP against the weighted-mode estimate for the same phi instead of recycling the length-nphi mode vector across SNPs (results unchanged for the default scalar phi = 1)
Use dat[order(dat[[order_col]]), ] instead of dat[dat[[order_col]], ] which only worked by coincidence while no operation reordered rows
Both clauses tested the same thing with operands swapped
The all-caps TAUsq vector was grown every while-loop iteration but never read
…ers[match()]

The previous unlist(lapply()) concatenated blocks in group order and only assigned correctly when rows were already contiguous by group
…e") and use vapply(..., logical(1)) instead of sapply()
And drop the redundant requireNamespace("tidyr") guard now that tidyr is in Imports
…esolve jarl implicit_assignment warnings

expect_no_error() returns the evaluated value so the captured plot objects are unchanged
To resolve jarl implicit_assignment warning; the captured value was never used
x1[mr_keep] looks up mr_keep in calling scope rather than filtering rows; use x1[x1$mr_keep] in mr(), mr_leaveoneout() and mr_singlesnp()
In weighted_median() and power_prune(), sort() drops NA values and misaligns paired vectors (betaIV.order/weights.order and nexp/dat1); use a shared order() permutation instead, which is also stable against future jarl runs
using %in% checks so invalid values reach the stop() again; the jarl-introduced !proxies/proxies form silently treated any non-zero numeric as proxies = 1
@remlapmot remlapmot merged commit d61ed65 into MRCIEU:master Jun 10, 2026
24 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant