regionplot() displays the association results for a smaler region within one chromosome Required parameter is at least one dataset (dataframe) containing the association data (with columns CHROM,POS,P in upper or lowercase), and either gene, variant or region (represented by chr, xmin and xmax)

All other input parameters are optional

regionplot(
  df,
  ntop = 3,
  annotate = NULL,
  xmin = 0,
  size = 2,
  shape = 19,
  alpha = 1,
  label_size = 4,
  annotate_with = "ID",
  color = get_topr_colors(),
  axis_text_size = 11,
  axis_title_size = 12,
  title_text_size = 13,
  show_genes = FALSE,
  show_overview = TRUE,
  show_exons = FALSE,
  max_genes = 200,
  sign_thresh = 5e-09,
  sign_thresh_color = "red",
  sign_thresh_label_size = 3.5,
  xmax = NULL,
  ymin = NULL,
  ymax = NULL,
  protein_coding_only = FALSE,
  region_size = 1e+06,
  gene_padding = 1e+05,
  angle = 0,
  legend_title_size = 12,
  legend_text_size = 12,
  nudge_x = 0.01,
  nudge_y = 0.01,
  rsids = NULL,
  variant = NULL,
  rsids_color = NULL,
  legend_name = "Data:",
  legend_position = "right",
  chr = NULL,
  vline = NULL,
  show_gene_names = NULL,
  legend_labels = NULL,
  gene = NULL,
  title = NULL,
  label_color = NULL,
  locuszoomplot = F,
  region = NULL
)

Arguments

df

Dataframe or a list of dataframes (required columns are CHROM,POS,P), in upper- or lowercase) of association results.

ntop

Number of datasets (GWASes) to show on the top plot

annotate

Display annotation for variants with p-values below this threshold

xmin

Parameters setting the chromosomal range to display on the x-axis

size

Optional parameter setting the size of the plot points (default: size=1.2)

shape

A number of vector of numers setting the shape of the plotted points

alpha

A number or vector of numbers setting the transparancy of the plotted points

label_size

Optional parameter to set the size of the plot labels (default: label_size=3)

annotate_with

Annotate the variants with eiher Gene_Symbol or ID (default annotate_with="Gene_Symbol")

color

Optional parameter setting the color of the plot points (default: color="darkblue")

axis_text_size

Text size of the x and y axes tick labels (default: 12)

axis_title_size

Text size of the x and y title labels (default: 12)

title_text_size

Text size of the plot title (default: 13)

show_genes

Show genes instead of exons (default show_genes=FALSE)

show_overview

Show the overview plot (default show_overview=TRUE)

show_exons

Show exons instead of genees (default show_exons=FALSE)

max_genes

Only label the genes if they are fewer than max_genes (default values is 200).

sign_thresh

Optional parameter setting the threshold of the dashed red horizontal line representing the significance threshold (default: sign_thresh=5.1e-9). Multiple thresholds can be provided in a vector, e.g sign_thresh=c(5.1e-9,1.0e-6)). Set this parameter to NULL if you dont want this line to appear at all sign_thresh=NULL

sign_thresh_color

set the color of the significance threshold line or lines

sign_thresh_label_size

Set the text size of the label for the signficance thresholdds (default text sizze is 3.5)

xmax

Parameters setting the chromosomal range to display on the x-axis

ymin

Optional parameters, min and max of the y-axis, (default values: ymin=0, ymax=max(-log10(df$P)))

ymax

Optional parameters, min and max of the y-axis, (default values: ymin=0, ymax=max(-log10(df$P)))

protein_coding_only

Set this parameter to TRUE to only use protein coding genes for annotation

region_size

the size of the region used when annotating the top variant in a region (default value is 10000000 or 10 MB)

gene_padding

The size of the region around the gene, if the gene argument was used (default: gene_padding=100000)

angle

The angle of the text label

legend_title_size

Text size of the legend title

legend_text_size

Text size of the legend text

nudge_x

To vertically adjust the starting position of each gene label (this is a ggrepel parameter)

nudge_y

To horizontally adjust the starting position of each gene label (this is a ggrepel parameter)

rsids

A vector of rs ids to highlight on the plot, e.g. rsids=c("rs1234, rs45898")

variant

Zoom in on this variant. Can be either an rsid, or a dataframe (like returned from get_best_hit())

rsids_color

The color of the variants in variants_id (default color is red)

legend_name

Change the name of the legend (default: None)

legend_position

Top,bottom,left or right

chr

The chromosome to plot (i.e. chr15), only required if the input dataframe contains results from more than one chromosome

vline

Parameter (optional) to add a vertical line to the plot at a specific chromosomal position, e.g vline=204000066. Multiple values can be provided in a vector, e.g vline=c(204000066,100500188)

show_gene_names

Show the gene names even though they exceed the max_genes count

legend_labels

Legend labels

gene

Zoom in on this gene (e.g. gene=FTO)

title

Plot title (optional

label_color

Otpional parameter to change the color

region

genetic region, e.g. chr1:67038906-67359979

Value

plots using egg (https://cran.r-project.org/web/packages/egg/vignettes/Ecosystem.html)

Examples

if (FALSE) { regionplot(df,gene="FTO") }