Plot gene annotation tracks from ensembldb
data using ggplot2 and grid.
gg_genetracks(
loc,
filter_gene_name = NULL,
filter_gene_biotype = NULL,
border = FALSE,
cex.axis = 1,
cex.lab = 1,
cex.text = 0.7,
gene_col = ifelse(showExons, "blue4", "skyblue"),
exon_col = "blue4",
exon_border = "blue4",
showExons = TRUE,
maxrows = NULL,
text_pos = "top",
italics = FALSE,
xticks = TRUE,
xlab = NULL,
highlight = NULL,
highlight_col = "red",
blanks = c("fill", "hide")
)
A ggplot2 object.
Object of class 'locus' generated by locus()
.
Vector of gene names to display.
Vector of gene biotypes to be filtered. Use
ensembldb::listGenebiotypes()
to display possible biotypes. For example,
ensembldb::listGenebiotypes(EnsDb.Hsapiens.v75)
Logical whether a bounding box is plotted.
Specifies font size for axis numbering.
Specifies font size for axis titles.
Font size for gene text.
Colour for gene lines.
Fill colour for exons.
Border line colour outlining exons (or genes if
showExons
is FALSE
). Set to NA
for no border.
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.
Specifies maximum number of rows to display in gene annotation panel.
Character value of either 'top' or 'left' specifying placement of gene name labels.
Logical whether gene text is in italics.
Logical whether x axis ticks and numbers are plotted.
Title for x axis. Defaults to chromosome seqname
specified in
locus
.
Vector of genes to highlight.
Single colour or vector of colours for highlighted genes.
Controls handling of genes with blank names: "fill"
replaces
blank gene symbols with ensembl gene ids. "hide"
hides genes which are
missing gene symbols.
This function is called by locus_ggplot()
, and in turn it calls
genetracks_grob()
. It can be used to plot the gene annotation tracks on
their own as a ggplot2 object.
gene_col
, exon_col
and exon_border
set colours for all genes, while
highlight
and highlight_col
can optionally be used together to highlight
specific genes of interest. For full control over every single gene, users
can add columns gene_col
, exon_col
and exon_border
to the TX
object
within the 'locus' object. Columns added to TX
override their equivalent
arguments.
locus_ggplot()
genetracks_grob()
if(require(EnsDb.Hsapiens.v75)) {
data(SLE_gwas_sub)
loc <- locus(SLE_gwas_sub, gene = 'IRF5', flank = c(7e4, 2e5), LD = "r2",
ens_db = "EnsDb.Hsapiens.v75")
gg_genetracks(loc)
}
Run the code above in your browser using DataLab