DisplayPars-class: DisplayPars: A class to control the plotting parameters for...

DisplayPars-classR Documentation

DisplayPars: A class to control the plotting parameters for GdObjects

Description

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

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 explicitly 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 environment needs to be re-instantiated.

Objects can be created using the constructor function DisplayPars.

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

Usage

DisplayPars(...)

getPar(x, name, ...)

## S4 method for signature 'DisplayPars,character'
getPar(x, name, asIs = FALSE)

## S4 method for signature 'DisplayPars,missing'
getPar(x, hideInternal = TRUE)

displayPars(x, name, ...)

## S4 method for signature 'DisplayPars,missing'
displayPars(x, hideInternal = TRUE)

## S4 method for signature 'DisplayPars,character'
displayPars(x, name)

## S4 method for signature 'DisplayPars'
as.list(x)

setPar(x, value, ...)

## S4 method for signature 'DisplayPars,list'
setPar(x, value, interactive = TRUE)

## S4 method for signature 'DisplayPars,character'
setPar(x, name, value, interactive = TRUE)

displayPars(x, recursive = FALSE) <- value

## S4 replacement method for signature 'DisplayPars,list'
displayPars(x, recursive = FALSE) <- value

## S4 method for signature 'DisplayPars'
show(object)

## S4 method for signature 'InferredDisplayPars'
as.list(x)

## S4 method for signature 'InferredDisplayPars'
show(object)

availableDisplayPars(class)

Arguments

...

All named arguments are stored in the object's environment as individual parameters, regardless of their type.

x

object to set the displayPar value on

name

Name of the retrieved parameter.

asIs

logical

hideInternal

logical

value

named value to be set

interactive

logical

recursive

logical

object

object

class

Either character scalar or object. Supported classes are: GdObject, GenomeAxisTrack, RangeTrack, NumericTrack, DataTrack, IdeogramTrack, StackedTrack, AnnotationTrack, DetailsAnnotationTrack, GeneRegionTrack, BiomartGeneRegionTrack, AlignmentsTrack, SequenceTrack, SequenceBSgenomeTrack, SequenceDNAStringSetTrack, SequenceRNAStringSetTrack

Value

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

availableDisplayPars returns a list of the default display parameters.

Functions

  • DisplayPars(): Constructor function.

  • getPar(): Generics for getPar.

  • getPar(x = DisplayPars, name = character): Alias for the displayPars method.

  • getPar(x = DisplayPars, name = missing): Alias for the displayPars method.

  • displayPars(): Generics for displayPars.

  • displayPars(x = DisplayPars, name = missing): Returns all available display parameters.

  • displayPars(x = DisplayPars, name = character): Returns the value of a subset of display parameters, as identified by name.

  • as.list(DisplayPars): Converts DisplayPars to list.

  • setPar(): Generics for SetPar.

    SetPar generic function

  • setPar(x = DisplayPars, value = list): Sets 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-assignment to the symbol obj is necessary.

  • setPar(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-assignment to the symbol obj is necessary.

  • displayPars(x, recursive = FALSE) <- value: Generics for ⁠displayPars<-⁠.

  • displayPars(x = DisplayPars) <- value: Replaces or adds display parameters as provided by the named list items.

  • show(DisplayPars): Show method.

  • as.list(InferredDisplayPars): Return InferredDisplayPars as a list.

  • show(InferredDisplayPars): Show method.

  • availableDisplayPars(): Get default display parameters.

Slots

pars

an environment or a list containing parameter key value pairs.

Author(s)

Florian Hahne

Examples

## 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")

ivanek/Gviz documentation built on Nov. 20, 2023, 8:16 p.m.