A fully customizable track object to be populated via a user-defined plotting function.

# S4 method for CustomTrack
initialize(.Object, plottingFunction, variables, ...)

CustomTrack(
  plottingFunction = function(GdObject, prepare = FALSE, ...) {
 },
  variables = list(),
  name = "CustomTrack",
  ...
)

# S4 method for CustomTrack
drawGD(GdObject, minBase, maxBase, prepare = FALSE, ...)

# S4 method for CustomTrack
show(object)

Arguments

.Object

.Object

plottingFunction

A user-defined function to be executed once the track coordinates have been properly set up. The function needs to accept two mandatory arguments: GdObject, the CustomTrack object to be plotted, and prepare, a logical flag indicating whether the function has been called in preparation mode or in drawing mode. It also needs to return the input GdObject, potentially with modifications.

variables

A list of additional variables for the user-defined plotting function.

...

Additional items which will all be interpreted as further display parameters. See settings and the "Display Parameters" section below for details.

name

Character scalar of the track's name.

GdObject

Object of GdObject-class.

minBase

minBase

maxBase

maxBase

prepare

logical

object

object

Value

The return value of the constructor function is a new object of class CustomTrack.

Details

A track to allow for any sort of plotting, with the currently displayed genomic location set. Essentially this acts as a simple callback into the Gviz plotting machinery after all the track panels and coordinates have been set up. It is entirely up to the user what to plot in the track, or even to use the predefined coordinate system. The only prerequisite is that all plotting operations need to utilize Grid graphics.

Functions

  • initialize(CustomTrack): Initialize.

  • CustomTrack(): Objects can be created using the constructor function.

  • drawGD(CustomTrack): plot the object to a graphics device. The return value of this method is the input object, potentially updated during the plotting operation. Internally, there are two modes in which the method can be called. Either in 'prepare' mode, in which case no plotting is done but the object is preprocessed based on the available space, or in 'plotting' mode, in which case the actual graphical output is created. Since subsetting of the object can be potentially costly, this can be switched off in case subsetting has already been performed before or is not necessary.

  • show(CustomTrack): Show method.

Author

Florian Hahne

Examples

## Object construction:

## An empty object
CustomTrack()
#> CustomTrack 'CustomTrack'