Learn R Programming

Gviz (version 1.16.1)

settings: Setting display parameters to control the look and feel of the plots

Description

The genome track plots in this package are all highly customizable by means of so called 'display parameters'. This page highlights the use of these parameters and list all available settings for the different track classes.

Usage

addScheme(scheme, name)

getScheme(name=getOption("Gviz.scheme"))

Arguments

scheme
A named nested list of display parameters, where the first level of nesting represents Gviz track object classes, and the second level of nesting represents parameters.
name
A character scalar with the scheme name.

Details

All of the package's track objects inherit the dp slot from the GdObject parent class, which is the main container to store an object's display parameters. Internally, the content of this slot has to be an object of class DisplayPars, but the user is usually not exposed to this low level implementation. Instead, there are two main interaction points, namely the individual object constructor functions and the final plotTracks function. In both cases, all additional arguments that are not caught by any of the formally defined function parameters are being interpreted as additional display parameters and are automatically added to the aforementioned slot. The main difference here is that display parameters that are passed on to the constructor function are specific for an individual track object, whereas those supplied to the plotTracks function will be applied to all the objects in the plotting list. Not all display parameters have an effect on the plotting of all track classes, and those will be silently ignored. One can query the available display parameters for a given class as well as their default values by calling the availableDisplayPars function, or by inspecting the man pages of the individual track classes. The structure of the classes defined in this package is hierarchical, and so are the available display parameters, i.e., all objects inherit the parameters defined in the commom GdObject parent class, and so on. Once a track object has been created, the display parameters are still open for modification. To this end, the displayPars replacement method is available for all objects inheriting from class GdObject. The method takes a named list of parameters as input, e.g.: displayPars(foo) <- list(col="red", lwd=2) In the same spirit, the currently set display parameters for the object foo can be inferred using the displayPars method directly, e.g.: displayPars(foo) For track objects inheriting from class AnnotationTrack, display parameters that are not formally defined in the class definition or in any of the parent classes are considered to be valid R color identifiers that are used to distinguish between different types of annotation features. For instance, the parameter 'miRNA' will be used to color all annotation features of class miRNA. The annotation types can be set in the constructor function of the track object via the feature argument. For most of the tracks that have been inferred from one of the online repositories, this classification will usually be downloaded along with the actual annotation data.

Users might find themselves changing the same parameters over and over again, and it would make sense to register these modifications in a central location once and for all. To this end the Gviz package supports display parameter schemes. A scheme is essentially just a bunch of nested named lists, where the names on the first level of nesting should correspond to track class names, and the names on the second level to the display parameters to set. The currently active schmeme can be changed by setting the global option Gviz.scheme, and a new scheme can be registered by using the addScheme function, providing both the list and the name for the new scheme. The getScheme function is useful to get the current scheme as a list structure, for instance to use as a skeleton for your own custom scheme.

In order to make these settings persitant across R sessions one can create one or several schemes in the global environment in the special object .GvizSchemes, for instance by putting the necessary code in the .Rprofile file. This object needs to be a named list of schemes, and it will be collected when the Givz package loads. Its content is then automatically added to the collection of available schemes. Please note that because display parameters are stored with the track objects, a scheme change only has an effect on those objects that are created after the change has taken place.

See Also

AnnotationTrack

DataTrack

DisplayPars

GdObject

availableDisplayPars

collapsing

displayPars

grouping

panel.bwplot

panel.grid

panel.loess

panel.xyplot

plotTracks