Generates a mutation plot visualizing variant-level and gene-level association results along a transcript structure. Optionally, custom tracks such as protein domains or mutation clusters can be overlaid.

mutationPlot(
  singleVar,
  cds,
  customTracks = NULL,
  rvbGene = NULL,
  cdsGapSize = 30,
  cdsLimits = c(log10(0.05), -log10(0.05)),
  pointRange = c(0.25, 3),
  impactScale = NULL,
  trackSpacing = 1,
  trackHeight = 1,
  trackOrder = NULL,
  splitByTrackType = FALSE,
  panelsizes = c(1, 3),
  interactive = FALSE,
  svHoverFields = NULL,
  trackHoverFields = NULL,
  cdsHoverFields = NULL
)

Arguments

singleVar

A singlevarResult or data.frame containing single variant association results. Required columns include POS (variant position, CDS coordinates), P (p-value), and OR (odds ratio). An optional impact column can be included to represent variant impact, which will be mapped to different point shapes.

cds

A GRanges or IRanges object representing the coding sequence (CDS) regions of the transcript.

customTracks

An optional rvbResult or data.frame containing rare variant association statistics for custom tracks. Should include start and end columns (CDS coordinates). A trackType column is required if splitByTrackType = TRUE. Additional columns can be included for hover information (see trackHoverFields).

rvbGene

An optional data.frame or rvbResult object containing gene-level association results. Should contain a P column for the gene-level p-value.

cdsGapSize

The size of the gap to introduce between CDS exons, in base pairs. Defaults to 30.

cdsLimits

Specifies the y-axis limits for the CDS track (a vector of length 2). Defaults to c(-0.05, 0.05) (nominal significance).

pointRange

Specifies the minimum and maximum size of the points representing variants (vector of length 2). Point size corresponds to the absolute log of the odds ratio (OR). Defaults to c(0.25, 3).

impactScale

Named character vector mapping impact levels to point shapes. For example: c("HIGH" = 24, "MODERATE" = 21). Only used if singleVar contains an impact column.

trackSpacing

Spacing between custom tracks. Defaults to 1.

trackHeight

Height of each custom track. Defaults to 1.

trackOrder

Optional vector of track names, specifying the order in which the track are plotted (if splitByTrackType = TRUE)

splitByTrackType

Should tracks be grouped by type (TRUE/FALSE)? If TRUE, the customTracks data frame must contain a trackType column. Defaults to FALSE.

panelsizes

Relative sizes of the custom tracks vs. the other tracks. Defaults to c(1,3).

interactive

Should the plot be interactive (using plotly)? Defaults to FALSE.

svHoverFields

If interactive = TRUE, an optional character vector that specifies which columns from singleVar to include in the hover information for single variant points.

trackHoverFields

If interactive = TRUE, an optional character vector that specifies which columns from customTracks to include in the hover information for custom tracks.

cdsHoverFields

If interactive = TRUE, an optional character vector that specifies which columns from the cds data frame to include in hover information for CDS regions.