Description Usage Arguments Details Value Objects from the Class Slots Methods Author(s) Examples
All tracks within this package are highly customizable. The
DisplayPars
class facilitates this and provides a unified API
to the customization parameters.
1 2 3 |
... |
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. |
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.
The return value of the constructor function is a new object of class
DisplayPars
.
availableDisplayPars
returns a list of the default display
parameters.
Objects can be created using the constructor function
DisplayPars
.
pars
:Object of class "environment"
, the
container for all customization parameters.
In the following code chunks, obj
is considered to be an object
of class DisplayPars
.
Exported in the name space:
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")
signature(x="DisplayPars",
name="missing")
: return all available display parameters.
Usage:
displayPars(x)
Examples:
displayPars(obj)
signature(x="DisplayPars", name="character")
:
alias for the displayPars
method.
Usage:
getPar(x, name)
Examples:
getPar(obj, "col")
signature(x="DisplayPars", name="missing")
: alias
for the displayPars
method.
Usage:
getPar(x)
Examples:
getPar(obj)
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)
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")
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:
signature(.Object = "DisplayPars")
:
initialize the object.
signature(object = "DisplayPars")
: show a
human-readable summary of the object.
Florian Hahne
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.