Skip to content

Releases: MRCIEU/TwoSampleMR

TwoSampleMR 0.7.8

10 Jun 09:06
d61ed65

Choose a tag to compare

  • 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

TwoSampleMR 0.7.7

07 Jun 06:37
f7c64ba

Choose a tag to compare

  • Remove dead exposure_mat assignment
  • Replace reshape2::dcast() with tidyr::pivot_wider()
  • Replace deprecated ggplot2::aes_string() with ggplot2::aes()
  • Add new bare names to globalVariables()
  • Replace deprecated size with linewidth in geom_vline(), geom_errorbarh(), geom_errorbar(), and element_rect()
  • Fix constant-in-aes, redundant sapply, and paste/paste0
  • Qualify predict() and desc() calls; remove from globalVariables()
  • Remove broken and unreachable mr_mode_broken() function and its globalVariables() entry
  • Replace sapply with invisible(lapply()) for side-effect iteration; use paste0() for single leading space
  • Replace 1:n index patterns with seq_len() in chunking logic
  • Hoist paste() out of inner loop; replace nested loops with single vectorised assignment
  • Make startup message URLs clickable via cli::style_hyperlink(); add cli to Imports

TwoSampleMR 0.7.6

15 May 15:06
5121e4e

Choose a tag to compare

  • Fix some typos

TwoSampleMR 0.7.5

04 May 10:08
48bed40

Choose a tag to compare

  • Amend https://gwas.mrcieu.ac.uk URLs to https://opengwas.io/
  • Bump version of roxygen2 to 8.0.0 and regenerate documentation
  • Replace array(1:nexp) placeholder allocations with numeric(nexp)/integer(nexp) in multivariable MR functions
  • Replace 1:n with seq_len(n) in loop indices across singlesnp, leaveoneout, rucker, mr_mode, and multivariable_mr for empty-vector safety
  • Pre-generate jackknife resample indices in mr_rucker_jackknife_internal and switch to lapply, matching the bootstrap function pattern
  • Vectorise get_population_allele_frequency by inlining the quadratic-root logic from contingency() and picking the valid root with vectorised constraint checks
  • Skip mr_wald_ratio inside mr() when more than one SNP is provided and other methods are also requested, suppressing the multi-SNP warning for default method runs while preserving the warning when mr_wald_ratio is requested on its own

TwoSampleMR 0.7.4

02 Apr 10:38
bf5a8c2

Choose a tag to compare

  • Small tweaks to the categorized forest plots to make them more similar to the original ones in the article.
  • Expanded the multivariable MR section of the Perform MR vignette (thanks @mvab)

TwoSampleMR 0.7.3

31 Mar 08:26
a6defd3

Choose a tag to compare

  • Some further code optimizations

TwoSampleMR 0.7.2

30 Mar 17:29
1f5ea53

Choose a tag to compare

TwoSampleMR 0.7.1

25 Mar 08:17
8b0685a

Choose a tag to compare

  • Added error message if unsupported method listed in the method_list argument to the mr() function (thanks @42kuroniko)
  • Added warning if mr_wald_ratio() passed more than one genotype's summary statistics

TwoSampleMR 0.7.0

24 Feb 10:31
faa16b9

Choose a tag to compare

  • Fixed a bug in the calculation in one of the code paths for the inferred p-value in format_data() (thanks @j-brody)
  • Fixed the calculation of a p-value in mr_rucker_internal()
  • Fixed a replacement length warning in get_population_allele_frequency()
  • Reformatted code base with air

TwoSampleMR 0.6.30

06 Feb 13:54
07311dd

Choose a tag to compare

Some optimizations to the code, including:

  • Vectorised mr_egger_regression_bootstrap()
  • Vectorised weighted_median_bootstrap()
  • Deleted duplicated weighted_median() function
  • Replace plyr function calls with data.table function calls
    • plyr::rbind.fill(...) to data.table::rbindlist(..., fill = TRUE, use.names = TRUE)
    • plyr::ddply(dat, cols, func) to lapply() over unique combinations + data.table::rbindlist()
    • Added data.table::setDF() calls to convert back to data.frame for compatibility
    • And removed plyr from Imports list
  • In flip_alleles() use chartr() instead of 4 gsub() calls
  • In random_string() use single call to sample() instead of n calls
  • Optimized mr_mode()
  • Replaced apply(..., any(is.na())) with complete.case()
  • Optimized the mr() function
  • Optimized the Optimize get_r_from_lor() function
  • Optimized the mr_rucker_bootstrap() and mr_rucker_jackknife_internal() functions
  • Replaced sapply() with vapply() in several cases
  • Optimized the simple_cap() function
  • And a few other minor optimizations