prep_miami_data: Prepare data for miami plot

View source: R/prep_miami_data.R

prep_miami_dataR Documentation

Prepare data for miami plot

Description

Prepare data for miami plot

Usage

prep_miami_data(data, split_by, split_at, chr = "chr", pos = "pos", p = "p")

Arguments

data

A data.frame object. Required.

split_by

A character vector. The name of the column to use for splitting into upper and lower sections of the Miami plot. Required.

split_at

A character or numeric vector. If numeric, the upper plot will contain your results where the values in the split_by column are >= split_at. If character, upper plot will contain your results where the values in the split_by column are equal to split_at. Required.

chr

The name of the column containing your chromosome information. Defaults to "chr"

pos

The name of the column containing your position information. Defaults to "pos"

p

The name of the column containing your p-value information. Defaults to "p"

Value

A list containing the data needed for the upper and lower plots, axes, and the maximum p-value (for sizing the plot)

Author(s)

Julie White

References

https://github.com/juliedwhite/miamiplot

Examples

  # To create plot data where results are split with positive beta values in
  # the upper plot and negative beta values in the lower plot:
    plot_data <- prep_miami_data(data = gwas_results, split_by = "beta",
                                 split_at = 0, p = "pval")

juliedwhite/miamiplot documentation built on Aug. 16, 2022, 12:05 a.m.