Generate a manhattan plot for an rvatResult object.

manhattan(
  object,
  highlight = NULL,
  label = NULL,
  threshold = NULL,
  labelThreshold = NULL,
  labelRepel = FALSE,
  labelSize = 3.88,
  contigs = NULL,
  title = "",
  verbose = TRUE
)

Arguments

object

rvatResult object.

highlight

vector of units/VAR_ids that should be highlighted in red

label

Column name of the labels that are used for significant results. If not provided, the function attempts to use a column named "label" if one is present.

threshold

Fwe threshold (bonferroni applied by default).

labelThreshold

P-value threshold to display labels.

labelRepel

Should the text labels repel away from each other and away from the data points? Defaults to FALSE.

labelSize

Size of the label. Defaults to 3.88.

contigs

Update contig lengths from GRCh37 defaults. Can be a character string (e.g. "GRCh38") or a data.frame with 'CHROM' and 'Length' columns. If not specified, the function attempts to infer the genome build from the object metadata, defaulting to GRCh37 if identifying information is missing.

title

Optional title.

verbose

Should the function be verbose? Defaults to TRUE.

Examples

library(rvatData)
data(rvbresults)

# generate manhatan plot
man <- manhattan(
  rvbresults[
    rvbresults$varSetName == "ModerateImpact" & rvbresults$test == "firth",
  ],
  label = "unit",
  contigs = "GRCh38"
)

# if many overlapping gene label, try setting `labelRepel = TRUE`
man <- manhattan(
  rvbresults[
    rvbresults$varSetName == "ModerateImpact" & rvbresults$test == "firth",
  ],
  label = "unit",
  labelRepel = TRUE,
  contigs = "GRCh38"
)

# alter the significane threshold using the `threshold` parameter
man <- manhattan(
  rvbresults[
    rvbresults$varSetName == "ModerateImpact" & rvbresults$test == "firth",
  ],
  label = "unit",
  labelRepel = TRUE,
  threshold = 1e-5,
  contigs = "GRCh38"
)

# the threshold for displaying labels can be set using the `labelTrheshold` parameter
man <- manhattan(
  rvbresults[
    rvbresults$varSetName == "ModerateImpact" & rvbresults$test == "firth",
  ],
  label = "unit",
  labelRepel = TRUE,
  labelThreshold = 1e-12,
  contigs = "GRCh38"
)