IdeogramTrack-class {Gviz} | R Documentation

## IdeogramTrack class and methods

### Description

A class to represent the schematic display of a chromosome, also known as an ideogram. The respective information is typically directly fetched from UCSC.

### Usage

    IdeogramTrack(chromosome=NULL, genome, name=NULL, bands=NULL, ...)

### Arguments

`chromosome` | The chromosome for which to create the ideogram. Has to be a valid UCSC chromosome identifier of the form `chrx`, or a single integer or numeric character unless `option(ucscChromosomeNames=FALSE)`. The user has to make sure that the respective chromosome is indeed defined for the the track's genome.
`genome` | The genome on which to create the ideogram. This has to be a valid UCSC genome identifier if the ideogram data is to be fetched from the UCSC repository.
`name` | Character scalar of the track's name used in the title panel when plotting. Defaults to the selected chromosome.
`bands` | A `data.frame` with the cytoband information for all available chromosomes on the genome similar to the data that would be fetched from UCSC. The table needs to contain the mandatory columns `chrom`, `chromStart`, `chromEnd`, `name` and `gieStain` with the chromosome name, cytoband start and end coordinates, cytoband name and coloring information, respectively. This can be used when no connection to the internet is available or when the cytoband information has been cached locally to avoid the somewhat slow connection to UCSC.
`...` | Additional items which will all be interpreted as further display parameters.

### Details

Ideograms are schematic depictions of chromosomes, including chromosome band information and centromere location. The relevant data for various species is stored in the UCSC data base. The initializer method of the class will automatically fetch the respective data for a given genome and chromosome from UCSC and fill the appropriate object slots. When plotting `IdeogramTracks`, the current genomic location is indicated on the chromosome by a colored box.

The `Gviz.ucscUrl` option controls which URL is being used to connect to UCSC. For instance, one could switch to the European UCSC mirror by calling `options(Gviz.ucscUrl="http://genome-euro.ucsc.edu/cgi-bin/"`.

### Value

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

### Objects from the Class

Objects can be created using the constructor function `IdeogramTrack`.

### Slots

`range`:

  Object of class `GRanges`, inherited from class `StackedTrack` containing the chromosome band information. This slot is filled automatically by the initializer method.

`bandTable`:

  Object of class`data.frame` containing the chromosome band information in the format of UCSC. This slot is filled automatically by the initializer.

`bandTable`:

  Object of class `data.frame` containing the chromosome band information for all chromosomes. This slot is filled automatically by the initializer method and only exists to prevent having to redo the rtracklayer query ervery time the chromosome is changed.

`chromosome`:

  Object of class `"character"`, inherited from class `StackedTrack` defining the ideogram's chromosome.

`genome`:

  Object of class `"character"` inherited from class `StackedTrack` defining the ideogram's genome.

`dp`:

  Object of class `DisplayPars`, inherited from class `GdObject`

`name`:

  Object of class `"character"`, inherited from class `GdObject`

`imageMap`:

  Object of class `ImageMap`, inherited from class `GdObject`

### Extends

Class `"RangeTrack"`, directly.

Class `"GdObject"`, by class "RangeTrack", distance 2.

### Methods

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

Exported in the name space:

start, end, width, position

  `signature(x/GdObject="IdeogramTrack")`: although `IdeogramTracks` inherit from `RangeTrack`, the notion of coordinates is not particularly useful. Hence the coordinate methods all return `NULL`.

  Usage:

  `start(x)`

  `end(x)`

  `width(x)`

  `position(GdObject)`

  Examples:

    `start(obj)`

    `end(obj)`

    `width(obj)`

start<-, end<-, width<-

  `signature(x="RangeTrack")`: although `IdeogramTracks` inherit from `RangeTrack`, the notion of coordinates is not particularly useful. Hence the coordinate replacement methods all return the unaltered input object.

  Usage:

  `start<-(x, value)`

  `end<-(x, value)`

  `width<-(x, value)`

  Additional Arguments:

    `value`: replacement value.

  Examples:

    `start(obj) <- 1:10`

    `end(obj) <- 20:30`

    `width(obj) <- 1`

