compare_beta: Plot transformed linear GWAS beta values against the...

Description Usage Arguments Details Value

View source: R/visualisations.R

Description

Creates a scatterplot of transformed linear GWAS beta values against the LTFH_transformed values.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
compare_beta(
  dataset,
  beta_x,
  beta_y,
  bonferroni,
  line_color = "green",
  line_type = "dashed",
  save_plot_path = FALSE,
  plot_filename = "Compare_beta.png"
)

Arguments

dataset

data imported to R by load_results().

beta_x

column containing beta-values to be displayed on the x-axis. E.g. the transformed LTFH beta values. State in the format dataset$beta_x.

beta_y

column containing beta-values to be displayed on the y-axis. E.g. the linear GWAS beta values. State in the format dataset$beta_y.

bonferroni

column containing the corrected significant values from LTFH. State in the format dataset$bonferroni.

line_color

the color of the identity line.

line_type

the type of the identity line.

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 each other.
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() choosing to create the LTFH transformed column.
vignette("ggplot2-specs", package = "ggplot2") details the usage of aesthetic parameters in ggplot2.

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.