highlight_miami: Make highlight data.frame for miami plot

View source: R/highlight_miami.R

highlight_miamiR Documentation

Make highlight data.frame for miami plot

Description

Make highlight data.frame for miami plot

Usage

highlight_miami(
  data,
  highlight,
  highlight_col,
  highlight_color = "green",
  logged_p = "logged_p",
  rel_pos = "rel_pos"
)

Arguments

data

A data.frame object. Required.

highlight

A vector of SNPs or gene names you would like to highlight. Defaults to NULL. If you specify this, you must also specify highlight_col so that we know where to find the items.

highlight_col

The column where the values you provide in highlight can be found.

highlight_color

The color that you would like the highlighted SNPs or genes to be. Defaults to "green."

logged_p

The name of the column containing your logged p-value information. Defaults to "logged_p," assuming data preparation with prep_miami_data

rel_pos

The name of the column containing the positon of each SNP/probe relative to all other SNPs/probes in the genome. Defaults to "rel_pos," assuming data preparation with prep_miami_data.

Value

A data.frame with three columns: relative position, logged p-value, and highlight color.

Author(s)

Julie White

References

https://github.com/juliedwhite/miamiplot

Examples

 ## Not run: 
 # You can provide a list of SNP / gene names
 upper_highlight <- highlight_miami(data = plot_data$upper,
                                     highlight = c(rs1, rs2, rs3, ..., rsN),
                                     highlight_col = "rsid")

 # Or an object containing those names.
 upper_highlight <- highlight_miami(data = plot_data$upper,
                                     highlight = snps_of_interest,
                                     highlight_col = "rsid")

 # When highlighting, the items in 'highlight' must all come from a single
 # column. Specifying multiple columns in highlight_col will return an error.
 highlight_miami(data = df, split_by = "study", split_at = "A",
                 highlight = snps_of_interest,
                 highlight_col = c("rsid", "gene"))
 
## End(Not run)


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