makeLegends: Add a legend

Description Usage Arguments Value See Also Examples

View source: R/gmoviz.R

Description

Makes a legend object using ComplexHeatmap package which can then be plotted using the gmovizPlot function.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
makeLegends(label_legend = FALSE, label_data = NULL,
  label_legend_title = "Gene Labels", feature_legend = FALSE,
  feature_data = NULL, feature_legend_title = "Features",
  scatterplot_legend = FALSE, scatterplot_legend_labels = c("Gains",
  "Losses"), point_colour = "black", point_outline_colour = "black",
  point_type = 21, scatterplot_legend_title = "Copy Number Variants",
  linegraph_legend = FALSE,
  linegraph_legend_labels = "Per Base Coverage",
  linegraph_legend_colours = "black",
  linegraph_legend_title = "Line Graph", background_colour = "white")

Arguments

label_legend

Whether to make a legend for labels (good for colour-coded labels).

label_data

The label data.

label_legend_title

Title for the label legend.

feature_legend

Whether to make a legend for features.

feature_data

The feature data to use for the feature legend.

feature_legend_title

Title for the features legend.

scatterplot_legend

Whether to make a legend for the scatterplot track.

scatterplot_legend_labels

A vector of the name/description of each point e.g. if a point represents methylation, use 'methylation'. If we have red/blue points for copy number gain/loss use c('gain', 'loss').

point_type, point_colour, point_outline_colour

The type and colour of points, as supplied to the drawScatterplotTrack function.

scatterplot_legend_title

Title for scatterplot track legend.

linegraph_legend

Whether to plot a legend for a line graph track.

linegraph_legend_labels

A vector of label(s) for what the line graph means (e.g. 'Per Base Coverage' for a line graph track showing coverage).

linegraph_legend_colours

The colour of to the line graph track.

linegraph_legend_title

A title for the line graph legend.

background_colour

The colour of the background (either 'white' or 'black').

Value

An object of the Legends class.

See Also

If you want more customisation over your legends, please see https://jokergoo.github.io/circlize_book/book/legends.html for a detailed guide as to how to implement legends alongside the circlize plots. To plot these legends, see gmovizPlot

Examples

1
2
3
4
5
6
7
8
## a gene label legend
## the data
labels <- data.frame(chr=c('chr1', 'chr1'), start=c(100, 300),
end=c(150, 350), label=c('a', 'b'), type=c('gene', 'lncRNA'),
colour=c('red', 'blue'))

## making the legend
makeLegends(label_legend=TRUE, label_data=labels)

gmoviz documentation built on Nov. 8, 2020, 5:41 p.m.