locus_plot: Locus plot

View source: R/locus_plot.R

locus_plotR Documentation

Locus plot

Description

Genomic locus plot similar to locuszoom.

Usage

locus_plot(
  loc,
  filter_gene_name = NULL,
  filter_gene_biotype = NULL,
  xlab = NULL,
  cex = 1,
  cex.axis = 0.9,
  cex.lab = 1,
  cex.text = 0.7,
  use_layout = TRUE,
  heights = c(3, 2),
  showExons = TRUE,
  maxrows = 7,
  xticks = "bottom",
  border = FALSE,
  gene_col = ifelse(showExons, "blue4", "skyblue"),
  exon_col = "blue4",
  exon_border = "blue4",
  text_pos = "top",
  highlight = NULL,
  highlight_col = "red",
  blanks = "fill",
  recomb_col = "blue",
  ...
)

Arguments

loc

Object of class 'locus' to use for plot. See locus().

filter_gene_name

Vector of gene names to display.

filter_gene_biotype

Vector of gene biotypes to be filtered. Use ensembldb::listGenebiotypes() to display possible biotypes. For example, ensembldb::listGenebiotypes(EnsDb.Hsapiens.v75)

xlab

x axis title.

cex

Specifies size for points.

cex.axis

Specifies font size for axis numbering.

cex.lab

Specifies font size for axis titles.

cex.text

Font size for gene text.

use_layout

Logical whether graphics::layout is called. Default TRUE is for a standard single plot. Set to FALSE if a more complex layout with multiple plots is required e.g. using multi_layout().

heights

Ratio of top to bottom plot. See layout.

showExons

Logical whether to show exons or simply show whole gene as a rectangle

maxrows

Specifies maximum number of rows to display in gene annotation panel.

xticks

Character value of either 'top' or 'bottom' specifying whether x axis ticks and numbers are plotted on top or bottom plot window.

border

Logical whether a bounding box is plotted around upper and lower plots.

gene_col

Colour for gene lines.

exon_col

Fill colour for exons.

exon_border

Border line colour outlining exons (or genes if showExons is FALSE). Set to NA for no border.

text_pos

Character value of either 'top' or 'left' specifying placement of gene name labels.

highlight

Vector of genes to highlight.

highlight_col

Single colour or vector of colours for highlighted genes.

blanks

Controls handling of genes with blank names: "fill" replaces blank gene symbols with ensembl gene ids. "hide" hides genes which are missing gene symbols.

recomb_col

Colour for recombination rate line if recombination rate data is present. Set to NA to hide the line. See link_recomb() to add recombination rate data.

...

Other arguments passed to scatter_plot() and plot() to control the scatter plot, e.g. ylab, main, etc.

Details

This is an R version of locuszoom for generating publication ready Manhattan plots of gene loci. It references Ensembl databases for annotating genes and exons. Use locus() first to generate an object of class 'locus' for plotting. LDlink web server can be queried using function link_LD() to retrieve linkage disequilibrium (LD) information on the index SNP.

Arguments to control plotting of the gene tracks are passed onto genetracks() and for the scatter plot are passed via ... to scatter_plot(). See the documentation for each of these functions for details.

Value

No return value.

See Also

locus() scatter_plot() genetracks()

Examples

if(require(EnsDb.Hsapiens.v75)) {
data(SLE_gwas_sub)
loc <- locus(SLE_gwas_sub, gene = 'UBE2L3', flank = 1e5,
             ens_db = "EnsDb.Hsapiens.v75")
locus_plot(loc)

## Use embedded LD information in column `r2`
loc2 <- locus(SLE_gwas_sub, gene = 'IRF5', flank = c(7e4, 2e5), LD = "r2",
              ens_db = "EnsDb.Hsapiens.v75")
## Add label for index SNP
locus_plot(loc2, labels = "index")
}

myles-lewis/locuszoomr documentation built on Nov. 29, 2024, 4:49 p.m.