genetrack_ly: Gene tracks using 'plotly'

View source: R/genetrack_ly.R

genetrack_lyR Documentation

Gene tracks using 'plotly'

Description

Plot gene annotation tracks from ensembldb data using plotly.

Usage

genetrack_ly(
  locus,
  filter_gene_name = NULL,
  filter_gene_biotype = NULL,
  cex.text = 0.7,
  gene_col = ifelse(showExons, "blue4", "skyblue"),
  exon_col = "blue4",
  exon_border = "blue4",
  showExons = TRUE,
  maxrows = 8,
  width = 600,
  xlab = NULL,
  blanks = c("fill", "hide", "show"),
  plot = TRUE
)

Arguments

locus

Object of class 'locus' generated by 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)

cex.text

Font size for gene text.

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.

showExons

Logical whether to show exons or simply show whole gene as a rectangle. If showExons = FALSE colours are specified by exon_border for rectangle border and gene_col for the fill colour.

maxrows

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

width

Width of plotly plot in pixels which is purely used to prevent overlapping text for gene names.

xlab

Title for x axis. Defaults to chromosome seqname specified in locus.

blanks

Controls handling of genes with blank names: "fill" replaces blank gene symbols with ensembl gene ids. "hide" completely hides genes which are missing gene symbols. "show" shows gene lines but no label (hovertext is still available).

plot

Logical whether to produce plotly object or return plot coordinates.

Details

This function can used to plot gene annotation tracks on their own.

Value

Either a 'plotly' plotting object showing gene tracks, or if plot = FALSE a list containing TX, a dataframe of coordinates for gene transcripts, and EX, a dataframe of coordinates for exons.

Examples

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

myles-lewis/locuszoomr documentation built on April 16, 2024, 11:13 p.m.