Releases: MRCIEU/TwoSampleMR
Releases · MRCIEU/TwoSampleMR
TwoSampleMR 0.7.8
- Fixed a copy-paste bug in
ldsc_rg()which passedd1$l2instead ofd2$l2as the weight vector to the trait-2ldsc_h2_internal()call - Fixed
extract_split()chunking which gavensplit = 0for SNP lists smaller than half thesplitsize; now usesceiling()with contiguous chunk ids - Fixed the penalised mode in
mr_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) - Fixed row order restoration in
add_metadata()to usedat[order(dat[[order_col]]), ] - Qualified a bare
aes()call asggplot2::aes()intest_r_from_pn() - Used
isTRUE(all.equal())instead ofall.equal() == TRUEinsideifelse()for null-line detection in the forest plot functions, which could otherwise return a multi-element vector - Simplified the group
Indexassignment inforest_plot_1_to_many()usingLetters[match()], which is also robust to non-contiguous group rows - Collapsed a duplicated
||condition inextract_outcome_data_internal() - Removed dead
TAUsqaccumulation inPM()inrucker.R - Fixed an error message typo in
combine_data()and switched itssapply()tovapply() - Replaced superseded
tidyr::gather()withtidyr::pivot_longer()intest_r_from_pn()and dropped a redundantrequireNamespace("tidyr")guard - Lint package with Jarl
TwoSampleMR 0.7.7
- Remove dead
exposure_matassignment - Replace
reshape2::dcast()withtidyr::pivot_wider() - Replace deprecated
ggplot2::aes_string()withggplot2::aes() - Add new bare names to
globalVariables() - Replace deprecated
sizewithlinewidthingeom_vline(),geom_errorbarh(),geom_errorbar(), andelement_rect() - Fix constant-in-
aes, redundantsapply, andpaste/paste0 - Qualify
predict()anddesc()calls; remove fromglobalVariables() - Remove broken and unreachable
mr_mode_broken()function and itsglobalVariables()entry - Replace
sapplywithinvisible(lapply())for side-effect iteration; usepaste0()for single leading space - Replace
1:nindex patterns withseq_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
- Fix some typos
TwoSampleMR 0.7.5
- 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 withnumeric(nexp)/integer(nexp)in multivariable MR functions - Replace
1:nwithseq_len(n)in loop indices acrosssinglesnp,leaveoneout,rucker,mr_mode, andmultivariable_mrfor empty-vector safety - Pre-generate jackknife resample indices in
mr_rucker_jackknife_internaland switch tolapply, matching the bootstrap function pattern - Vectorise
get_population_allele_frequencyby inlining the quadratic-root logic fromcontingency()and picking the valid root with vectorised constraint checks - Skip
mr_wald_ratioinsidemr()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 whenmr_wald_ratiois requested on its own
TwoSampleMR 0.7.4
- 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
- Some further code optimizations
TwoSampleMR 0.7.2
- Add outlier categorisation on
mr_forest_plot()forest plot, as per https://www.nature.com/articles/s41467-024-48105-7
TwoSampleMR 0.7.1
- Added error message if unsupported method listed in the
method_listargument to themr()function (thanks @42kuroniko) - Added warning if
mr_wald_ratio()passed more than one genotype's summary statistics
TwoSampleMR 0.7.0
- 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
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(...)todata.table::rbindlist(..., fill = TRUE, use.names = TRUE)plyr::ddply(dat, cols, func)tolapply()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()usechartr()instead of 4gsub()calls - In
random_string()use single call tosample()instead of n calls - Optimized
mr_mode() - Replaced
apply(..., any(is.na()))withcomplete.case() - Optimized the
mr()function - Optimized the
Optimize get_r_from_lor()function - Optimized the
mr_rucker_bootstrap()andmr_rucker_jackknife_internal()functions - Replaced
sapply()withvapply()in several cases - Optimized the
simple_cap()function - And a few other minor optimizations