Skip to contents

Creates a Manhattan plot from a data-frame of GWAS results.

Usage

manhattan_plot(
  gwas_list,
  score_thr = NULL,
  chroms = NULL,
  title = NULL,
  subtitle = NULL,
  size_range = c(1, 3),
  chrom_col = NULL,
  ncol = NULL
)

Arguments

gwas_list

Data-frame or list of data-frames containing GWAS results, each with at least a chromosome, position and either padj or score columns. If a named list, the names will be used in the plot.

score_thr

Numeric, the significance threshold on GWAS score. If a value is provided, will be represented in the Manhattan plot as a red dashed line. If NULL (default value), no significance threshold line will be drawn.

chroms

Character vector, name of chromosomes to include in the plot. If NULL (default value), all chromosomes will be included.

title

Character, title of the plot. Default value is NULL (i.e. no title will be added to the plot).

subtitle

Character, subtitle of the plot. Default value is NULL (i.e. no subtitle will be added to the plot).

size_range

Numeric vector of length 2, the minimum and maximum point size in the plot. Points size is proportional to their GWAS score. Default value is c(1, 3).

chrom_col

Character vector of colour names or code, colours to use to draw the points for each chromosome. Names will be ignored. If vector provided contains less colours than the number of chromosomes to plot, the values will be recycled. If NULL, default, colours will be automatically chosen from a predefined palette.

ncol

Integer, number of Manhattan plots per row when several GWAS results are provided.

Value

A ggplot.

Examples

if (interactive()){
x <- get_example_data()[["GWAS"]]

manhattan_plot(x)

## Adding a significance threshold line in the plot
manhattan_plot(x, score_thr = 4)


## Use only two colours for the chromosomes
manhattan_plot(x,
               score_thr = 4,
               chrom_col = c("dodgerblue1", "dodgerblue4"))
}