zoom: Zoom browser to explore GWAS/eQTL results

View source: R/zoom.R

zoomR Documentation

Zoom browser to explore GWAS/eQTL results

Description

Interactive genome browser to explore GWAS/eQTL results using a shiny interface.

Usage

zoom(
  data,
  ens_db,
  chrom = NULL,
  pos = NULL,
  p = NULL,
  labs = NULL,
  data2 = NULL,
  traits = NULL,
  scheme = c("royalblue", "skyblue", "red", "#00CD00"),
  scheme2 = c("#33a02c", "#b2df8a", "purple", "red"),
  pcutoff = 5e-08,
  eqtl_gene = NULL,
  beta = NULL,
  eqtl_scheme = c("#FF0000", "#00FFFF", "#FF9000", "#0080FF", "#FFFF00", "#0000FF",
    "#80DD00", "#8000FF", "#009900", "#FF00FF"),
  add_hover = NULL,
  mh_points = 1e+05,
  recomb = NULL,
  ld_token = Sys.getenv("LDLINK_TOKEN"),
  ld_pop = "EUR",
  seq_filter = c(1:22, "X", "Y"),
  AnnotationDb = "org.Hs.eg.db",
  align = TRUE
)

Arguments

data

Dataframe of GWAS results with columns for chromosome, position, p value and SNP rs IDs. Data.tables are coerced to dataframe.

ens_db

Either a character string which specifies which Ensembl database package (version 86 and earlier for Homo sapiens) to query for gene and exon positions (see ensembldb Bioconductor package). Or an ensembldb object which can be obtained from the AnnotationHub database. See the vignette and the AnnotationHub Bioconductor package for how to create this object.

chrom

Determines which column in data contains chromosome information. If NULL or NA tries to autodetect the column. If data2 is provided, this is a vector where 1st element refers to data and 2nd element refers to data2.

pos

Determines which column in data (and optionally data2) contains position information. See chrom.

p

Determines which column in data (and optionally data2) contains SNP p-values. See chrom.

labs

Determines which column in data (and optionally data2) contains SNP rs IDs. See chrom.

data2

Optional 2nd dataframe of GWAS results for comparison.

traits

Vector of trait names for identifying data and data2 datasets.

scheme

Vector of 4 colours for main Manhattan plot: 1st, 2nd colours for alternating chromosomes, 3rd colour for significant points, 4th colour for highlighting chromosomes.

scheme2

Vector of colours for 2nd Manhattan plot.

pcutoff

Cut-off for p value significance. Defaults to p = 5e-08. Set to NULL to disable.

eqtl_gene

Determines which column in data contains eQTL genes. Currently data2 cannot be used to show eQTL colour data.

beta

Optional column name for beta coefficient to display upward triangles for positive beta and downward triangles for negative beta (significant SNPs only). If data2 is supplied, then a vector can be used to specify different beta columns in data and data2; use NA to indicate no beta.

eqtl_scheme

Colour scheme for eQTL genes.

add_hover

Optional vector of column names in data to add to the plotly hover text for scatter points. Not available for data2.

mh_points

Number of points to display in manhattan plot. Default is 1e5.

recomb

Optional GRanges class object of recombination data.

ld_token

Personal access token for the LDlink API, available from https://ldlink.nih.gov/?tab=apiaccess. See LDlinkR package documentation and link_LD(). When empty the LD controls are hidden. LD information can only be requested if eqtl_gene is left as NULL. LD is fetched on demand, not automatically, by pressing the "Get LD" button.

ld_pop

1000 Genomes population used for LD. Defaults to "EUR". See LDlinkR::LDproxy() for the available codes.

seq_filter

Vector of acceptable chromosomes. Used to restrict queries to standard chromosome assembly.

AnnotationDb

An AnnotationDb gene annotation database, specified either as a character string or as an AnnotationDb class object, used to obtain expanded gene names. The ensembl database specified in ens_db is queried first. Set to NULL to disable this feature.

align

Logical, whether to align the chromosomes in the main Manhattan plots and chromosome subplots when comparing 2 GWAS.

Details

This launches a shiny app to explore the GWAS/eQTL results through visualising the Manhattan plot and exploring regional Manhattan plots of gene loci through selecting points or searching SNPs/genes.

Linkage disequilibrium data can be pulled from LDlink API within the app using the 'Get LD' button in the Settings dropdown. These buttons only appear once a user provides a LDlink API token via the ld_token argument. Each API request takes around 5-10 secs. 'Get LD' pins the current index SNP as the reference variant and colours points by r^2 with it. The reference stays pinned while you pan and zoom, so the colouring keeps its meaning and repeat queries are served from the memoise cache rather than the API.

Value

No return value. Opens an interactive shiny window.


locuszoomr documentation built on Oct. 9, 2026, 5:06 p.m.