CustomTrack-class: CustomTrack class and methods

CustomTrack-classR Documentation

CustomTrack class and methods

Description

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

Usage

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

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

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

## S4 method for signature '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

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.

Value

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

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(s)

Florian Hahne

See Also

DisplayPars

GdObject

GRanges

HighlightTrack

ImageMap

IRanges

RangeTrack

DataTrack

collapsing

grouping

panel.grid

plotTracks

settings

Examples

## Object construction:

## An empty object
CustomTrack()

ivanek/Gviz documentation built on Nov. 20, 2023, 8:16 p.m.