A container for other track objects from the Gviz package that allows for overlays of their content on the same region of the plot.

# S4 method for OverlayTrack
initialize(.Object, trackList, ...)

OverlayTrack(trackList = list(), name = "OverlayTrack", ...)

# S4 method for OverlayTrack,list
displayPars(x, recursive = FALSE) <- value

# S4 method for OverlayTrack
length(x)

# S4 method for OverlayTrack
chromosome(GdObject)

# S4 method for OverlayTrack
chromosome(GdObject) <- value

# S4 method for OverlayTrack
setStacks(GdObject, ...)

# S4 method for OverlayTrack
consolidateTrack(GdObject, chromosome, ...)

# S4 method for OverlayTrack
subset(x, ...)

# S4 method for OverlayTrack
drawGD(GdObject, ...)

# S4 method for OverlayTrack
show(object)

Arguments

trackList

A list of Gviz track objects that all have to inherit from class GdObject.

...

All additional parameters are ignored.

name

Character scalar of the track's name. This is not really used and only exists fro completeness.

Value

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

Details

A track to conceptionally group other Gviz track objects into a meta track in order to merge them into a single overlay visualization. Only the first track in the supplied list will be inferred when setting up the track title and axis, for all the other tracks only the panel content is plotted.

Functions

  • initialize(OverlayTrack): Initialize.

  • OverlayTrack(): Constructor function for OverlayTrack-class.

  • displayPars(x = OverlayTrack) <- value: set display parameters using the values of the named list in value. See settings for details on display parameters and customization.

  • length(OverlayTrack): return the number of subtracks.

  • chromosome(OverlayTrack): return the chromosome for which the track is defined.

  • chromosome(OverlayTrack) <- value: replace the value of the track's chromosome. This has to be a valid UCSC chromosome identifier or an integer or character scalar that can be reasonably coerced into one.

  • setStacks(OverlayTrack): recompute the stacks based on the available space and on the object's track items and stacking settings. This really just calls the setStacks methods for the contained tracks and only exists for dispatching reasons.

  • consolidateTrack(OverlayTrack): #' For a OverlayTrack apply the method on each of the subtracks in the trackList slot

  • subset(OverlayTrack): plot subset all the contained tracks in an OverlayTrack by coordinates and sort if necessary.

  • drawGD(OverlayTrack): 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(OverlayTrack): Show method.

Objects from the Class

Objects can be created using the constructor function OverlayTrack.

Author

Florian Hahne

Examples



## Object construction:
set.seed(123)
dat <- runif(100, min = -2, max = 22)
dt1 <- DataTrack(data = dat, start = sort(sample(200, 100)), width = 1, genome = "hg19")
dt2 <- DataTrack(data = dat, start = sort(sample(200, 100)), width = 1, genome = "hg19")
ot <- OverlayTrack(trackList = list(dt1, dt2))