plot_estimates_vs_true: Plot true effects against estimated effects of SNPs

Description Usage Arguments Details Value

View source: R/visualisations.R

Description

Creates a scatterplot of true effect sizes against estimated effect sizes.

Usage

1
2
3
4
5
6
7
8
9
plot_estimates_vs_true(
  dataset,
  BETA,
  P,
  bonferroni,
  true_effect,
  save_plot_path = FALSE,
  plot_filename = "beta_comparison.png"
)

Arguments

dataset

data imported to R by load_results().

BETA

column containing the estimated effect sizes from the analysis. State in the format dataset$BETA.

P

column containing the p-values from the analysis. State in the format dataset$P.

bonferroni

the column containing significance at bonferroni correction. State in the format dataset$bonferroni.

true_effect

the column containing the true effect sizes. State in the format dataset$true_effect. Note: standard called 'beta' if loaded by load_results().

save_plot_path

if FALSE, return the function returns a ggplot object. Else a path of the directory to save the plot to.

plot_filename

name of the file to be saved, including file extension. Must be either .pdf, .png or .jpeg

Details

In the plot an identity line is included, which helps visualise how well the estimations compare to the true effect sizes.
Only SNPs with a p-value smaller than 0.05 are included in the plot.
The plot requires the user to run an analysis with analysis_association(), load the results and merge with beta.txt using load_results() and augment results with augment_results().

Value

Either returns a ggplot object or saves the plot to save_plot_path and returns NULL.


FireGutter/geneference documentation built on Dec. 17, 2021, 8:27 p.m.