TwoSampleMR 0.7.8#682
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ldsc_rg()which passedd1$l2instead ofd2$l2as the weight vector to the trait-2ldsc_h2_internal()callextract_split()chunking which gavensplit = 0for SNP lists smaller than half thesplitsize; now usesceiling()with contiguous chunk idsmr_mode()for vector-valuedphi: each SNP is now penalised against the weighted-mode estimate for the samephirather than recycling the mode vector across SNPs (results unchanged for the default scalarphi = 1)add_metadata()to usedat[order(dat[[order_col]]), ]aes()call asggplot2::aes()intest_r_from_pn()isTRUE(all.equal())instead ofall.equal() == TRUEinsideifelse()for null-line detection in the forest plot functions, which could otherwise return a multi-element vectorIndexassignment inforest_plot_1_to_many()usingLetters[match()], which is also robust to non-contiguous group rows||condition inextract_outcome_data_internal()TAUsqaccumulation inPM()inrucker.Rcombine_data()and switched itssapply()tovapply()tidyr::gather()withtidyr::pivot_longer()intest_r_from_pn()and dropped a redundantrequireNamespace("tidyr")guard