Learn R Programming

locuszoomr (version 1.0.0)

zoom: 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,
  scheme = c("royalblue", "skyblue", "red"),
  pcutoff = 5e-08,
  eqtl_gene = NULL,
  eqtl_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"
)

Value

No return value. Opens an interactive shiny window.

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 tries to autodetect the column.

pos

Determines which column in data contains position information. If NULL tries to autodetect the column.

p

Determines which column in data contains SNP p-values. If NULL tries to autodetect the column.

labs

Determines which column in data contains SNP rs IDs. If NULL tries to autodetect the column.

scheme

Vector of 3 colours: 1st = normal points, 2nd = colour for significant points, 3rd = index SNP(s).

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.

eqtl_beta

Optional column name for beta coefficient to display upward triangles for positive beta and downward triangles for negative beta (significant SNPs only).

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.

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.

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.