Skip to contents

Mendelian Randomization

Functions for MR data formatting, harmonization, and analysis.

format_data()
Format Data for Mendelian Randomization Analysis
mr_leaveoneout_plot()
Plot results from leaveoneout analysis
mr_density_plot()
Density plot
mr_funnel_plot()
Funnel plot
mr_forest_plot()
Forest plot
mr_scatter_plot()
modification of TwoSampleMR mr_scatter_plot() function that adds exposure/outcome labels
calculate_r2()
calculate r2
calculate_fstat_from_r2()
calculate fstat from r2
calculate_fstat_from_beta_se()
calculate fstat from beta se
directional_consistency()
Workout consistency of effect estimates
alignment_check()
check the alignment of GWAS to reference panel and flip allele beta where required

Colocalization

Utilities for colocalization analysis and sensitivity checks.

coloc_check_alignment()
Check Alignment for Colocalisation
coloc_sensitivity()
Plots sensitivity analysis for coloc results
coloc_prior.adjust()
Adjust Colocalisation Prior Probabilities
coloc_prior.snp2hyp()
Convert SNP Prior to Hypotheses
coloc_manh.plot()
Plot Manhattan Plot for Colocalisation
coloc_plot_dataset()
plot a coloc dataset
finemap_pval_LD()
Perform LD clumping on a dataframe based on p-value threshold
finimom_cs_table()
Create a Table of Credible Sets from Finimom Model
susieR_cs_table()
Create a Table of Credible Sets from SusieR Model

Visualization

Plotting functions for GWAS results and regional associations.

manhattan()
Creates a Manhattan plot
qqplot()
qqplot
miamiplot()
Create a Miami plot with a central buffer and fixed axis labels
gg_regionplot()
Create a Region Plot with Genetic Data and Recombination Rates
gg_locusplot()
Create a regional association plot The code is adapted from the locusplotr package.
forestplot()
forestplot function
blank_plot()
Create a blank ggplot2 plot
calculate_and_insert_percent_change()
Percent Change and Insertion

LocusComparer Integration

Utilities for integrating with the locuscomparer package.

locuscomparer()
Unified LocusComparer Plotting Function

General purpose functions and variant search utilities.

read_file()
Read File Based on Extension
remove_duplicate_SNP()
Remove duplicate rows based on SNP column
remove_nearby_positions()
Remove rows with nearby positions (excluding "cis" and "cis-trans_cis")
biomaRt_getBM_batch()
Retrieve Batched Data from BioMart with Filters and Attribute Chunks
get_ld_proxies()
Find LD proxies for a set of SNPs
proxy_search()
proxy_search: search for proxies when using read_outcome_data()
proxy_search_DECODE()
finds proxy SNPs from an internal reference (DECODE format)
proxy_search_UKB()
finds proxy SNPs from an internal reference (UKB format)
proxy_search_split()
finds proxy SNPs from an internal reference split the SNP search into 10k blocks
missing_EAF()
Fill Missing EAF Values in Data Frame
replace_na_with_mean()
add the mean sample size for missing SNP sample sizes
model_test()
Provide akaike information criterion for all possible covariate combinations
palette()
make colour palettes
create_ids()
Create IDs from a vector of names
random_string()
Generate random strings