plot_qq_two_gwas: Plot the -log10p-value distributions for two univariate GWAS...

Description Usage Arguments Value

View source: R/effects-evaluation.R

Description

This function takes GWAS results from the dive_ functions of snpdiver that create FBM of univariate GWAS effects. It uses ggplot2 to plot these distributions against one another for comparison purposes.

Usage

1
2
3
4
5
6
7
8
plot_qq_two_gwas(
  effects,
  metadata,
  e_row = 1,
  o_row = 2:nrow(metadata),
  thr = 5,
  suffix = NA
)

Arguments

effects

GWAS output saved as an FBM with an .rds and .bk file generated by dive_phe2effects or dive_phe2mash functions of snpdiver. Load this into the R environment using bigstatsr::big_attach.

metadata

The metadata associated with GWAS output generated by dive_phe2effects or dive_phe2mash functions of snpdiver. Eventually this and gwas should be rolled into a new object type for R, but not yet.

e_row

Integer. The row number of gwas_meta that corresponds to the expected GWAS. This will be plotted on the x-axis for all comparisons.

o_row

Integer vector. The rownumbers of gwas_meta that are the observed GWAS. These will be compared to the expected GWAS in e_row.

thr

Numeric. -log10p threshold. Only SNPs with an expected -log10p value above this threshold will be plotted.

suffix

Optional character vector to give saved files a unique search string/name.

Value

Plots saved to disk in a "analysis/gwas_comps" folder comparing the expected distribution, e_row, to all observed gwas distributions, o_row.


Alice-MacQueen/snpdiver documentation built on Dec. 17, 2021, 8:41 a.m.