Learn R Programming

Gviz (version 1.16.1)

DisplayPars-class: DisplayPars class and method

Description

All tracks within this package are highly customizable. The DisplayPars class facilitates this and provides a unified API to the customization parameters.

Usage

DisplayPars(...)

availableDisplayPars(class)

Arguments

...
All named arguments are stored in the object's environment as individual parameters, regardless of their type.
class
A valid track object class name, or the object itself, in which case the class is derived directly from it.

Value

  • The return value of the constructor function is a new object of class DisplayPars. availableDisplayPars returns a list of the default display parameters.

Objects from the Class

Objects can be created using the constructor function DisplayPars.

Details

The individual parameters in a DisplayParameters class are stored as pointers in an environment. This has the upshot of not having to copy the whole track object when changing parameters, and parameters can be updated without the need to explicietly reassign the track to a symbol (i.e., updating of parameters happens in place). The downside is that upon copying of track objects, the parameter emvironment needs to be reinstantiated.

The default display parameters for a track object class can be queried using the availableDisplayPars function.

Examples

Run this code
## Construct object
dp <- DisplayPars(col="red", lwd=2, transformation=log2)
dp

## Query parameters
displayPars(dp)
displayPars(dp, "col")
getPar(dp, c("col", "transformation"))

## Modify parameters
displayPars(dp) <- list(lty=1, fontsize=3)
setPar(dp, "pch", 20)
dp

## Default parameters
availableDisplayPars("GenomeAxisTrack")

Run the code above in your browser using DataLab