Skip to contents

Draw a Manhattan plot for MassGLM objects created with massGLM.

Usage

plot_manhattan(x, ...)

plot_manhattan.MassGLM(
  x,
  coefname = NULL,
  p_adjust_method = c("holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr",
    "none"),
  p_transform = function(x) -log10(x),
  ylab = NULL,
  theme = choose_theme(getOption("rtemis_theme")),
  col_pos = "#43A4AC",
  col_neg = "#FA9860",
  alpha = 0.8,
  ...
)

Arguments

x

MassGLM object.

...

Additional arguments passed to draw_bar.

coefname

Character: Name of coefficient to plot. If NULL, the first coefficient is used.

p_adjust_method

Character: "holm", "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr", "none" - p-value adjustment method.

p_transform

Function to transform p-values for plotting. Default is function(x) -log10(x).

ylab

Character: y-axis label.

theme

Theme object.

col_pos

Character: Color for positive significant coefficients.

col_neg

Character: Color for negative significant coefficients.

alpha

Numeric: Transparency level for the bars.

Value

plotly object.

Author

EDG

Examples

if (FALSE) { # interactive()
# x: outcome of interest as first column, optional covariates in the other columns
# y: features whose association with x we want to study
set.seed(2022)
y <- data.table(rnormmat(500, 40))
x <- data.table(
  x1 = y[[3]] - y[[5]] + y[[14]] + rnorm(500),
  x2 = y[[21]] + rnorm(500)
)
massmod <- massGLM(x, y)
plot_manhattan(massmod)
}