DisplayPars class and method

Share:

Description

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

Usage

1
2
3
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.

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.

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.

Slots

pars:

Object of class "environment", the container for all customization parameters.

Methods

In the following code chunks, obj is considered to be an object of class DisplayPars.

Exported in the name space:

displayPars

signature(x="DisplayPars", name="character"): return the value of a subset of display parameters, as identified by name.

Usage:

displayPars(x, name)

Examples:

displayPars(obj, c("foo", "bar"))

displayPars(obj, "foobar")

displayPars

signature(x="DisplayPars", name="missing"): return all available display parameters.

Usage:

displayPars(x)

Examples:

displayPars(obj)

getPar

signature(x="DisplayPars", name="character"): alias for the displayPars method.

Usage:

getPar(x, name)

Examples:

getPar(obj, "col")

getPar

signature(x="DisplayPars", name="missing"): alias for the displayPars method.

Usage:

getPar(x)

Examples:

getPar(obj)

displayPars<-

signature(x="DisplayPars", value="list"): replace or add display parameters as provided by the named list items.

Usage:

displayPars<-(x, value)

Examples:

displayPars(obj) <- list(foo="a", bar=2)

setPar

signature(x="DisplayPars", value="character"): set the single display parameter name to value. Note that display parameters in the DisplayPars class are pass-by-reference, so no re-assignmnet to the symbol obj is necessary.

Usage:

setPar(x, name, value)

Additional Arguments:

name: the name of the display parameter to set.

Examples:

setPar(obj, "col", "red")

setPar

signature(x="DisplayPars", value="list"): set display parameters by the values of the named list in value. Note that display parameters in the DisplayPars class are pass-by-reference, so no re-assignmnet to the symbol obj is necessary.

Examples:

setPar(obj, list(col="red", lwd=2))

Internal methods:

initialize

signature(.Object = "DisplayPars"): initialize the object.

show

signature(object = "DisplayPars"): show a human-readable summary of the object.

Author(s)

Florian Hahne

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## 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")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.