drawLinegraphTrack: Add a line graph track to an existing plot

Description Usage Arguments Value See Also Examples

View source: R/gmoviz.R

Description

Adds a line graph track to the existing plot. Must have initialised the circular plot (by gmovizInitialise first).

Usage

1
2
3
4
5
6
7
drawLinegraphTrack(plot_data, track_border_colour = "black",
  track_height = 0.3, yaxis_increment = NULL, ylim = NULL,
  line_shade_colour = "#5ab4ac", line_colour = "black",
  yaxis_label_size = 0.5, show_yaxis = TRUE, yaxis_tick_size = 0.4,
  yaxis_side = "left", yaxis_colour = "black",
  yaxis_location = CELL_META$sector.index, show_gridlines = TRUE,
  gridline_colour = "#aaaaaa")

Arguments

plot_data

Either: (1) a GRanges object with a metadata column of y values to plot OR (2) a data frame with four columns; chr (should match those supplied when initialising the plot); start and end (x values of the point: can both be the same if you only have a single x value for position) and then a fourth column of y values.

track_border_colour

Colour of the border of the plotting region.

track_height

The proportion (between 0 and 1) of the circle taken up by this track.

yaxis_increment

The increment the y axis and gridlines will use.

ylim

Vector of length 2; upper and lower limits for y axis.

line_shade_colour

The colour the will be used to fill in under the line. Set this to NULL if you just want the line rather than the area.

line_colour

The colour of the line itself.

yaxis_label_size

Size of the labels on the y axis.

show_yaxis

If TRUE, a y axis will be drawn.

yaxis_tick_size

Size of the ticks on the y axis.

yaxis_side

Side of the sector the y axis is on; either 'left' or 'right'.

yaxis_colour

Colour of the y axis.

yaxis_location

Sector the y axis is drawn on.

show_gridlines

If TRUE then gridlines will be drawn.

gridline_colour

Colour of the gridlines.

Value

Adds a line graph track to existing visualisation.

See Also

gmovizInitialise, which must be used to initialise the graph before this function. Also drawScatterplotTrack for a similar function which displays data as a scatterplot rather than as a line graph.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## you must initialise first!
small_ideo <- data.frame(chr=c('region 1', 'region 2', 'region 3'),
                         start=c(0, 0, 0), end=c(10000, 12000, 10000))
gmovizInitialise(small_ideo, custom_sector_width=c(0.3, 0.3, 0.3))

## make the data
smallplot_data <- data.frame(
chr = sample(c('region 1', 'region 2','region 3'), size=300, replace=TRUE),
start = seq(0, 10000, length.out=300), end = seq(0, 10000, length.out=300),
val = rnorm(300, 2, 0.5))
## line graph with no shading (just the line)
drawLinegraphTrack(smallplot_data, line_shade_colour=NULL)

## line graph with shading (a filled in shape)
drawLinegraphTrack(smallplot_data, line_shade_colour='#db009599')

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