chromosome<-

  `signature(GdObject="IdeogramTrack")`: replace the value of the track's chromosome. This has to be a valid UCSC chromosome identifier or an integer or character scalar that can be reasonably coerced into one. The chromosome band information is updated automatically.

  Usage:

  `chromosome<-(GdObject, value)`

  Additional Arguments:

    `value`: replacement value.

  Examples:

    `chromosome(obj) <- "chr12"`

genome<-

  `signature(x="IdeogramTrack")`: set the track's genome. This has to be a valid UCSC identifier. The chromosome band information is updated automatically.

  Usage:

  `genome<-(x, value)`

  Additional Arguments:

    `value`: replacement value.

  Examples:

    `genome(obj) <- "mm9"`

subset

  `signature(x="IdeogramTrack")`: subsetting does not make much sense for these object, hence the unalered object is returned.

  Usage:

  `subset(x, ...)`

  Additional Arguments:

    `...`: all further arguments are ignored.

  Examples:

    `subset(obj)`

[

  `signature(x="IdeogramTrack", i="ANY", j="ANY", drop="ANY")`: subsetting of `IdeogramTrack` objects does not make much sense, hence the unaltered input argument is returned.

  Additional Arguments:

    `i`, `j`: subsetting indices, `j` is ignored.

    `drop`: argument is ignored.

  Examples:

    `obj[1:5]`

Internal methods:

drawGD

  `signature(gdObject="IdeogramTrack")`: plot the object to a graphics device. The return value of this method is the input object, potentially updated during the plotting operation. Internally, there are two modes in which the method can be called. Either in 'prepare' mode, in which case no plotting is done but the object is preprocessed based on the available space, or in 'plotting' mode, in which case the actual graphical output is created. Since subsetting of the object can be potentially costly, this can be switched off in case subsetting has already been performed before or is not necessary.

  Usage:

  `drawGD(GdObject, minBase, maxBase, prepare=FALSE, subset=TRUE, ...)`

  Additional Arguments:

    `minBase`, `maxBase`: the coordinate range to plot.

    `prepare`: run method in preparation or in production mode.

    `subset`: subset the object to the visible region or skip the potentially expensive subsetting operation.

    `...`: all further arguments are ignored.

  Examples:

    `Gviz:::drawGD(obj)`

    `Gviz:::drawGD(obj, minBase=1, maxBase=100)`

    `Gviz:::drawGD(obj, prepare=TRUE, subset=FALSE)`

initialize

  `signature(.Object="IdeogramTrack")`: initialize the object.

show

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

Inherited methods:

chromosome

  `signature(GdObject="IdeogramTrack")`: return the chromosome for which the track is defined.

  Usage:

  `chromosome(GdObject)`

  Examples:

    `chromosome(obj)`

feature

  `signature(GdObject="IdeogramTrack")`: return the grouping information for track items. For certain sub-classes, groups may be indicated by different color schemes when plotting. See `grouping` or `AnnotationTrack` and `GeneRegionTrack` for details.

  Usage:

  `feature(GdObject)`

  Examples:

    `feature(obj)`

feature<-

  `signature(gdObject="IdeogramTrack", value="character")`: set the grouping information for track items. This has to be a factor vector (or another type of vector that can be coerced into one) of the same length as the number of items in the `IdeogramTrack`. See `grouping` or `AnnotationTrack` and `GeneRegionTrack` for details.

  Usage:

  `feature<-(GdObject, value)`

  Additional Arguments:

    `value`: replacement value.

  Examples:

    `feature(obj) <- c("a", "a", "b", "c", "a")`

genome

  `signature(x="IdeogramTrack")`: return the track's genome.

  Usage:

  `genome(x)`

  Examples:

    `genome(obj)`

length

  `signature(x="IdeogramTrack")`: return the number of items in the track.

  Usage:

  `length(x)`

  Examples:

    `length(obj)`

range

  `signature(x="IdeogramTrack")`: return the genomic coordinates for the track as an object of class `IRanges`.

  Usage:

  `range(x)`

  Examples:

    `range(obj)`

ranges

  `signature(x="IdeogramTrack")`: return the genomic coordinates for the track along with all additional annotation information as an object of class `GRanges`.

  Usage:

  `ranges(x)`

  Examples:

    `ranges(obj)`

split

  `signature(x="IdeogramTrack")`: splitting is not a useful operation for `IdeogramTrack` objects. Usage:

  `split(x, f, ...)`

  Additional Arguments:

    `f`: the splitting factor.

    `...`: all further arguments are ignored.

  Examples:

    `split(obj, c("a", "a", "b", "c", "a"))`

strand

  `signature(x="IdeogramTrack")`: strand information is not relevant for `IdeogramTrack` objects.

  Usage:

  `strand(x)`

  Examples:

    `strand(obj)`

strand<-

  `signature(x="IdeogramTrack")`: strand information is not relevant for `IdeogramTrack` objects.

  Usage:

  `strand<-(x, value)`

  Additional Arguments:

    `value`: replacement value.

  Examples:

    `strand(obj) <- "+"`

values

  `signature(x="IdeogramTrack")`: return all additional annotation information except for the genomic coordinates for the track items as a data.frame.

  Usage:

  `values(x)`

  Examples:

    `values(obj)`

coerce

  `signature(from="IdeogramTrack", to="data.frame")`: coerce the `GRanges` object in the `range` slot into a regular data.frame.

  Examples:

    `as(obj, "data.frame")`

displayPars

  `signature(x="IdeogramTrack", name="character")`: list the value of the display parameter `name`. See `settings` for details on display parameters and customization.

  Usage:

  `displayPars(x, name)`

  Examples:

    `displayPars(obj, "col")`

displayPars

  `signature(x="IdeogramTrack", name="missing")`: list the value of all available display parameters. See `settings` for details on display parameters and customization.

  Examples:

    `displayPars(obj)`

getPar

  `signature(x="IdeogramTrack", name="character")`: alias for the `displayPars` method. See `settings` for details on display parameters and customization.

  Usage:

  `getPar(x, name)`

  Examples:

    `getPar(obj, "col")`

getPar

  `signature(x="IdeogramTrack", name="missing")`: alias for the `displayPars` method. See `settings` for details on display parameters and customization.

  Examples:

    `getPar(obj)`

displayPars<-

  `signature(x="IdeogramTrack", value="list")`: set display parameters using the values of the named list in `value`. See `settings` for details on display parameters and customization.

  Usage:

  `displayPars<-(x, value)`

  Examples:

    `displayPars(obj) <- list(col="red", lwd=2)`

setPar

  `signature(x="IdeogramTrack", value="character")`: set the single display parameter `name` to `value`. Note that display parameters in the `IdeogramTrack` class are pass-by-reference, so no re-assignmnet to the symbol `obj` is necessary. See `settings` for details on display parameters and customization.

  Usage:

  `setPar(x, name, value)`

  Additional Arguments:

    `name`: the name of the display parameter to set.

  Examples:

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

setPar

  `signature(x="IdeogramTrack", value="list")`: set display parameters by the values of the named list in `value`. Note that display parameters in the `IdeogramTrack` class are pass-by-reference, so no re-assignmnet to the symbol `obj` is necessary. See `settings` for details on display parameters and customization.

  Examples:

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

group

  `signature(GdObject="IdeogramTrack")`: return grouping information for the individual items in the track. Unless overwritten in one of the sub-classes, this usualy returns `NULL`.

  Usage:

  `group(GdObject)`

  Examples:

    `group(obj)`

names

  `signature(x="IdeogramTrack")`: return the value of the `name` slot.

  Usage:

  `names(x)`

  Examples:

    `names(obj)`

names<-

  `signature(x="IdeogramTrack", value="character")`: set the value of the `name` slot.

  Usage:

  `names<-(x, value)`

  Examples:

    `names(obj) <- "foo"`

coords

  `signature(ImageMap="IdeogramTrack")`: return the coordinates from the internal image map.

  Usage:

  `coords(ImageMap)`

  Examples:

    `coords(obj)`

tags

  `signature(x="IdeogramTrack")`: return the tags from the internal image map.

  Usage:

  `tags(x)`

  Examples:

    `tags(obj)`

drawAxis

  `signature(GdObject="IdeogramTrack")`: add a y-axis to the title panel of a track if necessary. For `IdeogramTrack` objects this does not plot anything and returns `NULL`.

  Usage:

  `drawAxis(x, ...)`

  Additional Arguments:

    `...`: all further arguments are ignored.

  Examples:

    `Gviz:::drawAxis(obj)`

drawGrid

  `signature(GdObject="IdeogramTrack")`: superpose a grid on top of a track if necessary. For `IdeogramTrack` objects this does not plot anything and returns `NULL`.

  Usage:

  `drawGrid(GdObject, ...)`

  Additional Arguments:

    `...`: additional arguments are ignored.

  Examples:

    `Gviz:::drawGrid(obj)`

### Display Parameters

The following display parameters are set for objects of class `IdeogramTrack` upon instantiation, unless one or more of them have already been set by one of the optional sub-class initializers, which always get precedence over these global defaults. See `settings` for details on setting graphical parameters for tracks.

  `background.title="transparent"`: Character scalar. The background color for the title panel. Defaults to omit the background.

  `bevel=0.45`: Numeric scalar, between 0 and 1. The level of smoothness for the two ends of the ideogram.

  `centromereShape="triangle"`: Character scalar. The shape of the centromere. Only "triangle" or "circle" is accepted. Default to "triangle"

  `cex=0.8`: Numeric scalar. The overall font expansion factor for the chromosome name text.

  `cex.bands=0.7`: Numeric scalar. The font expansion factor for the chromosome band identifier text.

  `col="red"`: Character scalar. The border color used for the highlighting of the currently displayed genomic region.

  `col.border.title="transparent"`: Integer or character scalar. The border color for the title panels.

  `fill="#FFE3E6"`: Character scalar. The fill color used for the highlighting of the currently displayed genomic region.

  `fontcolor="#808080"`: Character scalar. The font color for the chromosome name text.

  `fontface=1`: Character scalar. The font face for the chromosome name text.

  `fontfamily="sans"`: Character scalar. The font family for the chromosome name text.

  `fontsize=10`: Numeric scalar. The font size for the chromosome name text.

  `lty=1`: Character or integer scalar. The line type used for the highlighting of the currently displayed genomic region.

  `lwd=1`: Numeric scalar. The line width used for the highlighting of the currently displayed genomic region.

  `lwd.border.title=1`: Integer scalar. The border width for the title panels.

  `outline=FALSE`: Logical scalar. Add borders to the individual chromosome staining bands.

  `showBandId=FALSE`: Logical scalar. Show the identifier for the chromosome bands if there is space for it.

  `showId=TRUE`: Logical scalar. Indicate the chromosome name next to the ideogram.

  `showTitle=FALSE`: Logical scalar. Plot a title panel. Defaults to omit the title panel.

  `size=NULL`: Numeric scalar. The relative size of the track. Defaults to automatic size setting. Can also be overridden in the `plotTracks` function.

Additional display parameters are being inherited from the respective parent classes. Note that not all of them may have an effect on the plotting of `IdeogramTrack` objects.

  `GdObject`:

    `alpha=1`: Numeric scalar. The transparency for all track items.

    `alpha.title=NULL`: Numeric scalar. The transparency for the title panel.

    `background.legend="transparent"`: Integer or character scalar. The background color for the legend.

    `background.panel="transparent"`: Integer or character scalar. The background color of the content panel.

    `cex.axis=NULL`: Numeric scalar. The expansion factor for the axis annotation. Defaults to `NULL`, in which case it is automatically determined based on the available space.

    `cex.title=NULL`: Numeric scalar. The expansion factor for the title panel. This effects the fontsize of both the title and the axis, if any. Defaults to `NULL`, which means that the text size is automatically adjusted to the available space.

    `col.axis="white"`: Integer or character scalar. The font and line color for the y axis, if any.

    `col.frame="lightgray"`: Integer or character scalar. The line color used for the panel frame, if `frame==TRUE`

    `col.grid="#808080"`: Integer or character scalar. Default line color for grid lines, both when `type=="g"` in `DataTrack`s and when display parameter `grid==TRUE`.

    `col.line=NULL`: Integer or character scalar. Default colors for plot lines. Usually the same as the global `col` parameter.

    `col.symbol=NULL`: Integer or character scalar. Default colors for plot symbols. Usually the same as the global `col` parameter.

    `col.title="white"` `(Aliases: fontcolor.title)`: Integer or character scalar. The border color for the title panels

    `collapse=TRUE`: Boolean controlling whether to collapse the content of the track to accomodate the minimum current device resolution. See `collapsing` for details.

    `fontface.title=2`: Integer or character scalar. The font face for the title panels.

    `fontfamily.title="sans"`: Integer or character scalar. The font family for the title panels.

    `frame=FALSE`: Boolean. Draw a frame around the track when plotting.

    `grid=FALSE`: Boolean, switching on/off the plotting of a grid.

    `h=-1`: Integer scalar. Parameter controlling the number of horizontal grid lines, see `panel.grid` for details.

    `lineheight=1`: Numeric scalar. The font line height for all text, unless a more specific definition exists.

    `lty.grid="solid"`: Integer or character scalar. Default line type for grid lines, both when `type=="g"` in `DataTrack`s and when display parameter `grid==TRUE`.

    `lwd.grid=1`: Numeric scalar. Default line width for grid lines, both when `type=="g"` in `DataTrack`s and when display parameter `grid==TRUE`.

    `lwd.title=1`: Integer scalar. The border width for the title panels

    `min.distance=1`: Numeric scalar. The minimum pixel distance before collapsing range items, only if `collapse==TRUE`. See `collapsing` for details.

    `min.height=3`: Numeric scalar. The minimum range height in pixels to display. All ranges are expanded to this size in order to avoid rendering issues. See `collapsing` for details.

    `min.width=1`: Numeric scalar. The minimum range width in pixels to display. All ranges are expanded to this size in order to avoid rendering issues. See `collapsing` for details.

    `reverseStrand=FALSE`: Logical scalar. Set up the plotting coordinates in 3' -> 5' direction if `TRUE`. This will effectively mirror the plot on the vertical axis.

    `rotation=0`: The rotation angle for all text unless a more specific definiton exists.

    `rotation.title=90` `(Aliases: rotation.title)`: The rotation angle for the text in the title panel. Even though this can be adjusted, the automatic resizing of the title panel will currently not work, so use at own risk.

    `showAxis=TRUE`: Boolean controlling whether to plot a y axis (only applies to track types where axes are implemented).

    `v=-1`: Integer scalar. Parameter controlling the number of vertical grid lines, see `panel.grid` for details.

### Note

When fetching ideogram data from UCSC the results are cached for faster acces. See `clearSessionCache` on details to delete these cached items.

### Author(s)

Florian Hahne

### See Also

`AnnotationTrack`

`data.frame`

`DisplayPars`

`GdObject`

`GeneRegionTrack`

`GRanges`

`ImageMap`

`IRanges`

`RangeTrack`

`StackedTrack`

`clearSessionCache`

`collapsing`

`DataTrack`

`grouping`

`panel.grid`

`plotTracks`

`settings`

### Examples

    ## Construct the object
    ## Not run:
    idTrack <- IdeogramTrack(chromosome=7, genome="mm9")

    ## End(Not run)

    ## Plotting
    plotTracks(idTrack, from=5000000, to=9000000)

    ## Track names
    names(idTrack)
    names(idTrack) <- "foo"
    plotTracks(idTrack, from=5000000, to=9000000)

    ## Accessors
    chromosome(idTrack)
    ## Not run:
    chromosome(idTrack) <- "chrX"

    ## End(Not run)

    genome(idTrack)
    ## Not run:
    genome(id) <- "hg19"

    ## End(Not run)

    range(idTrack)
    ranges(idTrack)

    ## Annotation
    values(idTrack)

    ## coercion
    as(idTrack, "data.frame")

[Package Gviz version 1.36.2 Index]